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
+2 -4
View File
@@ -283,10 +283,8 @@ def save_image(data, path):
:param path: path to save the image to
"""
if path is None:
if six.PY3:
image = sys.stdout.buffer
else:
image = sys.stdout
image = getattr(sys.stdout, 'buffer',
sys.stdout)
else:
image = open(path, 'wb')
try: