From 3a7f80aa472794951461cf95fac4ec029167c17d Mon Sep 17 00:00:00 2001 From: Kota Tsuyuzaki Date: Thu, 28 Aug 2014 19:20:02 -0700 Subject: [PATCH] Small Fix for FakeServerConnection Current FakeServerConnection might cause 499 error in some unit tests because sent (put) data will be overridden by new one every time. e.g. When calling conn.queue.put() twice and more in an object PUT sequence, we can use only a last chunk as the body. This fixes it to merge all chunks as a body. Change-Id: I463e9e2b454e3f3eb26950b3af4c8b8167a9a971 --- test/unit/proxy/test_sysmeta.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/unit/proxy/test_sysmeta.py b/test/unit/proxy/test_sysmeta.py index c15b51bc21..67cb572ea3 100644 --- a/test/unit/proxy/test_sysmeta.py +++ b/test/unit/proxy/test_sysmeta.py @@ -51,6 +51,7 @@ class FakeServerConnection(WSGIContext): environ = {'REQUEST_METHOD': self.method} req = Request.blank(self.path, environ, headers=self.req_headers, body=self.data) + self.data = '' self.resp = self._app_call(req.environ) self.resp_iter = iter(self.resp) if self._response_headers is None: @@ -66,7 +67,7 @@ class FakeServerConnection(WSGIContext): return ContinueResponse() def send(self, data): - self.data = data + self.data += data def __call__(self, ipaddr, port, device, partition, method, path, headers=None, query_string=None):