mirror of
https://github.com/borgmatic-collective/borgmatic.git
synced 2026-07-22 02:03:01 +02:00
Fix the "--progress" flag on the "compact" action to actually update the progress of segment compaction (#1333).
This commit is contained in:
@@ -10,6 +10,7 @@ from ..test_verbosity import insert_logging_mock
|
||||
def insert_execute_command_mock(
|
||||
compact_command,
|
||||
output_log_level,
|
||||
output_file=None,
|
||||
working_directory=None,
|
||||
borg_exit_codes=None,
|
||||
):
|
||||
@@ -20,6 +21,7 @@ def insert_execute_command_mock(
|
||||
flexmock(module).should_receive('execute_command').with_args(
|
||||
compact_command,
|
||||
output_log_level=output_log_level,
|
||||
output_file=output_file,
|
||||
environment=None,
|
||||
working_directory=working_directory,
|
||||
borg_local_path=compact_command[0],
|
||||
@@ -184,7 +186,9 @@ def test_compact_segments_with_remote_path_calls_borg_with_remote_path_flags():
|
||||
|
||||
def test_compact_segments_with_progress_calls_borg_with_progress_flag():
|
||||
flexmock(module.flags).should_receive('make_repository_flags').and_return(('repo',))
|
||||
insert_execute_command_mock((*COMPACT_COMMAND, '--progress', 'repo'), logging.INFO)
|
||||
insert_execute_command_mock(
|
||||
(*COMPACT_COMMAND, '--progress', 'repo'), logging.INFO, module.DO_NOT_CAPTURE
|
||||
)
|
||||
insert_logging_mock(logging.WARNING)
|
||||
|
||||
module.compact_segments(
|
||||
@@ -199,7 +203,9 @@ def test_compact_segments_with_progress_calls_borg_with_progress_flag():
|
||||
def test_compact_segments_with_log_json_and_progress_calls_borg_with_both_flags():
|
||||
flexmock(module.flags).should_receive('make_repository_flags').and_return(('repo',))
|
||||
insert_execute_command_mock(
|
||||
(*COMPACT_COMMAND, '--log-json', '--progress', 'repo'), logging.INFO
|
||||
(*COMPACT_COMMAND, '--log-json', '--progress', 'repo'),
|
||||
logging.INFO,
|
||||
module.DO_NOT_CAPTURE,
|
||||
)
|
||||
insert_logging_mock(logging.WARNING)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user