diff options
Diffstat (limited to 'lava_tool/tests/test_commands.py')
-rw-r--r-- | lava_tool/tests/test_commands.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/lava_tool/tests/test_commands.py b/lava_tool/tests/test_commands.py index 0961b6a..b961f7b 100644 --- a/lava_tool/tests/test_commands.py +++ b/lava_tool/tests/test_commands.py @@ -20,16 +20,16 @@ Unit tests for the launch_control.commands package """ -from mocker import MockerTestCase +from mocker import MockerTestCase, ARGS from lava_tool.interface import ( Command, LavaCommandError, - ) +) from lava_tool.dispatcher import ( LavaDispatcher, main, - ) +) class CommandTestCase(MockerTestCase): @@ -59,6 +59,7 @@ class CommandTestCase(MockerTestCase): def test_get_help_uses_docstring(self): class ASDF(Command): + """ This command was named after the lisp package management system """ @@ -80,6 +81,7 @@ class CommandTestCase(MockerTestCase): def test_get_epilog_returns_data_after_carriage_L(self): # The dot after 'before' is to make pep8 happy class help_with_epilog(Command): + """ before . @@ -90,6 +92,7 @@ class CommandTestCase(MockerTestCase): def test_get_help_returns_data_before_carriage_L(self): # The dot after 'before' is to make pep8 happy class help_with_epilog(Command): + """ before . @@ -101,10 +104,10 @@ class CommandTestCase(MockerTestCase): class DispatcherTestCase(MockerTestCase): def test_main(self): - mock_LavaDispatcher = self.mocker.replace( - 'lava_tool.dispatcher.LavaDispatcher') - mock_LavaDispatcher().dispatch() + dispatcher = self.mocker.patch(LavaDispatcher) + dispatcher.dispatch(ARGS) self.mocker.replay() + self.assertRaises(SystemExit, main) def test_add_command_cls(self): |