summaryrefslogtreecommitdiff
path: root/python/subunit/tests
diff options
context:
space:
mode:
authorRobert Collins <robertc@robertcollins.net>2009-07-18 13:43:05 +1000
committerRobert Collins <robertc@robertcollins.net>2009-07-18 13:43:05 +1000
commit32c509a08cf007134fa154649c05d6fb0761ab55 (patch)
tree6f362c5d1399d997a68cf6a0a420e72d4c5a42a2 /python/subunit/tests
parentef8d30bd77ac8fd37ee1a440536dc969c11ff867 (diff)
downloadsubunit-git-32c509a08cf007134fa154649c05d6fb0761ab55.tar.gz
Support arguments in ExecTestCase.
Diffstat (limited to 'python/subunit/tests')
-rwxr-xr-xpython/subunit/tests/sample-script.py4
-rw-r--r--python/subunit/tests/test_test_protocol.py9
2 files changed, 13 insertions, 0 deletions
diff --git a/python/subunit/tests/sample-script.py b/python/subunit/tests/sample-script.py
index 223d2f5..33e5cb2 100755
--- a/python/subunit/tests/sample-script.py
+++ b/python/subunit/tests/sample-script.py
@@ -1,5 +1,9 @@
#!/usr/bin/env python
import sys
+if len(sys.argv) == 2:
+ print "test fail"
+ print "error fail"
+ sys.exit(0)
print "test old mcdonald"
print "success old mcdonald"
print "test bing crosby"
diff --git a/python/subunit/tests/test_test_protocol.py b/python/subunit/tests/test_test_protocol.py
index 80f91e1..ead0ac6 100644
--- a/python/subunit/tests/test_test_protocol.py
+++ b/python/subunit/tests/test_test_protocol.py
@@ -823,12 +823,21 @@ class TestExecTestCase(unittest.TestCase):
# the sample script runs three tests, one each
# that fails, errors and succeeds
+ def test_sample_method_args(self):
+ """sample-script.py foo"""
+ # sample that will run just one test.
def test_construct(self):
test = self.SampleExecTestCase("test_sample_method")
self.assertEqual(test.script,
subunit.join_dir(__file__, 'sample-script.py'))
+ def test_args(self):
+ result = unittest.TestResult()
+ test = self.SampleExecTestCase("test_sample_method_args")
+ test.run(result)
+ self.assertEqual(1, result.testsRun)
+
def test_run(self):
runner = MockTestProtocolServerClient()
test = self.SampleExecTestCase("test_sample_method")