summaryrefslogtreecommitdiff
path: root/python/subunit/_output.py
diff options
context:
space:
mode:
authorThomi Richards <thomi.richards@canonical.com>2013-11-19 11:01:15 +1300
committerThomi Richards <thomi.richards@canonical.com>2013-11-19 11:01:15 +1300
commit8782262d7d0750beb6111b8197865343fe0a8637 (patch)
tree9d3a8090ab2f20d4ad289c462b7133fc3f446a54 /python/subunit/_output.py
parentd54483571e0cb8da9da9bfa5c407a6c152027a28 (diff)
downloadsubunit-git-8782262d7d0750beb6111b8197865343fe0a8637.tar.gz
Extend test to make sure that by default no mime-type is specified.
Diffstat (limited to 'python/subunit/_output.py')
-rw-r--r--python/subunit/_output.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/python/subunit/_output.py b/python/subunit/_output.py
index 43097e6..b4df54c 100644
--- a/python/subunit/_output.py
+++ b/python/subunit/_output.py
@@ -117,19 +117,22 @@ def generate_bytestream(args, output_writer):
output_writer.stopTestRun()
-def write_chunked_file(file_obj, test_id, output_writer, chunk_size=1024):
+def write_chunked_file(file_obj, test_id, output_writer, chunk_size=1024,
+ mime_type=None):
reader = partial(file_obj.read, chunk_size)
for chunk in iter(reader, ''):
output_writer.status(
test_id=test_id,
file_name=file_obj.name,
file_bytes=chunk,
+ mime_type=mime_type,
eof=False,
)
output_writer.status(
test_id=test_id,
file_name=file_obj.name,
file_bytes='',
+ mime_type=mime_type,
eof=True,
)