|
@@ -699,18 +699,23 @@ def test_create_archive_with_one_file_system_calls_borg_with_one_file_system_par
|
|
|
)
|
|
|
|
|
|
|
|
|
-def test_create_archive_with_numeric_owner_calls_borg_with_numeric_owner_parameter():
|
|
|
+@pytest.mark.parametrize(
|
|
|
+ 'feature_available,option_flag', ((True, '--numeric-ids'), (False, '--numeric-owner'),),
|
|
|
+)
|
|
|
+def test_create_archive_with_numeric_owner_calls_borg_with_numeric_ids_parameter(
|
|
|
+ feature_available, option_flag
|
|
|
+):
|
|
|
flexmock(module).should_receive('borgmatic_source_directories').and_return([])
|
|
|
flexmock(module).should_receive('deduplicate_directories').and_return(('foo', 'bar'))
|
|
|
flexmock(module).should_receive('map_directories_to_devices').and_return({})
|
|
|
flexmock(module).should_receive('_expand_directories').and_return(())
|
|
|
flexmock(module).should_receive('_expand_home_directories').and_return(())
|
|
|
flexmock(module).should_receive('_write_pattern_file').and_return(None)
|
|
|
- flexmock(module.feature).should_receive('available').and_return(True)
|
|
|
+ flexmock(module.feature).should_receive('available').and_return(feature_available)
|
|
|
flexmock(module).should_receive('_make_pattern_flags').and_return(())
|
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
|
- ('borg', 'create', '--numeric-owner') + ARCHIVE_WITH_PATHS,
|
|
|
+ ('borg', 'create') + ((option_flag,) if option_flag else ()) + ARCHIVE_WITH_PATHS,
|
|
|
output_log_level=logging.INFO,
|
|
|
output_file=None,
|
|
|
borg_local_path='borg',
|
|
@@ -817,12 +822,7 @@ def test_create_archive_with_atime_option_calls_borg_with_corresponding_paramete
|
|
|
flexmock(module).should_receive('_expand_directories').and_return(())
|
|
|
flexmock(module).should_receive('_expand_home_directories').and_return(())
|
|
|
flexmock(module).should_receive('_write_pattern_file').and_return(None)
|
|
|
- flexmock(module.feature).should_receive('available').with_args(
|
|
|
- module.feature.Feature.ATIME, '1.2.3'
|
|
|
- ).and_return(feature_available)
|
|
|
- flexmock(module.feature).should_receive('available').with_args(
|
|
|
- module.feature.Feature.NOFLAGS, '1.2.3'
|
|
|
- ).and_return(True)
|
|
|
+ flexmock(module.feature).should_receive('available').and_return(feature_available)
|
|
|
flexmock(module).should_receive('_make_pattern_flags').and_return(())
|
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
@@ -864,12 +864,7 @@ def test_create_archive_with_bsd_flags_option_calls_borg_with_corresponding_para
|
|
|
flexmock(module).should_receive('_expand_directories').and_return(())
|
|
|
flexmock(module).should_receive('_expand_home_directories').and_return(())
|
|
|
flexmock(module).should_receive('_write_pattern_file').and_return(None)
|
|
|
- flexmock(module.feature).should_receive('available').with_args(
|
|
|
- module.feature.Feature.ATIME, '1.2.3'
|
|
|
- ).and_return(True)
|
|
|
- flexmock(module.feature).should_receive('available').with_args(
|
|
|
- module.feature.Feature.NOFLAGS, '1.2.3'
|
|
|
- ).and_return(feature_available)
|
|
|
+ flexmock(module.feature).should_receive('available').and_return(feature_available)
|
|
|
flexmock(module).should_receive('_make_pattern_flags').and_return(())
|
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|