From 803fc25848b9218c0b84d91cc6d9fd1404cb5e8f Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Wed, 21 Jun 2023 10:47:53 -0700 Subject: [PATCH] Add a test for another edge case (#712). --- tests/integration/commands/test_arguments.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/tests/integration/commands/test_arguments.py b/tests/integration/commands/test_arguments.py index ea5891d..47ec72f 100644 --- a/tests/integration/commands/test_arguments.py +++ b/tests/integration/commands/test_arguments.py @@ -561,7 +561,7 @@ def test_parse_arguments_config_with_help_shows_config_help(capsys): assert 'config sub-actions:' in captured.out -def test_parse_arguments_config_with_subaction_but_missing_flags_errors(capsys): +def test_parse_arguments_config_with_subaction_but_missing_flags_errors(): flexmock(module.collect).should_receive('get_default_config_paths').and_return(['default']) with pytest.raises(SystemExit) as exit: @@ -581,19 +581,27 @@ def test_parse_arguments_config_with_subaction_and_help_shows_subaction_help(cap assert 'config bootstrap arguments:' in captured.out -def test_parse_arguments_config_with_subaction_and_required_flags_does_not_raise(capsys): +def test_parse_arguments_config_with_subaction_and_required_flags_does_not_raise(): flexmock(module.collect).should_receive('get_default_config_paths').and_return(['default']) module.parse_arguments('config', 'bootstrap', '--repository', 'repo.borg') -def test_parse_arguments_config_with_subaction_and_global_flags_at_start_does_not_raise(capsys): +def test_parse_arguments_config_with_subaction_and_global_flags_at_start_does_not_raise(): flexmock(module.collect).should_receive('get_default_config_paths').and_return(['default']) module.parse_arguments('--verbosity', '1', 'config', 'bootstrap', '--repository', 'repo.borg') -def test_parse_arguments_config_with_subaction_and_global_flags_at_end_does_not_raise(capsys): +def test_parse_arguments_config_with_subaction_and_global_flags_at_end_does_not_raise(): flexmock(module.collect).should_receive('get_default_config_paths').and_return(['default']) module.parse_arguments('config', 'bootstrap', '--repository', 'repo.borg', '--verbosity', '1') + + +def test_parse_arguments_config_with_subaction_and_explicit_config_file_does_not_raise(): + flexmock(module.collect).should_receive('get_default_config_paths').and_return(['default']) + + module.parse_arguments( + 'config', 'bootstrap', '--repository', 'repo.borg', '--config', 'test.yaml' + )