瀏覽代碼

Add a test for another edge case (#712).

Dan Helfman 2 年之前
父節點
當前提交
803fc25848
共有 1 個文件被更改,包括 12 次插入4 次删除
  1. 12 4
      tests/integration/commands/test_arguments.py

+ 12 - 4
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'
+    )