summaryrefslogtreecommitdiff
path: root/python/subunit/tests/test_test_protocol.py
diff options
context:
space:
mode:
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."""