summaryrefslogtreecommitdiff
path: root/python/subunit/tests/test_test_protocol.py
diff options
context:
space:
mode:
authorRobert Collins <robertc@robertcollins.net>2013-08-24 09:37:31 +1200
committerRobert Collins <robertc@robertcollins.net>2013-08-24 09:37:31 +1200
commitcd68831166b680d37fb98bfd5dc6fda319ab1bfd (patch)
tree0433191f2183a6b56289282d2d3c8ead3d834169 /python/subunit/tests/test_test_protocol.py
parentecca497abd0b38f531f929bb35aaf02d5185a1d8 (diff)
downloadsubunit-git-cd68831166b680d37fb98bfd5dc6fda319ab1bfd.tar.gz
* TestTestProtocols' test_*_details were dictionary sort order dependent.
(Robert Collins, #1025392) * TestSubUnitTags's test_add_tag was also se sort order dependent. (Robert Collins, #1025392)
Diffstat (limited to 'python/subunit/tests/test_test_protocol.py')
-rw-r--r--python/subunit/tests/test_test_protocol.py43
1 files changed, 33 insertions, 10 deletions
diff --git a/python/subunit/tests/test_test_protocol.py b/python/subunit/tests/test_test_protocol.py
index 9bdf388..4fa66ab 100644
--- a/python/subunit/tests/test_test_protocol.py
+++ b/python/subunit/tests/test_test_protocol.py
@@ -1193,15 +1193,23 @@ class TestTestProtocolClient(TestCase):
"""Test addFailure on a TestProtocolClient with details."""
self.protocol.addFailure(
self.test, details=self.sample_tb_details)
- self.assertEqual(
- self.io.getvalue(),
+ self.assertThat([
_b(("failure: %s [ multipart\n"
"Content-Type: text/plain\n"
"something\n"
"F\r\nserialised\nform0\r\n"
"Content-Type: text/x-traceback;charset=utf8,language=python\n"
"traceback\n" + _remote_exception_str_chunked + ": boo qux\n0\r\n"
- "]\n") % self.test.id()))
+ "]\n") % self.test.id()),
+ _b(("failure: %s [ multipart\n"
+ "Content-Type: text/plain\n"
+ "something\n"
+ "F\r\nserialised\nform0\r\n"
+ "Content-Type: text/x-traceback;language=python,charset=utf8\n"
+ "traceback\n" + _remote_exception_str_chunked + ": boo qux\n0\r\n"
+ "]\n") % self.test.id())
+ ],
+ Contains(self.io.getvalue())),
def test_add_error(self):
"""Test stopTest on a TestProtocolClient."""
@@ -1217,15 +1225,23 @@ class TestTestProtocolClient(TestCase):
"""Test stopTest on a TestProtocolClient with details."""
self.protocol.addError(
self.test, details=self.sample_tb_details)
- self.assertEqual(
- self.io.getvalue(),
+ self.assertThat([
_b(("error: %s [ multipart\n"
"Content-Type: text/plain\n"
"something\n"
"F\r\nserialised\nform0\r\n"
"Content-Type: text/x-traceback;charset=utf8,language=python\n"
"traceback\n" + _remote_exception_str_chunked + ": boo qux\n0\r\n"
- "]\n") % self.test.id()))
+ "]\n") % self.test.id()),
+ _b(("error: %s [ multipart\n"
+ "Content-Type: text/plain\n"
+ "something\n"
+ "F\r\nserialised\nform0\r\n"
+ "Content-Type: text/x-traceback;language=python,charset=utf8\n"
+ "traceback\n" + _remote_exception_str_chunked + ": boo qux\n0\r\n"
+ "]\n") % self.test.id()),
+ ],
+ Contains(self.io.getvalue())),
def test_add_expected_failure(self):
"""Test addExpectedFailure on a TestProtocolClient."""
@@ -1241,16 +1257,23 @@ class TestTestProtocolClient(TestCase):
"""Test addExpectedFailure on a TestProtocolClient with details."""
self.protocol.addExpectedFailure(
self.test, details=self.sample_tb_details)
- self.assertEqual(
- self.io.getvalue(),
+ self.assertThat([
_b(("xfail: %s [ multipart\n"
"Content-Type: text/plain\n"
"something\n"
"F\r\nserialised\nform0\r\n"
"Content-Type: text/x-traceback;charset=utf8,language=python\n"
"traceback\n" + _remote_exception_str_chunked + ": boo qux\n0\r\n"
- "]\n") % self.test.id()))
-
+ "]\n") % self.test.id()),
+ _b(("xfail: %s [ multipart\n"
+ "Content-Type: text/plain\n"
+ "something\n"
+ "F\r\nserialised\nform0\r\n"
+ "Content-Type: text/x-traceback;language=python,charset=utf8\n"
+ "traceback\n" + _remote_exception_str_chunked + ": boo qux\n0\r\n"
+ "]\n") % self.test.id()),
+ ],
+ Contains(self.io.getvalue())),
def test_add_skip(self):
"""Test addSkip on a TestProtocolClient."""