Rename repository actions for compatibility with recent Borg 2 changes (#915).
This commit is contained in:
@@ -7,7 +7,7 @@ import borgmatic.borg.info
|
||||
import borgmatic.borg.list
|
||||
import borgmatic.borg.mount
|
||||
import borgmatic.borg.prune
|
||||
import borgmatic.borg.rlist
|
||||
import borgmatic.borg.repo_list
|
||||
import borgmatic.borg.transfer
|
||||
import borgmatic.commands.arguments
|
||||
|
||||
@@ -133,14 +133,14 @@ def test_make_list_command_does_not_duplicate_flags_or_raise():
|
||||
assert_command_does_not_duplicate_flags(command)
|
||||
|
||||
|
||||
def test_make_rlist_command_does_not_duplicate_flags_or_raise():
|
||||
arguments = borgmatic.commands.arguments.parse_arguments('rlist')['rlist']
|
||||
def test_make_repo_list_command_does_not_duplicate_flags_or_raise():
|
||||
arguments = borgmatic.commands.arguments.parse_arguments('repo-list')['repo-list']
|
||||
|
||||
for argument_name in dir(arguments):
|
||||
if argument_name.startswith('_'):
|
||||
continue
|
||||
|
||||
command = borgmatic.borg.rlist.make_rlist_command(
|
||||
command = borgmatic.borg.repo_list.make_repo_list_command(
|
||||
'repo',
|
||||
{},
|
||||
'2.3.4',
|
||||
|
||||
@@ -49,8 +49,8 @@ def test_parse_arguments_with_action_after_config_path_omits_aliased_action():
|
||||
|
||||
global_arguments = arguments['global']
|
||||
assert global_arguments.config_paths == ['myconfig']
|
||||
assert 'rcreate' in arguments
|
||||
assert arguments['rcreate'].encryption_mode == 'repokey'
|
||||
assert 'repo-create' in arguments
|
||||
assert arguments['repo-create'].encryption_mode == 'repokey'
|
||||
|
||||
|
||||
def test_parse_arguments_with_action_and_positional_arguments_after_config_path_omits_action_and_arguments():
|
||||
@@ -438,7 +438,7 @@ def test_parse_arguments_with_list_flag_but_no_relevant_action_raises_value_erro
|
||||
flexmock(module.collect).should_receive('get_default_config_paths').and_return(['default'])
|
||||
|
||||
with pytest.raises(SystemExit):
|
||||
module.parse_arguments('--list', 'rcreate')
|
||||
module.parse_arguments('--list', 'repo-create')
|
||||
|
||||
|
||||
def test_parse_arguments_disallows_list_with_progress_for_create_action():
|
||||
@@ -469,18 +469,18 @@ def test_parse_arguments_disallows_json_with_both_list_and_info():
|
||||
module.parse_arguments('list', 'info', '--json')
|
||||
|
||||
|
||||
def test_parse_arguments_disallows_json_with_both_list_and_rinfo():
|
||||
def test_parse_arguments_disallows_json_with_both_list_and_repo_info():
|
||||
flexmock(module.collect).should_receive('get_default_config_paths').and_return(['default'])
|
||||
|
||||
with pytest.raises(ValueError):
|
||||
module.parse_arguments('list', 'rinfo', '--json')
|
||||
module.parse_arguments('list', 'repo-info', '--json')
|
||||
|
||||
|
||||
def test_parse_arguments_disallows_json_with_both_rinfo_and_info():
|
||||
def test_parse_arguments_disallows_json_with_both_repo_info_and_info():
|
||||
flexmock(module.collect).should_receive('get_default_config_paths').and_return(['default'])
|
||||
|
||||
with pytest.raises(ValueError):
|
||||
module.parse_arguments('rinfo', 'info', '--json')
|
||||
module.parse_arguments('repo-info', 'info', '--json')
|
||||
|
||||
|
||||
def test_parse_arguments_disallows_transfer_with_both_archive_and_match_archives():
|
||||
@@ -505,11 +505,11 @@ def test_parse_arguments_disallows_list_with_both_prefix_and_match_archives():
|
||||
module.parse_arguments('list', '--prefix', 'foo', '--match-archives', 'sh:*bar')
|
||||
|
||||
|
||||
def test_parse_arguments_disallows_rlist_with_both_prefix_and_match_archives():
|
||||
def test_parse_arguments_disallows_repo_list_with_both_prefix_and_match_archives():
|
||||
flexmock(module.collect).should_receive('get_default_config_paths').and_return(['default'])
|
||||
|
||||
with pytest.raises(ValueError):
|
||||
module.parse_arguments('rlist', '--prefix', 'foo', '--match-archives', 'sh:*bar')
|
||||
module.parse_arguments('repo-list', '--prefix', 'foo', '--match-archives', 'sh:*bar')
|
||||
|
||||
|
||||
def test_parse_arguments_disallows_info_with_both_archive_and_match_archives():
|
||||
|
||||
Reference in New Issue
Block a user