|
@@ -1326,6 +1326,34 @@ def test_create_archive_with_archive_name_format_accepts_borg_placeholders():
|
|
)
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
+def test_create_archive_with_repository_accepts_borg_placeholders():
|
|
|
|
+ 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).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', '{fqdn}::Documents_{hostname}-{now}', 'foo', 'bar'),
|
|
|
|
+ output_log_level=logging.INFO,
|
|
|
|
+ output_file=None,
|
|
|
|
+ borg_local_path='borg',
|
|
|
|
+ )
|
|
|
|
+
|
|
|
|
+ module.create_archive(
|
|
|
|
+ dry_run=False,
|
|
|
|
+ repository='{fqdn}',
|
|
|
|
+ location_config={
|
|
|
|
+ 'source_directories': ['foo', 'bar'],
|
|
|
|
+ 'repositories': ['{fqdn}'],
|
|
|
|
+ 'exclude_patterns': None,
|
|
|
|
+ },
|
|
|
|
+ storage_config={'archive_name_format': 'Documents_{hostname}-{now}'},
|
|
|
|
+ )
|
|
|
|
+
|
|
|
|
+
|
|
def test_create_archive_with_extra_borg_options_calls_borg_with_extra_options():
|
|
def test_create_archive_with_extra_borg_options_calls_borg_with_extra_options():
|
|
flexmock(module).should_receive('borgmatic_source_directories').and_return([])
|
|
flexmock(module).should_receive('borgmatic_source_directories').and_return([])
|
|
flexmock(module).should_receive('deduplicate_directories').and_return(('foo', 'bar'))
|
|
flexmock(module).should_receive('deduplicate_directories').and_return(('foo', 'bar'))
|