From 0fbc8c5a63a565799dc0de9a1ffeaed326c8c9cf Mon Sep 17 00:00:00 2001 From: Robert Collins Date: Mon, 13 May 2013 10:46:55 +1200 Subject: BUG FIXES ~~~~~~~~~ * Subunit v2 packets with both file content and route code were not being parsed correctly - they would incorrectly emit a parser error, due to trying to parse the route code length from the first byes of the file content. (Robert Collins, 1172815) --- python/subunit/tests/test_test_protocol2.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'python/subunit/tests/test_test_protocol2.py') diff --git a/python/subunit/tests/test_test_protocol2.py b/python/subunit/tests/test_test_protocol2.py index 002efa7..583c550 100644 --- a/python/subunit/tests/test_test_protocol2.py +++ b/python/subunit/tests/test_test_protocol2.py @@ -408,6 +408,14 @@ class TestByteStreamToStreamResult(TestCase): b'packet: claimed 63 bytes, 10 available'), ]) + def test_route_code_and_file_content(self): + content = BytesIO() + subunit.StreamResultToBytes(content).status( + route_code='0', mime_type='text/plain', file_name='bar', + file_bytes=b'foo') + self.check_event(content.getvalue(), test_id=None, file_name='bar', + route_code='0', mime_type='text/plain', file_bytes=b'foo') + def test_suite(): loader = subunit.tests.TestUtil.TestLoader() -- cgit v1.2.1