|
@@ -1179,3 +1179,31 @@ def test_create_archive_with_extra_borg_options_calls_borg_with_extra_options():
|
|
|
},
|
|
|
storage_config={'extra_borg_options': {'create': '--extra --options'}},
|
|
|
)
|
|
|
+
|
|
|
+
|
|
|
+def test_create_archive_with_stream_processes_calls_borg_with_processes():
|
|
|
+ processes = flexmock()
|
|
|
+ flexmock(module).should_receive('borgmatic_source_directories').and_return([])
|
|
|
+ flexmock(module).should_receive('_expand_directories').and_return(('foo', 'bar'))
|
|
|
+ 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_processes').with_args(
|
|
|
+ ('borg', 'create', '--read-special') + ARCHIVE_WITH_PATHS,
|
|
|
+ processes=processes,
|
|
|
+ output_log_level=logging.INFO,
|
|
|
+ error_on_warnings=False,
|
|
|
+ )
|
|
|
+
|
|
|
+ module.create_archive(
|
|
|
+ dry_run=False,
|
|
|
+ repository='repo',
|
|
|
+ location_config={
|
|
|
+ 'source_directories': ['foo', 'bar'],
|
|
|
+ 'repositories': ['repo'],
|
|
|
+ 'exclude_patterns': None,
|
|
|
+ },
|
|
|
+ storage_config={},
|
|
|
+ stream_processes=processes,
|
|
|
+ )
|