|
@@ -222,6 +222,7 @@ def test_create_archive_calls_borg_with_parameters():
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
|
('borg', 'create') + ARCHIVE_WITH_PATHS,
|
|
|
output_log_level=logging.INFO,
|
|
|
+ output_file=None,
|
|
|
error_on_warnings=False,
|
|
|
)
|
|
|
|
|
@@ -250,6 +251,7 @@ def test_create_archive_with_patterns_calls_borg_with_patterns():
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
|
('borg', 'create') + pattern_flags + ARCHIVE_WITH_PATHS,
|
|
|
output_log_level=logging.INFO,
|
|
|
+ output_file=None,
|
|
|
error_on_warnings=False,
|
|
|
)
|
|
|
|
|
@@ -278,6 +280,7 @@ def test_create_archive_with_exclude_patterns_calls_borg_with_excludes():
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
|
('borg', 'create') + exclude_flags + ARCHIVE_WITH_PATHS,
|
|
|
output_log_level=logging.INFO,
|
|
|
+ output_file=None,
|
|
|
error_on_warnings=False,
|
|
|
)
|
|
|
|
|
@@ -304,6 +307,7 @@ def test_create_archive_with_log_info_calls_borg_with_info_parameter():
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
|
('borg', 'create', '--info') + ARCHIVE_WITH_PATHS,
|
|
|
output_log_level=logging.INFO,
|
|
|
+ output_file=None,
|
|
|
error_on_warnings=False,
|
|
|
)
|
|
|
insert_logging_mock(logging.INFO)
|
|
@@ -331,6 +335,7 @@ def test_create_archive_with_log_info_and_json_suppresses_most_borg_output():
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
|
('borg', 'create', '--json') + ARCHIVE_WITH_PATHS,
|
|
|
output_log_level=None,
|
|
|
+ output_file=None,
|
|
|
error_on_warnings=False,
|
|
|
)
|
|
|
insert_logging_mock(logging.INFO)
|
|
@@ -358,6 +363,7 @@ def test_create_archive_with_log_debug_calls_borg_with_debug_parameter():
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
|
('borg', 'create', '--debug', '--show-rc') + ARCHIVE_WITH_PATHS,
|
|
|
output_log_level=logging.INFO,
|
|
|
+ output_file=None,
|
|
|
error_on_warnings=False,
|
|
|
)
|
|
|
insert_logging_mock(logging.DEBUG)
|
|
@@ -384,6 +390,7 @@ def test_create_archive_with_log_debug_and_json_suppresses_most_borg_output():
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
|
('borg', 'create', '--json') + ARCHIVE_WITH_PATHS,
|
|
|
output_log_level=None,
|
|
|
+ output_file=None,
|
|
|
error_on_warnings=False,
|
|
|
)
|
|
|
insert_logging_mock(logging.DEBUG)
|
|
@@ -412,6 +419,7 @@ def test_create_archive_with_dry_run_calls_borg_with_dry_run_parameter():
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
|
('borg', 'create', '--dry-run') + ARCHIVE_WITH_PATHS,
|
|
|
output_log_level=logging.INFO,
|
|
|
+ output_file=None,
|
|
|
error_on_warnings=False,
|
|
|
)
|
|
|
|
|
@@ -440,6 +448,7 @@ def test_create_archive_with_stats_and_dry_run_calls_borg_without_stats_paramete
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
|
('borg', 'create', '--info', '--dry-run') + ARCHIVE_WITH_PATHS,
|
|
|
output_log_level=logging.INFO,
|
|
|
+ output_file=None,
|
|
|
error_on_warnings=False,
|
|
|
)
|
|
|
insert_logging_mock(logging.INFO)
|
|
@@ -467,6 +476,7 @@ def test_create_archive_with_checkpoint_interval_calls_borg_with_checkpoint_inte
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
|
('borg', 'create', '--checkpoint-interval', '600') + ARCHIVE_WITH_PATHS,
|
|
|
output_log_level=logging.INFO,
|
|
|
+ output_file=None,
|
|
|
error_on_warnings=False,
|
|
|
)
|
|
|
|
|
@@ -492,6 +502,7 @@ def test_create_archive_with_chunker_params_calls_borg_with_chunker_params_param
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
|
('borg', 'create', '--chunker-params', '1,2,3,4') + ARCHIVE_WITH_PATHS,
|
|
|
output_log_level=logging.INFO,
|
|
|
+ output_file=None,
|
|
|
error_on_warnings=False,
|
|
|
)
|
|
|
|
|
@@ -517,6 +528,7 @@ def test_create_archive_with_compression_calls_borg_with_compression_parameters(
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
|
('borg', 'create', '--compression', 'rle') + ARCHIVE_WITH_PATHS,
|
|
|
output_log_level=logging.INFO,
|
|
|
+ output_file=None,
|
|
|
error_on_warnings=False,
|
|
|
)
|
|
|
|
|
@@ -542,6 +554,7 @@ def test_create_archive_with_remote_rate_limit_calls_borg_with_remote_ratelimit_
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
|
('borg', 'create', '--remote-ratelimit', '100') + ARCHIVE_WITH_PATHS,
|
|
|
output_log_level=logging.INFO,
|
|
|
+ output_file=None,
|
|
|
error_on_warnings=False,
|
|
|
)
|
|
|
|
|
@@ -567,6 +580,7 @@ def test_create_archive_with_one_file_system_calls_borg_with_one_file_system_par
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
|
('borg', 'create', '--one-file-system') + ARCHIVE_WITH_PATHS,
|
|
|
output_log_level=logging.INFO,
|
|
|
+ output_file=None,
|
|
|
error_on_warnings=False,
|
|
|
)
|
|
|
|
|
@@ -593,6 +607,7 @@ def test_create_archive_with_numeric_owner_calls_borg_with_numeric_owner_paramet
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
|
('borg', 'create', '--numeric-owner') + ARCHIVE_WITH_PATHS,
|
|
|
output_log_level=logging.INFO,
|
|
|
+ output_file=None,
|
|
|
error_on_warnings=False,
|
|
|
)
|
|
|
|
|
@@ -619,6 +634,7 @@ def test_create_archive_with_read_special_calls_borg_with_read_special_parameter
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
|
('borg', 'create', '--read-special') + ARCHIVE_WITH_PATHS,
|
|
|
output_log_level=logging.INFO,
|
|
|
+ output_file=None,
|
|
|
error_on_warnings=False,
|
|
|
)
|
|
|
|
|
@@ -646,6 +662,7 @@ def test_create_archive_with_option_true_calls_borg_without_corresponding_parame
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
|
('borg', 'create') + ARCHIVE_WITH_PATHS,
|
|
|
output_log_level=logging.INFO,
|
|
|
+ output_file=None,
|
|
|
error_on_warnings=False,
|
|
|
)
|
|
|
|
|
@@ -673,6 +690,7 @@ def test_create_archive_with_option_false_calls_borg_with_corresponding_paramete
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
|
('borg', 'create', '--no' + option_name.replace('_', '')) + ARCHIVE_WITH_PATHS,
|
|
|
output_log_level=logging.INFO,
|
|
|
+ output_file=None,
|
|
|
error_on_warnings=False,
|
|
|
)
|
|
|
|
|
@@ -699,6 +717,7 @@ def test_create_archive_with_files_cache_calls_borg_with_files_cache_parameters(
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
|
('borg', 'create', '--files-cache', 'ctime,size') + ARCHIVE_WITH_PATHS,
|
|
|
output_log_level=logging.INFO,
|
|
|
+ output_file=None,
|
|
|
error_on_warnings=False,
|
|
|
)
|
|
|
|
|
@@ -725,6 +744,7 @@ def test_create_archive_with_local_path_calls_borg_via_local_path():
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
|
('borg1', 'create') + ARCHIVE_WITH_PATHS,
|
|
|
output_log_level=logging.INFO,
|
|
|
+ output_file=None,
|
|
|
error_on_warnings=False,
|
|
|
)
|
|
|
|
|
@@ -751,6 +771,7 @@ def test_create_archive_with_remote_path_calls_borg_with_remote_path_parameters(
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
|
('borg', 'create', '--remote-path', 'borg1') + ARCHIVE_WITH_PATHS,
|
|
|
output_log_level=logging.INFO,
|
|
|
+ output_file=None,
|
|
|
error_on_warnings=False,
|
|
|
)
|
|
|
|
|
@@ -777,6 +798,7 @@ def test_create_archive_with_umask_calls_borg_with_umask_parameters():
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
|
('borg', 'create', '--umask', '740') + ARCHIVE_WITH_PATHS,
|
|
|
output_log_level=logging.INFO,
|
|
|
+ output_file=None,
|
|
|
error_on_warnings=False,
|
|
|
)
|
|
|
|
|
@@ -802,6 +824,7 @@ def test_create_archive_with_lock_wait_calls_borg_with_lock_wait_parameters():
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
|
('borg', 'create', '--lock-wait', '5') + ARCHIVE_WITH_PATHS,
|
|
|
output_log_level=logging.INFO,
|
|
|
+ output_file=None,
|
|
|
error_on_warnings=False,
|
|
|
)
|
|
|
|
|
@@ -827,6 +850,7 @@ def test_create_archive_with_stats_calls_borg_with_stats_parameter_and_warning_o
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
|
('borg', 'create', '--stats') + ARCHIVE_WITH_PATHS,
|
|
|
output_log_level=logging.WARNING,
|
|
|
+ output_file=None,
|
|
|
error_on_warnings=False,
|
|
|
)
|
|
|
|
|
@@ -853,6 +877,7 @@ def test_create_archive_with_stats_and_log_info_calls_borg_with_stats_parameter_
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
|
('borg', 'create', '--info', '--stats') + ARCHIVE_WITH_PATHS,
|
|
|
output_log_level=logging.INFO,
|
|
|
+ output_file=None,
|
|
|
error_on_warnings=False,
|
|
|
)
|
|
|
insert_logging_mock(logging.INFO)
|
|
@@ -880,6 +905,7 @@ def test_create_archive_with_files_calls_borg_with_list_parameter_and_warning_ou
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
|
('borg', 'create', '--list', '--filter', 'AME-') + ARCHIVE_WITH_PATHS,
|
|
|
output_log_level=logging.WARNING,
|
|
|
+ output_file=None,
|
|
|
error_on_warnings=False,
|
|
|
)
|
|
|
|
|
@@ -906,6 +932,7 @@ def test_create_archive_with_files_and_log_info_calls_borg_with_list_parameter_a
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
|
('borg', 'create', '--list', '--filter', 'AME-', '--info') + ARCHIVE_WITH_PATHS,
|
|
|
output_log_level=logging.INFO,
|
|
|
+ output_file=None,
|
|
|
error_on_warnings=False,
|
|
|
)
|
|
|
insert_logging_mock(logging.INFO)
|
|
@@ -930,8 +957,11 @@ def test_create_archive_with_progress_and_log_info_calls_borg_with_progress_para
|
|
|
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_without_capture').with_args(
|
|
|
- ('borg', 'create', '--info', '--progress') + ARCHIVE_WITH_PATHS, error_on_warnings=False
|
|
|
+ flexmock(module).should_receive('execute_command').with_args(
|
|
|
+ ('borg', 'create', '--info', '--progress') + ARCHIVE_WITH_PATHS,
|
|
|
+ output_log_level=logging.INFO,
|
|
|
+ output_file=module.DO_NOT_CAPTURE,
|
|
|
+ error_on_warnings=False,
|
|
|
)
|
|
|
insert_logging_mock(logging.INFO)
|
|
|
|
|
@@ -955,8 +985,11 @@ def test_create_archive_with_progress_calls_borg_with_progress_parameter():
|
|
|
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_without_capture').with_args(
|
|
|
- ('borg', 'create', '--progress') + ARCHIVE_WITH_PATHS, error_on_warnings=False
|
|
|
+ flexmock(module).should_receive('execute_command').with_args(
|
|
|
+ ('borg', 'create', '--progress') + ARCHIVE_WITH_PATHS,
|
|
|
+ output_log_level=logging.INFO,
|
|
|
+ output_file=module.DO_NOT_CAPTURE,
|
|
|
+ error_on_warnings=False,
|
|
|
)
|
|
|
|
|
|
module.create_archive(
|
|
@@ -982,6 +1015,7 @@ def test_create_archive_with_json_calls_borg_with_json_parameter():
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
|
('borg', 'create', '--json') + ARCHIVE_WITH_PATHS,
|
|
|
output_log_level=None,
|
|
|
+ output_file=None,
|
|
|
error_on_warnings=False,
|
|
|
).and_return('[]')
|
|
|
|
|
@@ -1010,6 +1044,7 @@ def test_create_archive_with_stats_and_json_calls_borg_without_stats_parameter()
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
|
('borg', 'create', '--json') + ARCHIVE_WITH_PATHS,
|
|
|
output_log_level=None,
|
|
|
+ output_file=None,
|
|
|
error_on_warnings=False,
|
|
|
).and_return('[]')
|
|
|
|
|
@@ -1039,6 +1074,7 @@ def test_create_archive_with_source_directories_glob_expands():
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
|
('borg', 'create', 'repo::{}'.format(DEFAULT_ARCHIVE_NAME), 'foo', 'food'),
|
|
|
output_log_level=logging.INFO,
|
|
|
+ output_file=None,
|
|
|
error_on_warnings=False,
|
|
|
)
|
|
|
flexmock(module.glob).should_receive('glob').with_args('foo*').and_return(['foo', 'food'])
|
|
@@ -1065,6 +1101,7 @@ def test_create_archive_with_non_matching_source_directories_glob_passes_through
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
|
('borg', 'create', 'repo::{}'.format(DEFAULT_ARCHIVE_NAME), 'foo*'),
|
|
|
output_log_level=logging.INFO,
|
|
|
+ output_file=None,
|
|
|
error_on_warnings=False,
|
|
|
)
|
|
|
flexmock(module.glob).should_receive('glob').with_args('foo*').and_return([])
|
|
@@ -1091,6 +1128,7 @@ def test_create_archive_with_glob_calls_borg_with_expanded_directories():
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
|
('borg', 'create', 'repo::{}'.format(DEFAULT_ARCHIVE_NAME), 'foo', 'food'),
|
|
|
output_log_level=logging.INFO,
|
|
|
+ output_file=None,
|
|
|
error_on_warnings=False,
|
|
|
)
|
|
|
|
|
@@ -1116,6 +1154,7 @@ def test_create_archive_with_archive_name_format_calls_borg_with_archive_name():
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
|
('borg', 'create', 'repo::ARCHIVE_NAME', 'foo', 'bar'),
|
|
|
output_log_level=logging.INFO,
|
|
|
+ output_file=None,
|
|
|
error_on_warnings=False,
|
|
|
)
|
|
|
|
|
@@ -1141,6 +1180,7 @@ def test_create_archive_with_archive_name_format_accepts_borg_placeholders():
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
|
('borg', 'create', 'repo::Documents_{hostname}-{now}', 'foo', 'bar'),
|
|
|
output_log_level=logging.INFO,
|
|
|
+ output_file=None,
|
|
|
error_on_warnings=False,
|
|
|
)
|
|
|
|
|
@@ -1166,6 +1206,7 @@ def test_create_archive_with_extra_borg_options_calls_borg_with_extra_options():
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
|
('borg', 'create', '--extra', '--options') + ARCHIVE_WITH_PATHS,
|
|
|
output_log_level=logging.INFO,
|
|
|
+ output_file=None,
|
|
|
error_on_warnings=False,
|
|
|
)
|
|
|
|
|
@@ -1193,6 +1234,7 @@ def test_create_archive_with_stream_processes_calls_borg_with_processes():
|
|
|
('borg', 'create', '--read-special') + ARCHIVE_WITH_PATHS,
|
|
|
processes=processes,
|
|
|
output_log_level=logging.INFO,
|
|
|
+ output_file=None,
|
|
|
error_on_warnings=False,
|
|
|
)
|
|
|
|