|
@@ -166,7 +166,7 @@ def test_create_archive_calls_borg_with_parameters():
|
|
flexmock(module).should_receive('_make_pattern_flags').and_return(())
|
|
flexmock(module).should_receive('_make_pattern_flags').and_return(())
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
- CREATE_COMMAND, capture_output=False, output_as_warning=False
|
|
|
|
|
|
+ CREATE_COMMAND, output_log_level=logging.INFO
|
|
)
|
|
)
|
|
|
|
|
|
module.create_archive(
|
|
module.create_archive(
|
|
@@ -191,7 +191,7 @@ def test_create_archive_with_patterns_calls_borg_with_patterns():
|
|
flexmock(module).should_receive('_make_pattern_flags').and_return(pattern_flags)
|
|
flexmock(module).should_receive('_make_pattern_flags').and_return(pattern_flags)
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
- CREATE_COMMAND + pattern_flags, capture_output=False, output_as_warning=False
|
|
|
|
|
|
+ CREATE_COMMAND + pattern_flags, output_log_level=logging.INFO
|
|
)
|
|
)
|
|
|
|
|
|
module.create_archive(
|
|
module.create_archive(
|
|
@@ -216,7 +216,7 @@ def test_create_archive_with_exclude_patterns_calls_borg_with_excludes():
|
|
flexmock(module).should_receive('_make_pattern_flags').and_return(())
|
|
flexmock(module).should_receive('_make_pattern_flags').and_return(())
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(exclude_flags)
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(exclude_flags)
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
- CREATE_COMMAND + exclude_flags, capture_output=False, output_as_warning=False
|
|
|
|
|
|
+ CREATE_COMMAND + exclude_flags, output_log_level=logging.INFO
|
|
)
|
|
)
|
|
|
|
|
|
module.create_archive(
|
|
module.create_archive(
|
|
@@ -240,8 +240,7 @@ def test_create_archive_with_log_info_calls_borg_with_info_parameter():
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
CREATE_COMMAND + ('--list', '--filter', 'AME-', '--info', '--stats'),
|
|
CREATE_COMMAND + ('--list', '--filter', 'AME-', '--info', '--stats'),
|
|
- capture_output=False,
|
|
|
|
- output_as_warning=False,
|
|
|
|
|
|
+ output_log_level=logging.INFO,
|
|
)
|
|
)
|
|
insert_logging_mock(logging.INFO)
|
|
insert_logging_mock(logging.INFO)
|
|
|
|
|
|
@@ -265,7 +264,7 @@ def test_create_archive_with_log_info_and_json_suppresses_most_borg_output():
|
|
flexmock(module).should_receive('_make_pattern_flags').and_return(())
|
|
flexmock(module).should_receive('_make_pattern_flags').and_return(())
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
- CREATE_COMMAND + ('--json',), capture_output=True, output_as_warning=False
|
|
|
|
|
|
+ CREATE_COMMAND + ('--json',), output_log_level=None
|
|
)
|
|
)
|
|
insert_logging_mock(logging.INFO)
|
|
insert_logging_mock(logging.INFO)
|
|
|
|
|
|
@@ -290,8 +289,7 @@ def test_create_archive_with_log_debug_calls_borg_with_debug_parameter():
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
CREATE_COMMAND + ('--list', '--filter', 'AME-', '--stats', '--debug', '--show-rc'),
|
|
CREATE_COMMAND + ('--list', '--filter', 'AME-', '--stats', '--debug', '--show-rc'),
|
|
- capture_output=False,
|
|
|
|
- output_as_warning=False,
|
|
|
|
|
|
+ output_log_level=logging.INFO,
|
|
)
|
|
)
|
|
insert_logging_mock(logging.DEBUG)
|
|
insert_logging_mock(logging.DEBUG)
|
|
|
|
|
|
@@ -314,7 +312,7 @@ def test_create_archive_with_log_debug_and_json_suppresses_most_borg_output():
|
|
flexmock(module).should_receive('_make_pattern_flags').and_return(())
|
|
flexmock(module).should_receive('_make_pattern_flags').and_return(())
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
- CREATE_COMMAND + ('--json',), capture_output=True, output_as_warning=False
|
|
|
|
|
|
+ CREATE_COMMAND + ('--json',), output_log_level=None
|
|
)
|
|
)
|
|
insert_logging_mock(logging.DEBUG)
|
|
insert_logging_mock(logging.DEBUG)
|
|
|
|
|
|
@@ -339,7 +337,7 @@ def test_create_archive_with_dry_run_calls_borg_with_dry_run_parameter():
|
|
flexmock(module).should_receive('_make_pattern_flags').and_return(())
|
|
flexmock(module).should_receive('_make_pattern_flags').and_return(())
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
- CREATE_COMMAND + ('--dry-run',), capture_output=False, output_as_warning=False
|
|
|
|
|
|
+ CREATE_COMMAND + ('--dry-run',), output_log_level=logging.INFO
|
|
)
|
|
)
|
|
|
|
|
|
module.create_archive(
|
|
module.create_archive(
|
|
@@ -365,8 +363,7 @@ def test_create_archive_with_dry_run_and_log_info_calls_borg_without_stats_param
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
CREATE_COMMAND + ('--list', '--filter', 'AME-', '--info', '--dry-run'),
|
|
CREATE_COMMAND + ('--list', '--filter', 'AME-', '--info', '--dry-run'),
|
|
- capture_output=False,
|
|
|
|
- output_as_warning=False,
|
|
|
|
|
|
+ output_log_level=logging.INFO,
|
|
)
|
|
)
|
|
insert_logging_mock(logging.INFO)
|
|
insert_logging_mock(logging.INFO)
|
|
|
|
|
|
@@ -393,8 +390,7 @@ def test_create_archive_with_dry_run_and_log_debug_calls_borg_without_stats_para
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
CREATE_COMMAND + ('--list', '--filter', 'AME-', '--debug', '--show-rc', '--dry-run'),
|
|
CREATE_COMMAND + ('--list', '--filter', 'AME-', '--debug', '--show-rc', '--dry-run'),
|
|
- capture_output=False,
|
|
|
|
- output_as_warning=False,
|
|
|
|
|
|
+ output_log_level=logging.INFO,
|
|
)
|
|
)
|
|
insert_logging_mock(logging.DEBUG)
|
|
insert_logging_mock(logging.DEBUG)
|
|
|
|
|
|
@@ -417,9 +413,7 @@ def test_create_archive_with_checkpoint_interval_calls_borg_with_checkpoint_inte
|
|
flexmock(module).should_receive('_make_pattern_flags').and_return(())
|
|
flexmock(module).should_receive('_make_pattern_flags').and_return(())
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
- CREATE_COMMAND + ('--checkpoint-interval', '600'),
|
|
|
|
- capture_output=False,
|
|
|
|
- output_as_warning=False,
|
|
|
|
|
|
+ CREATE_COMMAND + ('--checkpoint-interval', '600'), output_log_level=logging.INFO
|
|
)
|
|
)
|
|
|
|
|
|
module.create_archive(
|
|
module.create_archive(
|
|
@@ -441,9 +435,7 @@ def test_create_archive_with_chunker_params_calls_borg_with_chunker_params_param
|
|
flexmock(module).should_receive('_make_pattern_flags').and_return(())
|
|
flexmock(module).should_receive('_make_pattern_flags').and_return(())
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
- CREATE_COMMAND + ('--chunker-params', '1,2,3,4'),
|
|
|
|
- capture_output=False,
|
|
|
|
- output_as_warning=False,
|
|
|
|
|
|
+ CREATE_COMMAND + ('--chunker-params', '1,2,3,4'), output_log_level=logging.INFO
|
|
)
|
|
)
|
|
|
|
|
|
module.create_archive(
|
|
module.create_archive(
|
|
@@ -465,7 +457,7 @@ def test_create_archive_with_compression_calls_borg_with_compression_parameters(
|
|
flexmock(module).should_receive('_make_pattern_flags').and_return(())
|
|
flexmock(module).should_receive('_make_pattern_flags').and_return(())
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
- CREATE_COMMAND + ('--compression', 'rle'), capture_output=False, output_as_warning=False
|
|
|
|
|
|
+ CREATE_COMMAND + ('--compression', 'rle'), output_log_level=logging.INFO
|
|
)
|
|
)
|
|
|
|
|
|
module.create_archive(
|
|
module.create_archive(
|
|
@@ -487,9 +479,7 @@ def test_create_archive_with_remote_rate_limit_calls_borg_with_remote_ratelimit_
|
|
flexmock(module).should_receive('_make_pattern_flags').and_return(())
|
|
flexmock(module).should_receive('_make_pattern_flags').and_return(())
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
- CREATE_COMMAND + ('--remote-ratelimit', '100'),
|
|
|
|
- capture_output=False,
|
|
|
|
- output_as_warning=False,
|
|
|
|
|
|
+ CREATE_COMMAND + ('--remote-ratelimit', '100'), output_log_level=logging.INFO
|
|
)
|
|
)
|
|
|
|
|
|
module.create_archive(
|
|
module.create_archive(
|
|
@@ -511,7 +501,7 @@ def test_create_archive_with_one_file_system_calls_borg_with_one_file_system_par
|
|
flexmock(module).should_receive('_make_pattern_flags').and_return(())
|
|
flexmock(module).should_receive('_make_pattern_flags').and_return(())
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
- CREATE_COMMAND + ('--one-file-system',), capture_output=False, output_as_warning=False
|
|
|
|
|
|
+ CREATE_COMMAND + ('--one-file-system',), output_log_level=logging.INFO
|
|
)
|
|
)
|
|
|
|
|
|
module.create_archive(
|
|
module.create_archive(
|
|
@@ -534,7 +524,7 @@ def test_create_archive_with_numeric_owner_calls_borg_with_numeric_owner_paramet
|
|
flexmock(module).should_receive('_make_pattern_flags').and_return(())
|
|
flexmock(module).should_receive('_make_pattern_flags').and_return(())
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
- CREATE_COMMAND + ('--numeric-owner',), capture_output=False, output_as_warning=False
|
|
|
|
|
|
+ CREATE_COMMAND + ('--numeric-owner',), output_log_level=logging.INFO
|
|
)
|
|
)
|
|
|
|
|
|
module.create_archive(
|
|
module.create_archive(
|
|
@@ -557,7 +547,7 @@ def test_create_archive_with_read_special_calls_borg_with_read_special_parameter
|
|
flexmock(module).should_receive('_make_pattern_flags').and_return(())
|
|
flexmock(module).should_receive('_make_pattern_flags').and_return(())
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
- CREATE_COMMAND + ('--read-special',), capture_output=False, output_as_warning=False
|
|
|
|
|
|
+ CREATE_COMMAND + ('--read-special',), output_log_level=logging.INFO
|
|
)
|
|
)
|
|
|
|
|
|
module.create_archive(
|
|
module.create_archive(
|
|
@@ -580,7 +570,7 @@ def test_create_archive_with_bsd_flags_true_calls_borg_without_nobsdflags_parame
|
|
flexmock(module).should_receive('_make_pattern_flags').and_return(())
|
|
flexmock(module).should_receive('_make_pattern_flags').and_return(())
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
- CREATE_COMMAND, capture_output=False, output_as_warning=False
|
|
|
|
|
|
+ CREATE_COMMAND, output_log_level=logging.INFO
|
|
)
|
|
)
|
|
|
|
|
|
module.create_archive(
|
|
module.create_archive(
|
|
@@ -603,7 +593,7 @@ def test_create_archive_with_bsd_flags_false_calls_borg_with_nobsdflags_paramete
|
|
flexmock(module).should_receive('_make_pattern_flags').and_return(())
|
|
flexmock(module).should_receive('_make_pattern_flags').and_return(())
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
- CREATE_COMMAND + ('--nobsdflags',), capture_output=False, output_as_warning=False
|
|
|
|
|
|
+ CREATE_COMMAND + ('--nobsdflags',), output_log_level=logging.INFO
|
|
)
|
|
)
|
|
|
|
|
|
module.create_archive(
|
|
module.create_archive(
|
|
@@ -626,9 +616,7 @@ def test_create_archive_with_files_cache_calls_borg_with_files_cache_parameters(
|
|
flexmock(module).should_receive('_make_pattern_flags').and_return(())
|
|
flexmock(module).should_receive('_make_pattern_flags').and_return(())
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
- CREATE_COMMAND + ('--files-cache', 'ctime,size'),
|
|
|
|
- capture_output=False,
|
|
|
|
- output_as_warning=False,
|
|
|
|
|
|
+ CREATE_COMMAND + ('--files-cache', 'ctime,size'), output_log_level=logging.INFO
|
|
)
|
|
)
|
|
|
|
|
|
module.create_archive(
|
|
module.create_archive(
|
|
@@ -651,7 +639,7 @@ def test_create_archive_with_local_path_calls_borg_via_local_path():
|
|
flexmock(module).should_receive('_make_pattern_flags').and_return(())
|
|
flexmock(module).should_receive('_make_pattern_flags').and_return(())
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
- ('borg1',) + CREATE_COMMAND[1:], capture_output=False, output_as_warning=False
|
|
|
|
|
|
+ ('borg1',) + CREATE_COMMAND[1:], output_log_level=logging.INFO
|
|
)
|
|
)
|
|
|
|
|
|
module.create_archive(
|
|
module.create_archive(
|
|
@@ -674,7 +662,7 @@ def test_create_archive_with_remote_path_calls_borg_with_remote_path_parameters(
|
|
flexmock(module).should_receive('_make_pattern_flags').and_return(())
|
|
flexmock(module).should_receive('_make_pattern_flags').and_return(())
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
- CREATE_COMMAND + ('--remote-path', 'borg1'), capture_output=False, output_as_warning=False
|
|
|
|
|
|
+ CREATE_COMMAND + ('--remote-path', 'borg1'), output_log_level=logging.INFO
|
|
)
|
|
)
|
|
|
|
|
|
module.create_archive(
|
|
module.create_archive(
|
|
@@ -697,7 +685,7 @@ def test_create_archive_with_umask_calls_borg_with_umask_parameters():
|
|
flexmock(module).should_receive('_make_pattern_flags').and_return(())
|
|
flexmock(module).should_receive('_make_pattern_flags').and_return(())
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
- CREATE_COMMAND + ('--umask', '740'), capture_output=False, output_as_warning=False
|
|
|
|
|
|
+ CREATE_COMMAND + ('--umask', '740'), output_log_level=logging.INFO
|
|
)
|
|
)
|
|
|
|
|
|
module.create_archive(
|
|
module.create_archive(
|
|
@@ -719,7 +707,7 @@ def test_create_archive_with_lock_wait_calls_borg_with_lock_wait_parameters():
|
|
flexmock(module).should_receive('_make_pattern_flags').and_return(())
|
|
flexmock(module).should_receive('_make_pattern_flags').and_return(())
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
- CREATE_COMMAND + ('--lock-wait', '5'), capture_output=False, output_as_warning=False
|
|
|
|
|
|
+ CREATE_COMMAND + ('--lock-wait', '5'), output_log_level=logging.INFO
|
|
)
|
|
)
|
|
|
|
|
|
module.create_archive(
|
|
module.create_archive(
|
|
@@ -741,7 +729,7 @@ def test_create_archive_with_stats_calls_borg_with_stats_parameter():
|
|
flexmock(module).should_receive('_make_pattern_flags').and_return(())
|
|
flexmock(module).should_receive('_make_pattern_flags').and_return(())
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
- CREATE_COMMAND + ('--stats',), capture_output=False, output_as_warning=True
|
|
|
|
|
|
+ CREATE_COMMAND + ('--stats',), output_log_level=logging.WARNING
|
|
)
|
|
)
|
|
|
|
|
|
module.create_archive(
|
|
module.create_archive(
|
|
@@ -764,7 +752,7 @@ def test_create_archive_with_json_calls_borg_with_json_parameter():
|
|
flexmock(module).should_receive('_make_pattern_flags').and_return(())
|
|
flexmock(module).should_receive('_make_pattern_flags').and_return(())
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
- CREATE_COMMAND + ('--json',), capture_output=True, output_as_warning=False
|
|
|
|
|
|
+ CREATE_COMMAND + ('--json',), output_log_level=None
|
|
).and_return('[]')
|
|
).and_return('[]')
|
|
|
|
|
|
json_output = module.create_archive(
|
|
json_output = module.create_archive(
|
|
@@ -789,7 +777,7 @@ def test_create_archive_with_stats_and_json_calls_borg_without_stats_parameter()
|
|
flexmock(module).should_receive('_make_pattern_flags').and_return(())
|
|
flexmock(module).should_receive('_make_pattern_flags').and_return(())
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
- CREATE_COMMAND + ('--json',), capture_output=True, output_as_warning=False
|
|
|
|
|
|
+ CREATE_COMMAND + ('--json',), output_log_level=None
|
|
).and_return('[]')
|
|
).and_return('[]')
|
|
|
|
|
|
json_output = module.create_archive(
|
|
json_output = module.create_archive(
|
|
@@ -816,8 +804,7 @@ def test_create_archive_with_source_directories_glob_expands():
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
('borg', 'create', 'repo::{}'.format(DEFAULT_ARCHIVE_NAME), 'foo', 'food'),
|
|
('borg', 'create', 'repo::{}'.format(DEFAULT_ARCHIVE_NAME), 'foo', 'food'),
|
|
- capture_output=False,
|
|
|
|
- output_as_warning=False,
|
|
|
|
|
|
+ output_log_level=logging.INFO,
|
|
)
|
|
)
|
|
flexmock(module.glob).should_receive('glob').with_args('foo*').and_return(['foo', 'food'])
|
|
flexmock(module.glob).should_receive('glob').with_args('foo*').and_return(['foo', 'food'])
|
|
|
|
|
|
@@ -841,8 +828,7 @@ def test_create_archive_with_non_matching_source_directories_glob_passes_through
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
('borg', 'create', 'repo::{}'.format(DEFAULT_ARCHIVE_NAME), 'foo*'),
|
|
('borg', 'create', 'repo::{}'.format(DEFAULT_ARCHIVE_NAME), 'foo*'),
|
|
- capture_output=False,
|
|
|
|
- output_as_warning=False,
|
|
|
|
|
|
+ output_log_level=logging.INFO,
|
|
)
|
|
)
|
|
flexmock(module.glob).should_receive('glob').with_args('foo*').and_return([])
|
|
flexmock(module.glob).should_receive('glob').with_args('foo*').and_return([])
|
|
|
|
|
|
@@ -866,8 +852,7 @@ def test_create_archive_with_glob_calls_borg_with_expanded_directories():
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
('borg', 'create', 'repo::{}'.format(DEFAULT_ARCHIVE_NAME), 'foo', 'food'),
|
|
('borg', 'create', 'repo::{}'.format(DEFAULT_ARCHIVE_NAME), 'foo', 'food'),
|
|
- capture_output=False,
|
|
|
|
- output_as_warning=False,
|
|
|
|
|
|
+ output_log_level=logging.INFO,
|
|
)
|
|
)
|
|
|
|
|
|
module.create_archive(
|
|
module.create_archive(
|
|
@@ -889,9 +874,7 @@ def test_create_archive_with_archive_name_format_calls_borg_with_archive_name():
|
|
flexmock(module).should_receive('_make_pattern_flags').and_return(())
|
|
flexmock(module).should_receive('_make_pattern_flags').and_return(())
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
- ('borg', 'create', 'repo::ARCHIVE_NAME', 'foo', 'bar'),
|
|
|
|
- capture_output=False,
|
|
|
|
- output_as_warning=False,
|
|
|
|
|
|
+ ('borg', 'create', 'repo::ARCHIVE_NAME', 'foo', 'bar'), output_log_level=logging.INFO
|
|
)
|
|
)
|
|
|
|
|
|
module.create_archive(
|
|
module.create_archive(
|
|
@@ -914,8 +897,7 @@ def test_create_archive_with_archive_name_format_accepts_borg_placeholders():
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
flexmock(module).should_receive('_make_exclude_flags').and_return(())
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
('borg', 'create', 'repo::Documents_{hostname}-{now}', 'foo', 'bar'),
|
|
('borg', 'create', 'repo::Documents_{hostname}-{now}', 'foo', 'bar'),
|
|
- capture_output=False,
|
|
|
|
- output_as_warning=False,
|
|
|
|
|
|
+ output_log_level=logging.INFO,
|
|
)
|
|
)
|
|
|
|
|
|
module.create_archive(
|
|
module.create_archive(
|