From ec629cf047c0f4e1d2d51d30a3d72e5437017936 Mon Sep 17 00:00:00 2001 From: Robert Collins Date: Wed, 11 Jan 2012 18:32:22 +1300 Subject: Handle latest testtools changes. --- python/subunit/tests/test_test_protocol.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'python/subunit/tests') diff --git a/python/subunit/tests/test_test_protocol.py b/python/subunit/tests/test_test_protocol.py index c93aabd..019c080 100644 --- a/python/subunit/tests/test_test_protocol.py +++ b/python/subunit/tests/test_test_protocol.py @@ -102,9 +102,9 @@ class TestTestProtocolServerPipe(unittest.TestCase): [(an_error, _remote_exception_str + '\n')]) self.assertEqual( client.failures, - [(bing, _remote_exception_str + ": Text attachment: traceback\n" - "------------\nfoo.c:53:ERROR invalid state\n" - "------------\n\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): @@ -559,9 +559,9 @@ class TestTestProtocolServerAddxFail(unittest.TestCase): value = details else: if error_message is not None: - value = subunit.RemoteError(_u("Text attachment: traceback\n" - "------------\n") + _u(error_message) + - _u("------------\n")) + 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([ -- cgit v1.2.1 From 25581a35bb8b7468dd0e3ada1f5b20555e8eab30 Mon Sep 17 00:00:00 2001 From: Robert Collins Date: Wed, 11 Jan 2012 18:42:53 +1300 Subject: Tag support has been implemented for TestProtocolClient. (Robert Collins, #518016) --- python/subunit/tests/test_test_protocol.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'python/subunit/tests') diff --git a/python/subunit/tests/test_test_protocol.py b/python/subunit/tests/test_test_protocol.py index 019c080..091b370 100644 --- a/python/subunit/tests/test_test_protocol.py +++ b/python/subunit/tests/test_test_protocol.py @@ -1299,6 +1299,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() -- cgit v1.2.1