Disallow the "--dry-run" flag with the "borg" action (#774).
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2023-10-23 17:23:04 -07:00
parent dccaa4014b
commit 257ab77bea
3 changed files with 18 additions and 0 deletions

View File

@@ -622,3 +622,16 @@ def test_parse_arguments_config_with_subaction_and_explicit_config_file_does_not
module.parse_arguments(
'config', 'bootstrap', '--repository', 'repo.borg', '--config', 'test.yaml'
)
def test_parse_arguments_with_borg_action_and_dry_run_raises():
flexmock(module.collect).should_receive('get_default_config_paths').and_return(['default'])
with pytest.raises(ValueError):
module.parse_arguments('--dry-run', 'borg', 'list')
def test_parse_arguments_with_borg_action_and_no_dry_run_does_not_raise():
flexmock(module.collect).should_receive('get_default_config_paths').and_return(['default'])
module.parse_arguments('borg', 'list')