summaryrefslogtreecommitdiff
path: root/testrepository/tests/test_testcommand.py
diff options
context:
space:
mode:
authorRobert Collins <robertc@robertcollins.net>2010-12-06 19:22:46 +1300
committerRobert Collins <robertc@robertcollins.net>2010-12-06 19:22:46 +1300
commit4045f2c89535934178df895e8b369cd63f82da03 (patch)
tree3f8f85de6fb27d3176133eb2442a5da9b5657dfd /testrepository/tests/test_testcommand.py
parent5369521457f1de8307fe4c5d3a3897bf768067be (diff)
downloadtestrepository-4045f2c89535934178df895e8b369cd63f82da03.tar.gz
* ``testr list-tests`` is a new command that will list the tests for a project
when ``.testr.conf`` has been configured with a ``test_list_option``. (Robert Collins)
Diffstat (limited to 'testrepository/tests/test_testcommand.py')
-rw-r--r--testrepository/tests/test_testcommand.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/testrepository/tests/test_testcommand.py b/testrepository/tests/test_testcommand.py
index a3ad6aa..d275304 100644
--- a/testrepository/tests/test_testcommand.py
+++ b/testrepository/tests/test_testcommand.py
@@ -161,3 +161,21 @@ class TestTestCommand(ResourcedTestCase):
testargs=('bar', 'quux')))
expected_cmd = 'foo bar quux'
self.assertEqual(expected_cmd, fixture.cmd)
+
+ def test_list_tests_cmd(self):
+ ui, command = self.get_test_ui_and_cmd()
+ self.set_config(
+ '[DEFAULT]\ntest_command=foo $LISTOPT $IDLIST\ntest_id_list_default=whoo yea\n'
+ 'test_list_option=--list\n')
+ fixture = self.useFixture(command.get_run_command())
+ expected_cmd = 'foo --list whoo yea'
+ self.assertEqual(expected_cmd, fixture.list_cmd)
+
+ def test_list_tests_parsing(self):
+ ui, command = self.get_test_ui_and_cmd()
+ ui.proc_outputs = ['returned\nids\n']
+ self.set_config(
+ '[DEFAULT]\ntest_command=foo $LISTOPT $IDLIST\ntest_id_list_default=whoo yea\n'
+ 'test_list_option=--list\n')
+ fixture = self.useFixture(command.get_run_command())
+ self.assertEqual(set(['returned', 'ids']), set(fixture.list_tests()))