diff --git a/tests/test_cli.py b/tests/test_cli.py index 1a905d596a87ad6a42116fae3e423b5b9cf49afa..099a8927365c00ef975d749baf4467dfe59bdd18 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -566,42 +566,42 @@ def test_usage_command_invoked_with_correct_parameters(mock_usage, tmpdir): assert mock_usage.call_count == 1 -@mock.patch('sys.argv', ['gimmecert', 'testcommand']) +@mock.patch('sys.argv', ['gimmecert', 'successcommand']) def test_main_does_not_exit_if_it_calls_function_that_returns_success(tmpdir): # This should ensure we don't accidentally create artifacts # outside of test directory. tmpdir.chdir() @gimmecert.decorators.subcommand_parser - def setup_testcommand_parser(parser, subparsers): - subparser = subparsers.add_parser('testcommand', description='test command') + def setup_successcommand_parser(parser, subparsers): + subparser = subparsers.add_parser('successcommand', description='success command') - def testcommand_wrapper(args): + def successcommand_wrapper(args): return gimmecert.commands.ExitCode.SUCCESS - subparser.set_defaults(func=testcommand_wrapper) + subparser.set_defaults(func=successcommand_wrapper) return subparser gimmecert.cli.main() # Should not raise -@mock.patch('sys.argv', ['gimmecert', 'testcommand']) +@mock.patch('sys.argv', ['gimmecert', 'failurecommand']) def test_main_exits_if_it_calls_function_that_returns_failure(tmpdir): # This should ensure we don't accidentally create artifacts # outside of test directory. tmpdir.chdir() @gimmecert.decorators.subcommand_parser - def setup_testcommand_parser(parser, subparsers): - subparser = subparsers.add_parser('testcommand', description='test command') + def setup_failurecommand_parser(parser, subparsers): + subparser = subparsers.add_parser('failurecommand', description='failure command') - def testcommand_wrapper(args): + def failurecommand_wrapper(args): return gimmecert.commands.ExitCode.ERROR_ALREADY_INITIALISED - subparser.set_defaults(func=testcommand_wrapper) + subparser.set_defaults(func=failurecommand_wrapper) return subparser