summaryrefslogtreecommitdiff
path: root/python/subunit/tests/test_test_protocol2.py
diff options
context:
space:
mode:
authorRobert Collins <robertc@robertcollins.net>2013-05-13 10:46:55 +1200
committerRobert Collins <robertc@robertcollins.net>2013-05-13 10:46:55 +1200
commit0fbc8c5a63a565799dc0de9a1ffeaed326c8c9cf (patch)
tree4fbaef55840b3fc84c8798e2c60809435fd05890 /python/subunit/tests/test_test_protocol2.py
parent6aaa20b82104f26fd1aa40df09a42dd3bd5110f9 (diff)
downloadsubunit-git-0fbc8c5a63a565799dc0de9a1ffeaed326c8c9cf.tar.gz
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)
Diffstat (limited to 'python/subunit/tests/test_test_protocol2.py')
-rw-r--r--python/subunit/tests/test_test_protocol2.py8
1 files changed, 8 insertions, 0 deletions
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()