diff options
| author | Robert Collins <robertc@robertcollins.net> | 2013-08-25 11:53:12 +1200 |
|---|---|---|
| committer | Robert Collins <robertc@robertcollins.net> | 2013-08-25 11:53:12 +1200 |
| commit | f407275f50750b08d38b681b3889d96720ba4f78 (patch) | |
| tree | a5a1d64cc1492a1c67b783aaa9d094695b48d1db /python/subunit/v2.py | |
| parent | 74f1d79b5b8d7bfd150fd2178ca7931887ffdb54 (diff) | |
| download | subunit-git-f407275f50750b08d38b681b3889d96720ba4f78.tar.gz | |
* V2 parser errors now set appropriate mime types for the encapsulated packet
data and the error message. (Robert Collins)
Diffstat (limited to 'python/subunit/v2.py')
| -rw-r--r-- | python/subunit/v2.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/python/subunit/v2.py b/python/subunit/v2.py index e710346..b4e1e38 100644 --- a/python/subunit/v2.py +++ b/python/subunit/v2.py @@ -326,10 +326,12 @@ class ByteStreamToStreamResult(object): self._parse(packet, result) except ParseError as error: result.status(test_id="subunit.parser", eof=True, - file_name="Packet data", file_bytes=b''.join(packet)) + file_name="Packet data", file_bytes=b''.join(packet), + mime_type="application/octet-stream") result.status(test_id="subunit.parser", test_status='fail', eof=True, file_name="Parser Error", - file_bytes=(error.args[0]).encode('utf8')) + file_bytes=(error.args[0]).encode('utf8'), + mime_type="text/plain;charset=utf8") def _to_bytes(self, data, pos, length): """Return a slice of data from pos for length as bytes.""" |
