summaryrefslogtreecommitdiff
path: root/python/subunit/tests
diff options
context:
space:
mode:
authorMartin Pool <mbp@canonical.com>2011-01-10 17:15:55 -0600
committerMartin Pool <mbp@canonical.com>2011-01-10 17:15:55 -0600
commit729967637c1ead8042bca8e1ece3906f6f6ed6e7 (patch)
tree7b5dee431589efc4ad426537e85830cc39b5b282 /python/subunit/tests
parentd7ae295931962ad4150aeef4d55b5bffebdca87c (diff)
downloadsubunit-git-729967637c1ead8042bca8e1ece3906f6f6ed6e7.tar.gz
Tolerate streams with the \r missing from the chunk length.
Diffstat (limited to 'python/subunit/tests')
-rw-r--r--python/subunit/tests/test_chunked.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/python/subunit/tests/test_chunked.py b/python/subunit/tests/test_chunked.py
index a24e31e..681af6b 100644
--- a/python/subunit/tests/test_chunked.py
+++ b/python/subunit/tests/test_chunked.py
@@ -1,6 +1,7 @@
#
# subunit: extensions to python unittest to get test results from subprocesses.
# Copyright (C) 2005 Robert Collins <robertc@robertcollins.net>
+# Copyright (C) 2011 Martin Pool <mbp@sourcefrog.net>
#
# Licensed under either the Apache License, Version 2.0 or the BSD 3-clause
# license at the users choice. A copy of both licenses are available in the
@@ -86,6 +87,13 @@ class TestDecode(unittest.TestCase):
self.assertEqual('', self.decoder.write('0\r\n'))
self.assertEqual('1' * 65536 + '2' * 65536, self.output.getvalue())
+ def test_decode_newline(self):
+ """Tolerate chunk markers with no cr character."""
+ self.assertEqual(None, self.decoder.write('a\n'))
+ self.assertEqual(None, self.decoder.write('abcdeabcde'))
+ self.assertEqual(None, self.decoder.write('0\n'))
+ self.assertEqual('abcdeabcde', self.output.getvalue())
+
class TestEncode(unittest.TestCase):