diff options
| author | Jonathan Lange <jml@canonical.com> | 2012-02-16 09:35:51 +0000 |
|---|---|---|
| committer | Jonathan Lange <jml@canonical.com> | 2012-02-16 09:35:51 +0000 |
| commit | 0882a75f5e3e9adacfece2345afac8570eb7ebd9 (patch) | |
| tree | d37a741d403619fe86e58b420abde0793bb6de18 /python/subunit/tests | |
| parent | f1f773607b070d0b91946ff638931ca8c8bd682d (diff) | |
| parent | 7e1253a627b0d89825d11ac2fa9bdb48e5570a69 (diff) | |
| download | subunit-git-0882a75f5e3e9adacfece2345afac8570eb7ebd9.tar.gz | |
Merge trunk
Diffstat (limited to 'python/subunit/tests')
| -rw-r--r-- | python/subunit/tests/test_test_protocol.py | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/python/subunit/tests/test_test_protocol.py b/python/subunit/tests/test_test_protocol.py index e0710f4..60f05b3 100644 --- a/python/subunit/tests/test_test_protocol.py +++ b/python/subunit/tests/test_test_protocol.py @@ -107,8 +107,9 @@ class TestTestProtocolServerPipe(unittest.TestCase): [(an_error, _remote_exception_str + '\n')]) self.assertEqual( client.failures, - [(bing, _remote_exception_str + ": " - + details_to_str({'traceback': text_content(traceback)}) + "\n")]) + [(bing, _remote_exception_str + + ": foo.c:53:ERROR invalid state\n" + "\n")]) self.assertEqual(client.testsRun, 3) def test_non_test_characters_forwarded_immediately(self): @@ -563,7 +564,9 @@ class TestTestProtocolServerAddxFail(unittest.TestCase): value = details else: if error_message is not None: - value = subunit.RemoteError(details_to_str(details)) + if not len(error_message.strip()): + error_message = _u("Empty attachments:\n traceback\n") + value = subunit.RemoteError(_u(error_message)) else: value = subunit.RemoteError() self.assertEqual([ @@ -1301,6 +1304,22 @@ class TestTestProtocolClient(unittest.TestCase): "something\n" "F\r\nserialised\nform0\r\n]\n" % self.test.id())) + def test_tags_empty(self): + self.protocol.tags(set(), set()) + self.assertEqual(_b(""), self.io.getvalue()) + + def test_tags_add(self): + self.protocol.tags(set(['foo']), set()) + self.assertEqual(_b("tags: foo\n"), self.io.getvalue()) + + def test_tags_both(self): + self.protocol.tags(set(['quux']), set(['bar'])) + self.assertEqual(_b("tags: quux -bar\n"), self.io.getvalue()) + + def test_tags_gone(self): + self.protocol.tags(set(), set(['bar'])) + self.assertEqual(_b("tags: -bar\n"), self.io.getvalue()) + def test_suite(): loader = subunit.tests.TestUtil.TestLoader() |
