From 4045f2c89535934178df895e8b369cd63f82da03 Mon Sep 17 00:00:00 2001 From: Robert Collins Date: Mon, 6 Dec 2010 19:22:46 +1300 Subject: * ``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) --- testrepository/tests/test_testcommand.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'testrepository/tests/test_testcommand.py') 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())) -- cgit v1.2.1