diff options
| author | Robert Collins <robertc@robertcollins.net> | 2008-12-08 12:59:41 +1100 |
|---|---|---|
| committer | Robert Collins <robertc@robertcollins.net> | 2008-12-08 12:59:41 +1100 |
| commit | 2c1f561d6466270f2d0f5d9064c3f3a16ea3110c (patch) | |
| tree | 6cf2e470b682226ce0f822a8018f1aec2a06309b /python | |
| parent | 18c5bd4f9736990c5e4c7173a1c39a49faa3f99d (diff) | |
| download | subunit-git-2c1f561d6466270f2d0f5d9064c3f3a16ea3110c.tar.gz | |
Swallow time: commands when seen.
Diffstat (limited to 'python')
| -rw-r--r-- | python/subunit/__init__.py | 5 | ||||
| -rw-r--r-- | python/subunit/tests/test_test_protocol.py | 15 |
2 files changed, 19 insertions, 1 deletions
diff --git a/python/subunit/__init__.py b/python/subunit/__init__.py index b207176..84d9428 100644 --- a/python/subunit/__init__.py +++ b/python/subunit/__init__.py @@ -213,8 +213,11 @@ class TestProtocolServer(object): self._addSkip(offset, line) elif cmd in ('success', 'successful'): self._addSuccess(offset, line) - elif cmd in ('tags'): + elif cmd in ('tags',): self._handleTags(offset, line) + elif cmd in ('time',): + # Accept it, but do not do anything with it yet. + pass elif cmd == 'xfail': self._addExpectedFail(offset, line) else: diff --git a/python/subunit/tests/test_test_protocol.py b/python/subunit/tests/test_test_protocol.py index 9088819..a041aa0 100644 --- a/python/subunit/tests/test_test_protocol.py +++ b/python/subunit/tests/test_test_protocol.py @@ -22,6 +22,7 @@ from StringIO import StringIO import os import subunit import sys +import time try: class MockTestProtocolServerClient(object): @@ -747,6 +748,20 @@ class TestTestProtocolServerStreamTags(unittest.TestCase): self.assertEqual(set(["foo", "bar"]), self.protocol.tags) +class TestTestProtocolServerStreamTime(unittest.TestCase): + """Test managing time information at the protocol level.""" + + def setUp(self): + self.client = MockTestProtocolServerClient() + self.stream = StringIO() + self.protocol = subunit.TestProtocolServer(self.client, + stream=self.stream) + + def test_time_accepted(self): + self.protocol.lineReceived("time: 2001-12-12 12:59:59Z\n") + self.assertEqual("", self.stream.getvalue()) + + class TestRemotedTestCase(unittest.TestCase): def test_simple(self): |
