image-download: tests to catch stray output

Add unit tests to ensure that any stray output (eg print
statements) during image-download cause a test failure.

Regression test for bug 1488914.

Change-Id: Ic19ba5693d059bf7c283702e7c333672a878a1a1
Partial-bug: 1488914
This commit is contained in:
Stuart McLaren
2015-08-31 10:29:03 +00:00
parent 8a584d5938
commit 7ed22a91d3
4 changed files with 188 additions and 4 deletions
+7
View File
@@ -117,6 +117,10 @@ class FakeResponse(object):
self.raw = RawRequest(headers, body=body, reason=reason,
version=version, status=status_code)
@property
def status(self):
return self.status_code
@property
def ok(self):
return (self.status_code < 400 or
@@ -151,6 +155,9 @@ class FakeResponse(object):
break
yield chunk
def release_conn(self, **kwargs):
pass
class TestCase(testtools.TestCase):
TEST_REQUEST_BASE = {