From 64bb0413988d7a322dff52bb31f5103caf6140e1 Mon Sep 17 00:00:00 2001 From: Clay Gerrard Date: Wed, 14 Sep 2016 10:09:34 -0700 Subject: [PATCH] Assert metadata of SLO PUT from container sync In addition to being in the pure unmolested ondisk format from the source container; the manifest must also include the normally protected X-Static-Large-Object metadata. Change-Id: Ic6638e8258e9dec755f8d9630f0586bd3c9b4420 Related-Change: I8d503419b7996721a671ed6b2795224775a7d8c6 Signed-off-by: Tim Burke --- test/unit/common/middleware/test_slo.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/unit/common/middleware/test_slo.py b/test/unit/common/middleware/test_slo.py index 22a9a63c3a..03b5b0d2da 100644 --- a/test/unit/common/middleware/test_slo.py +++ b/test/unit/common/middleware/test_slo.py @@ -133,7 +133,13 @@ class TestSloMiddleware(SloTestCase): self.app.register('PUT', path, swob.HTTPCreated, {}) resp_iter = self.slo(req.environ, start_response) self.assertEqual(b'', b''.join(resp_iter)) - self.assertEqual(self.app.calls, [('PUT', path)]) + self.assertEqual([ + ('PUT', path, { + 'Host': 'localhost:80', + 'Content-Length': str(len(body)), + 'X-Static-Large-Object': 'true', + }), + ], self.app.calls_with_headers) self.assertEqual(body, self.app.uploaded[path][1]) self.assertEqual(resp_status[0], '201 Created')