summaryrefslogtreecommitdiff
path: root/python/subunit/tests/test_test_protocol.py
diff options
context:
space:
mode:
authorRobert Collins <robertc@robertcollins.net>2009-08-08 17:03:38 +1000
committerRobert Collins <robertc@robertcollins.net>2009-08-08 17:03:38 +1000
commit37080a3a8b3b3414e8d6ec1eb68fb6000d926a0a (patch)
tree15d15c7208e43515435d4ed8f6d0a7f4d588b929 /python/subunit/tests/test_test_protocol.py
parentcc4699a328dd76ecaad6a2e94b17845793bdf51d (diff)
downloadsubunit-git-37080a3a8b3b3414e8d6ec1eb68fb6000d926a0a.tar.gz
Extend the progress model to support a push/pop model.
Diffstat (limited to 'python/subunit/tests/test_test_protocol.py')
-rw-r--r--python/subunit/tests/test_test_protocol.py25
1 files changed, 18 insertions, 7 deletions
diff --git a/python/subunit/tests/test_test_protocol.py b/python/subunit/tests/test_test_protocol.py
index a036192..2b90b9e 100644
--- a/python/subunit/tests/test_test_protocol.py
+++ b/python/subunit/tests/test_test_protocol.py
@@ -129,8 +129,8 @@ class TestMockTestProtocolServer(unittest.TestCase):
def test_progress(self):
protocol = MockTestProtocolServerClient()
- protocol.progress(-1, subunit.SEEK_CUR)
- self.assertEqual(protocol.progress_calls, [(-1, subunit.SEEK_CUR)])
+ protocol.progress(-1, subunit.PROGRESS_CUR)
+ self.assertEqual(protocol.progress_calls, [(-1, subunit.PROGRESS_CUR)])
class TestTestImports(unittest.TestCase):
@@ -790,12 +790,15 @@ class TestTestProtocolServerProgress(unittest.TestCase):
self.protocol = subunit.TestProtocolServer(self.result,
stream=self.stream)
self.protocol.lineReceived("progress: 23")
+ self.protocol.lineReceived("progress: push")
self.protocol.lineReceived("progress: -2")
+ self.protocol.lineReceived("progress: pop")
self.protocol.lineReceived("progress: +4")
self.assertEqual("", self.stream.getvalue())
self.assertEqual(
- [(23, subunit.SEEK_SET), (-2, subunit.SEEK_CUR),
- (4, subunit.SEEK_CUR)],
+ [(23, subunit.PROGRESS_SET), (None, subunit.PROGRESS_PUSH),
+ (-2, subunit.PROGRESS_CUR), (None, subunit.PROGRESS_POP),
+ (4, subunit.PROGRESS_CUR)],
self.result.progress_calls)
@@ -1095,17 +1098,25 @@ class TestTestProtocolClient(unittest.TestCase):
'skip: %s [\nHas it really?\n]\n' % self.test.id())
def test_progress_set(self):
- self.protocol.progress(23, subunit.SEEK_SET)
+ self.protocol.progress(23, subunit.PROGRESS_SET)
self.assertEqual(self.io.getvalue(), 'progress: 23\n')
def test_progress_neg_cur(self):
- self.protocol.progress(-23, subunit.SEEK_CUR)
+ self.protocol.progress(-23, subunit.PROGRESS_CUR)
self.assertEqual(self.io.getvalue(), 'progress: -23\n')
def test_progress_pos_cur(self):
- self.protocol.progress(23, subunit.SEEK_CUR)
+ self.protocol.progress(23, subunit.PROGRESS_CUR)
self.assertEqual(self.io.getvalue(), 'progress: +23\n')
+ def test_progress_pop(self):
+ self.protocol.progress(1234, subunit.PROGRESS_POP)
+ self.assertEqual(self.io.getvalue(), 'progress: pop\n')
+
+ def test_progress_push(self):
+ self.protocol.progress(1234, subunit.PROGRESS_PUSH)
+ self.assertEqual(self.io.getvalue(), 'progress: push\n')
+
def test_time(self):
# Calling time() outputs a time signal immediately.
self.protocol.time(