From 8782262d7d0750beb6111b8197865343fe0a8637 Mon Sep 17 00:00:00 2001 From: Thomi Richards Date: Tue, 19 Nov 2013 11:01:15 +1300 Subject: [PATCH] Extend test to make sure that by default no mime-type is specified. --- python/subunit/_output.py | 5 ++++- python/subunit/tests/test_output_filter.py | 12 ++++++------ 2 files changed, 10 insertions(+), 7 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, ) diff --git a/python/subunit/tests/test_output_filter.py b/python/subunit/tests/test_output_filter.py index 9d530c5..ef6dc9a 100644 --- a/python/subunit/tests/test_output_filter.py +++ b/python/subunit/tests/test_output_filter.py @@ -216,12 +216,12 @@ class FileChunkingTests(TestCase): self.assertThat( result._events, MatchesListwise([ - MatchesCall(call='status', file_bytes='H', eof=False), - MatchesCall(call='status', file_bytes='e', eof=False), - MatchesCall(call='status', file_bytes='l', eof=False), - MatchesCall(call='status', file_bytes='l', eof=False), - MatchesCall(call='status', file_bytes='o', eof=False), - MatchesCall(call='status', file_bytes='', eof=True), + MatchesCall(call='status', file_bytes='H', mime_type=None, eof=False), + MatchesCall(call='status', file_bytes='e', mime_type=None, eof=False), + MatchesCall(call='status', file_bytes='l', mime_type=None, eof=False), + MatchesCall(call='status', file_bytes='l', mime_type=None, eof=False), + MatchesCall(call='status', file_bytes='o', mime_type=None, eof=False), + MatchesCall(call='status', file_bytes='', mime_type=None, eof=True), ]) ) -- 2.34.1