Skip to content

Instantly share code, notes, and snippets.

@tipabu
Created January 2, 2020 22:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tipabu/c28fb327c0bf0c74ac418b08e0986395 to your computer and use it in GitHub Desktop.
Save tipabu/c28fb327c0bf0c74ac418b08e0986395 to your computer and use it in GitHub Desktop.
diff --git a/test/unit/__init__.py b/test/unit/__init__.py
index d80fccdad..c81d181fe 100644
--- a/test/unit/__init__.py
+++ b/test/unit/__init__.py
@@ -1183,7 +1183,12 @@ class StubResponse(object):
return self.readable.read(amt)
def __repr__(self):
- return '<StubResponse %s>' % self.status
+ info = ['Status: %s' % self.status]
+ if self.headers:
+ info.append('Headers: %r' % dict(self.headers))
+ if self.body:
+ info.append('Body: %r' % self.body)
+ return '<StubResponse %s>' % ', '.join(info)
def encode_frag_archive_bodies(policy, body):
diff --git a/test/unit/proxy/controllers/test_obj.py b/test/unit/proxy/controllers/test_obj.py
index 329ce9065..b7ab7d335 100644
--- a/test/unit/proxy/controllers/test_obj.py
+++ b/test/unit/proxy/controllers/test_obj.py
@@ -799,6 +799,7 @@ class CommonObjectControllerMixin(BaseObjectControllerMixin):
with capture_http_requests(get_response):
resp = req.get_response(self.app)
self.assertEqual(resp.status_int, 404)
+ self.assertEqual(resp.headers['X-Backend-Timestamp'], '2')
def test_container_sync_delete(self):
ts = (utils.Timestamp(t) for t in itertools.count(int(time.time())))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment