Changeset - b639ce7e4309
[Not reviewed]
0 1 0
Lance Edgar (lance) - 3 years ago 2021-12-06 21:15:45
lance@edbob.org
Fix some tests
1 file changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
rattail/tests/commands/test_core.py
Show inline comments
 
@@ -75,13 +75,13 @@ class TestCommand(TestCase):
 
        self.assertTrue('Usage:' in output)
 
        self.assertTrue('Options:' in output)
 

	
 
    def test_run_with_no_args_prints_help(self):
 
        command = core.Command()
 
        with patch.object(command, 'print_help') as print_help:
 
            command.run()
 
            self.assertRaises(SystemExit, command.run)
 
            print_help.assert_called_once_with()
 

	
 
    def test_run_with_single_help_arg_prints_help(self):
 
        command = core.Command()
 
        with patch.object(command, 'print_help') as print_help:
 
            command.run('help')
 
@@ -99,13 +99,13 @@ class TestCommand(TestCase):
 
        command.run('help', 'fake')
 
        fake.return_value.parser.print_help.assert_called_once_with()
 

	
 
    def test_run_with_unknown_subcommand_arg_prints_help(self):
 
        command = core.Command()
 
        with patch.object(command, 'print_help') as print_help:
 
            command.run('invalid-command-name')
 
            self.assertRaises(SystemExit, command.run, 'invalid-command-name')
 
            print_help.assert_called_once_with()
 

	
 
    def test_stdout_may_be_redirected(self):
 
        class Fake(core.Subcommand):
 
            def run(self, args):
 
                self.stdout.write("standard output stuff")
0 comments (0 inline, 0 general)