2018-09-30 08:15:18 +02:00
|
|
|
import logging
|
2017-08-06 01:21:39 +02:00
|
|
|
|
2020-05-11 20:34:14 +02:00
|
|
|
import pytest
|
2017-08-06 01:21:39 +02:00
|
|
|
from flexmock import flexmock
|
|
|
|
|
|
|
|
from borgmatic.borg import extract as module
|
2019-05-13 23:39:10 +02:00
|
|
|
|
2018-09-30 22:57:20 +02:00
|
|
|
from ..test_verbosity import insert_logging_mock
|
2017-08-06 01:21:39 +02:00
|
|
|
|
|
|
|
|
2020-05-15 07:38:38 +02:00
|
|
|
def insert_execute_command_mock(command, working_directory=None):
|
2019-10-31 20:57:36 +01:00
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
2020-05-15 07:38:38 +02:00
|
|
|
command, working_directory=working_directory
|
2019-10-31 20:57:36 +01:00
|
|
|
).once()
|
2017-08-06 01:21:39 +02:00
|
|
|
|
|
|
|
|
2019-06-13 05:56:20 +02:00
|
|
|
def insert_execute_command_output_mock(command, result):
|
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
2020-05-15 07:38:38 +02:00
|
|
|
command, output_log_level=None, borg_local_path=command[0]
|
2019-06-13 05:56:20 +02:00
|
|
|
).and_return(result).once()
|
2017-08-06 01:21:39 +02:00
|
|
|
|
|
|
|
|
2019-02-18 19:31:52 +01:00
|
|
|
def test_extract_last_archive_dry_run_calls_borg_with_last_archive():
|
2019-06-13 05:56:20 +02:00
|
|
|
insert_execute_command_output_mock(
|
|
|
|
('borg', 'list', '--short', 'repo'), result='archive1\narchive2\n'
|
2017-08-06 01:21:39 +02:00
|
|
|
)
|
2019-06-13 05:56:20 +02:00
|
|
|
insert_execute_command_mock(('borg', 'extract', '--dry-run', 'repo::archive2'))
|
2022-02-10 19:09:18 +01:00
|
|
|
flexmock(module.feature).should_receive('available').and_return(True)
|
2017-08-06 01:21:39 +02:00
|
|
|
|
2018-09-30 07:45:00 +02:00
|
|
|
module.extract_last_archive_dry_run(repository='repo', lock_wait=None)
|
2017-08-06 01:21:39 +02:00
|
|
|
|
|
|
|
|
2019-06-13 05:56:20 +02:00
|
|
|
def test_extract_last_archive_dry_run_without_any_archives_should_not_raise():
|
|
|
|
insert_execute_command_output_mock(('borg', 'list', '--short', 'repo'), result='\n')
|
2022-02-10 19:09:18 +01:00
|
|
|
flexmock(module.feature).should_receive('available').and_return(True)
|
2017-08-06 01:21:39 +02:00
|
|
|
|
2018-09-30 07:45:00 +02:00
|
|
|
module.extract_last_archive_dry_run(repository='repo', lock_wait=None)
|
2017-08-06 01:21:39 +02:00
|
|
|
|
|
|
|
|
2019-02-18 19:31:52 +01:00
|
|
|
def test_extract_last_archive_dry_run_with_log_info_calls_borg_with_info_parameter():
|
2019-06-13 05:56:20 +02:00
|
|
|
insert_execute_command_output_mock(
|
2019-09-13 00:27:04 +02:00
|
|
|
('borg', 'list', '--short', '--info', 'repo'), result='archive1\narchive2\n'
|
2017-08-06 01:21:39 +02:00
|
|
|
)
|
2019-09-13 00:27:04 +02:00
|
|
|
insert_execute_command_mock(('borg', 'extract', '--dry-run', '--info', 'repo::archive2'))
|
2018-09-08 22:53:37 +02:00
|
|
|
insert_logging_mock(logging.INFO)
|
2022-02-10 19:09:18 +01:00
|
|
|
flexmock(module.feature).should_receive('available').and_return(True)
|
2017-08-06 01:21:39 +02:00
|
|
|
|
2018-09-30 07:45:00 +02:00
|
|
|
module.extract_last_archive_dry_run(repository='repo', lock_wait=None)
|
2017-08-06 01:21:39 +02:00
|
|
|
|
|
|
|
|
2019-02-18 19:31:52 +01:00
|
|
|
def test_extract_last_archive_dry_run_with_log_debug_calls_borg_with_debug_parameter():
|
2019-06-13 05:56:20 +02:00
|
|
|
insert_execute_command_output_mock(
|
2019-09-13 00:27:04 +02:00
|
|
|
('borg', 'list', '--short', '--debug', '--show-rc', 'repo'), result='archive1\narchive2\n'
|
2017-08-06 01:21:39 +02:00
|
|
|
)
|
2019-06-13 05:56:20 +02:00
|
|
|
insert_execute_command_mock(
|
2019-09-13 00:27:04 +02:00
|
|
|
('borg', 'extract', '--dry-run', '--debug', '--show-rc', '--list', 'repo::archive2')
|
2017-08-06 01:21:39 +02:00
|
|
|
)
|
2018-09-08 22:53:37 +02:00
|
|
|
insert_logging_mock(logging.DEBUG)
|
2022-02-10 19:09:18 +01:00
|
|
|
flexmock(module.feature).should_receive('available').and_return(True)
|
2017-08-06 01:21:39 +02:00
|
|
|
|
2018-09-30 07:45:00 +02:00
|
|
|
module.extract_last_archive_dry_run(repository='repo', lock_wait=None)
|
2017-08-06 01:21:39 +02:00
|
|
|
|
|
|
|
|
2019-02-18 19:31:52 +01:00
|
|
|
def test_extract_last_archive_dry_run_calls_borg_via_local_path():
|
2019-06-13 05:56:20 +02:00
|
|
|
insert_execute_command_output_mock(
|
|
|
|
('borg1', 'list', '--short', 'repo'), result='archive1\narchive2\n'
|
2018-01-15 01:35:24 +01:00
|
|
|
)
|
2019-06-13 05:56:20 +02:00
|
|
|
insert_execute_command_mock(('borg1', 'extract', '--dry-run', 'repo::archive2'))
|
2022-02-10 19:09:18 +01:00
|
|
|
flexmock(module.feature).should_receive('available').and_return(True)
|
2018-01-15 01:35:24 +01:00
|
|
|
|
2018-09-30 07:45:00 +02:00
|
|
|
module.extract_last_archive_dry_run(repository='repo', lock_wait=None, local_path='borg1')
|
2018-01-15 01:35:24 +01:00
|
|
|
|
|
|
|
|
2019-02-18 19:31:52 +01:00
|
|
|
def test_extract_last_archive_dry_run_calls_borg_with_remote_path_parameters():
|
2019-06-13 05:56:20 +02:00
|
|
|
insert_execute_command_output_mock(
|
2019-09-13 00:27:04 +02:00
|
|
|
('borg', 'list', '--short', '--remote-path', 'borg1', 'repo'), result='archive1\narchive2\n'
|
2017-08-06 01:21:39 +02:00
|
|
|
)
|
2019-06-13 05:56:20 +02:00
|
|
|
insert_execute_command_mock(
|
2019-09-13 00:27:04 +02:00
|
|
|
('borg', 'extract', '--dry-run', '--remote-path', 'borg1', 'repo::archive2')
|
2017-08-06 01:21:39 +02:00
|
|
|
)
|
2022-02-10 19:09:18 +01:00
|
|
|
flexmock(module.feature).should_receive('available').and_return(True)
|
2017-08-06 01:21:39 +02:00
|
|
|
|
2018-09-30 07:45:00 +02:00
|
|
|
module.extract_last_archive_dry_run(repository='repo', lock_wait=None, remote_path='borg1')
|
2018-02-20 00:51:04 +01:00
|
|
|
|
|
|
|
|
2019-02-18 19:31:52 +01:00
|
|
|
def test_extract_last_archive_dry_run_calls_borg_with_lock_wait_parameters():
|
2019-06-13 05:56:20 +02:00
|
|
|
insert_execute_command_output_mock(
|
2019-09-13 00:27:04 +02:00
|
|
|
('borg', 'list', '--short', '--lock-wait', '5', 'repo'), result='archive1\narchive2\n'
|
2019-06-13 05:56:20 +02:00
|
|
|
)
|
|
|
|
insert_execute_command_mock(
|
2019-09-13 00:27:04 +02:00
|
|
|
('borg', 'extract', '--dry-run', '--lock-wait', '5', 'repo::archive2')
|
2018-02-20 00:51:04 +01:00
|
|
|
)
|
2022-02-10 19:09:18 +01:00
|
|
|
flexmock(module.feature).should_receive('available').and_return(True)
|
2018-02-20 00:51:04 +01:00
|
|
|
|
2018-09-30 07:45:00 +02:00
|
|
|
module.extract_last_archive_dry_run(repository='repo', lock_wait=5)
|
2019-02-18 19:31:52 +01:00
|
|
|
|
|
|
|
|
2019-11-25 23:56:20 +01:00
|
|
|
def test_extract_archive_calls_borg_with_path_parameters():
|
2019-10-31 20:57:36 +01:00
|
|
|
flexmock(module.os.path).should_receive('abspath').and_return('repo')
|
2019-06-13 05:56:20 +02:00
|
|
|
insert_execute_command_mock(('borg', 'extract', 'repo::archive', 'path1', 'path2'))
|
2022-02-10 19:09:18 +01:00
|
|
|
flexmock(module.feature).should_receive('available').and_return(True)
|
2019-02-19 06:59:09 +01:00
|
|
|
|
|
|
|
module.extract_archive(
|
|
|
|
dry_run=False,
|
|
|
|
repository='repo',
|
|
|
|
archive='archive',
|
2019-11-01 18:00:26 +01:00
|
|
|
paths=['path1', 'path2'],
|
2019-03-05 18:11:35 +01:00
|
|
|
location_config={},
|
2019-02-19 06:59:09 +01:00
|
|
|
storage_config={},
|
2022-02-10 19:09:18 +01:00
|
|
|
local_borg_version='1.2.3',
|
2019-02-19 06:59:09 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
|
2019-02-18 19:31:52 +01:00
|
|
|
def test_extract_archive_calls_borg_with_remote_path_parameters():
|
2019-10-31 20:57:36 +01:00
|
|
|
flexmock(module.os.path).should_receive('abspath').and_return('repo')
|
2019-09-13 00:27:04 +02:00
|
|
|
insert_execute_command_mock(('borg', 'extract', '--remote-path', 'borg1', 'repo::archive'))
|
2022-02-10 19:09:18 +01:00
|
|
|
flexmock(module.feature).should_receive('available').and_return(True)
|
2019-02-18 19:31:52 +01:00
|
|
|
|
|
|
|
module.extract_archive(
|
|
|
|
dry_run=False,
|
|
|
|
repository='repo',
|
|
|
|
archive='archive',
|
2019-11-01 18:00:26 +01:00
|
|
|
paths=None,
|
2019-03-05 18:11:35 +01:00
|
|
|
location_config={},
|
2019-02-18 19:31:52 +01:00
|
|
|
storage_config={},
|
2022-02-10 19:09:18 +01:00
|
|
|
local_borg_version='1.2.3',
|
2019-02-18 19:31:52 +01:00
|
|
|
remote_path='borg1',
|
|
|
|
)
|
|
|
|
|
|
|
|
|
2022-02-10 19:09:18 +01:00
|
|
|
@pytest.mark.parametrize(
|
|
|
|
'feature_available,option_flag', ((True, '--numeric-ids'), (False, '--numeric-owner'),),
|
|
|
|
)
|
|
|
|
def test_extract_archive_calls_borg_with_numeric_ids_parameter(feature_available, option_flag):
|
2019-10-31 20:57:36 +01:00
|
|
|
flexmock(module.os.path).should_receive('abspath').and_return('repo')
|
2022-02-10 19:09:18 +01:00
|
|
|
insert_execute_command_mock(('borg', 'extract', option_flag, 'repo::archive'))
|
|
|
|
flexmock(module.feature).should_receive('available').and_return(feature_available)
|
2019-03-05 18:11:35 +01:00
|
|
|
|
|
|
|
module.extract_archive(
|
|
|
|
dry_run=False,
|
|
|
|
repository='repo',
|
|
|
|
archive='archive',
|
2019-11-01 18:00:26 +01:00
|
|
|
paths=None,
|
2019-03-05 18:11:35 +01:00
|
|
|
location_config={'numeric_owner': True},
|
|
|
|
storage_config={},
|
2022-02-10 19:09:18 +01:00
|
|
|
local_borg_version='1.2.3',
|
2019-03-05 18:11:35 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
|
2019-02-18 19:31:52 +01:00
|
|
|
def test_extract_archive_calls_borg_with_umask_parameters():
|
2019-10-31 20:57:36 +01:00
|
|
|
flexmock(module.os.path).should_receive('abspath').and_return('repo')
|
2019-09-13 00:27:04 +02:00
|
|
|
insert_execute_command_mock(('borg', 'extract', '--umask', '0770', 'repo::archive'))
|
2022-02-10 19:09:18 +01:00
|
|
|
flexmock(module.feature).should_receive('available').and_return(True)
|
2019-02-18 19:31:52 +01:00
|
|
|
|
|
|
|
module.extract_archive(
|
|
|
|
dry_run=False,
|
|
|
|
repository='repo',
|
|
|
|
archive='archive',
|
2019-11-01 18:00:26 +01:00
|
|
|
paths=None,
|
2019-03-05 18:11:35 +01:00
|
|
|
location_config={},
|
2019-02-18 19:31:52 +01:00
|
|
|
storage_config={'umask': '0770'},
|
2022-02-10 19:09:18 +01:00
|
|
|
local_borg_version='1.2.3',
|
2019-02-18 19:31:52 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
def test_extract_archive_calls_borg_with_lock_wait_parameters():
|
2019-10-31 20:57:36 +01:00
|
|
|
flexmock(module.os.path).should_receive('abspath').and_return('repo')
|
2019-09-13 00:27:04 +02:00
|
|
|
insert_execute_command_mock(('borg', 'extract', '--lock-wait', '5', 'repo::archive'))
|
2022-02-10 19:09:18 +01:00
|
|
|
flexmock(module.feature).should_receive('available').and_return(True)
|
2019-02-18 19:31:52 +01:00
|
|
|
|
|
|
|
module.extract_archive(
|
|
|
|
dry_run=False,
|
|
|
|
repository='repo',
|
|
|
|
archive='archive',
|
2019-11-01 18:00:26 +01:00
|
|
|
paths=None,
|
2019-03-05 18:11:35 +01:00
|
|
|
location_config={},
|
2019-02-18 19:31:52 +01:00
|
|
|
storage_config={'lock_wait': '5'},
|
2022-02-10 19:09:18 +01:00
|
|
|
local_borg_version='1.2.3',
|
2019-02-18 19:31:52 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
def test_extract_archive_with_log_info_calls_borg_with_info_parameter():
|
2019-10-31 20:57:36 +01:00
|
|
|
flexmock(module.os.path).should_receive('abspath').and_return('repo')
|
2019-09-13 00:27:04 +02:00
|
|
|
insert_execute_command_mock(('borg', 'extract', '--info', 'repo::archive'))
|
2019-02-18 19:31:52 +01:00
|
|
|
insert_logging_mock(logging.INFO)
|
2022-02-10 19:09:18 +01:00
|
|
|
flexmock(module.feature).should_receive('available').and_return(True)
|
2019-02-18 19:31:52 +01:00
|
|
|
|
|
|
|
module.extract_archive(
|
2019-03-05 18:11:35 +01:00
|
|
|
dry_run=False,
|
|
|
|
repository='repo',
|
|
|
|
archive='archive',
|
2019-11-01 18:00:26 +01:00
|
|
|
paths=None,
|
2019-03-05 18:11:35 +01:00
|
|
|
location_config={},
|
|
|
|
storage_config={},
|
2022-02-10 19:09:18 +01:00
|
|
|
local_borg_version='1.2.3',
|
2019-02-18 19:31:52 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
def test_extract_archive_with_log_debug_calls_borg_with_debug_parameters():
|
2019-10-31 20:57:36 +01:00
|
|
|
flexmock(module.os.path).should_receive('abspath').and_return('repo')
|
2019-06-13 05:56:20 +02:00
|
|
|
insert_execute_command_mock(
|
2019-09-13 00:27:04 +02:00
|
|
|
('borg', 'extract', '--debug', '--list', '--show-rc', 'repo::archive')
|
2019-06-13 05:56:20 +02:00
|
|
|
)
|
2019-02-18 19:31:52 +01:00
|
|
|
insert_logging_mock(logging.DEBUG)
|
2022-02-10 19:09:18 +01:00
|
|
|
flexmock(module.feature).should_receive('available').and_return(True)
|
2019-02-18 19:31:52 +01:00
|
|
|
|
|
|
|
module.extract_archive(
|
2019-03-05 18:11:35 +01:00
|
|
|
dry_run=False,
|
|
|
|
repository='repo',
|
|
|
|
archive='archive',
|
2019-11-01 18:00:26 +01:00
|
|
|
paths=None,
|
2019-03-05 18:11:35 +01:00
|
|
|
location_config={},
|
|
|
|
storage_config={},
|
2022-02-10 19:09:18 +01:00
|
|
|
local_borg_version='1.2.3',
|
2019-02-18 19:31:52 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
def test_extract_archive_calls_borg_with_dry_run_parameter():
|
2019-10-31 20:57:36 +01:00
|
|
|
flexmock(module.os.path).should_receive('abspath').and_return('repo')
|
2019-09-13 00:27:04 +02:00
|
|
|
insert_execute_command_mock(('borg', 'extract', '--dry-run', 'repo::archive'))
|
2022-02-10 19:09:18 +01:00
|
|
|
flexmock(module.feature).should_receive('available').and_return(True)
|
2019-02-18 19:31:52 +01:00
|
|
|
|
|
|
|
module.extract_archive(
|
2019-03-05 18:11:35 +01:00
|
|
|
dry_run=True,
|
|
|
|
repository='repo',
|
|
|
|
archive='archive',
|
2019-11-01 18:00:26 +01:00
|
|
|
paths=None,
|
2019-03-05 18:11:35 +01:00
|
|
|
location_config={},
|
|
|
|
storage_config={},
|
2022-02-10 19:09:18 +01:00
|
|
|
local_borg_version='1.2.3',
|
2019-02-18 19:31:52 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
|
2019-10-31 20:57:36 +01:00
|
|
|
def test_extract_archive_calls_borg_with_destination_path():
|
|
|
|
flexmock(module.os.path).should_receive('abspath').and_return('repo')
|
|
|
|
insert_execute_command_mock(('borg', 'extract', 'repo::archive'), working_directory='/dest')
|
2022-02-10 19:09:18 +01:00
|
|
|
flexmock(module.feature).should_receive('available').and_return(True)
|
2019-10-31 20:57:36 +01:00
|
|
|
|
|
|
|
module.extract_archive(
|
|
|
|
dry_run=False,
|
|
|
|
repository='repo',
|
|
|
|
archive='archive',
|
2019-11-01 18:00:26 +01:00
|
|
|
paths=None,
|
2019-10-31 20:57:36 +01:00
|
|
|
location_config={},
|
|
|
|
storage_config={},
|
2022-02-10 19:09:18 +01:00
|
|
|
local_borg_version='1.2.3',
|
2019-10-31 20:57:36 +01:00
|
|
|
destination_path='/dest',
|
|
|
|
)
|
|
|
|
|
|
|
|
|
2020-06-06 23:57:14 +02:00
|
|
|
def test_extract_archive_calls_borg_with_strip_components():
|
|
|
|
flexmock(module.os.path).should_receive('abspath').and_return('repo')
|
|
|
|
insert_execute_command_mock(('borg', 'extract', '--strip-components', '5', 'repo::archive'))
|
2022-02-10 19:09:18 +01:00
|
|
|
flexmock(module.feature).should_receive('available').and_return(True)
|
2020-06-06 23:57:14 +02:00
|
|
|
|
|
|
|
module.extract_archive(
|
|
|
|
dry_run=False,
|
|
|
|
repository='repo',
|
|
|
|
archive='archive',
|
|
|
|
paths=None,
|
|
|
|
location_config={},
|
|
|
|
storage_config={},
|
2022-02-10 19:09:18 +01:00
|
|
|
local_borg_version='1.2.3',
|
2020-06-06 23:57:14 +02:00
|
|
|
strip_components=5,
|
|
|
|
)
|
|
|
|
|
|
|
|
|
2019-02-18 19:31:52 +01:00
|
|
|
def test_extract_archive_calls_borg_with_progress_parameter():
|
2019-10-31 20:57:36 +01:00
|
|
|
flexmock(module.os.path).should_receive('abspath').and_return('repo')
|
2020-05-10 06:53:16 +02:00
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
2019-10-31 20:57:36 +01:00
|
|
|
('borg', 'extract', '--progress', 'repo::archive'),
|
2020-05-10 06:53:16 +02:00
|
|
|
output_file=module.DO_NOT_CAPTURE,
|
2019-10-31 20:57:36 +01:00
|
|
|
working_directory=None,
|
2019-09-25 21:03:10 +02:00
|
|
|
).once()
|
2022-02-10 19:09:18 +01:00
|
|
|
flexmock(module.feature).should_receive('available').and_return(True)
|
2019-02-18 19:31:52 +01:00
|
|
|
|
|
|
|
module.extract_archive(
|
|
|
|
dry_run=False,
|
|
|
|
repository='repo',
|
|
|
|
archive='archive',
|
2019-11-01 18:00:26 +01:00
|
|
|
paths=None,
|
2019-03-05 18:11:35 +01:00
|
|
|
location_config={},
|
2019-02-18 19:31:52 +01:00
|
|
|
storage_config={},
|
2022-02-10 19:09:18 +01:00
|
|
|
local_borg_version='1.2.3',
|
2019-02-18 19:31:52 +01:00
|
|
|
progress=True,
|
|
|
|
)
|
2019-11-12 20:47:24 +01:00
|
|
|
|
|
|
|
|
2020-05-11 20:34:14 +02:00
|
|
|
def test_extract_archive_with_progress_and_extract_to_stdout_raises():
|
|
|
|
flexmock(module).should_receive('execute_command').never()
|
|
|
|
|
|
|
|
with pytest.raises(ValueError):
|
|
|
|
module.extract_archive(
|
|
|
|
dry_run=False,
|
|
|
|
repository='repo',
|
|
|
|
archive='archive',
|
|
|
|
paths=None,
|
|
|
|
location_config={},
|
|
|
|
storage_config={},
|
2022-02-10 19:09:18 +01:00
|
|
|
local_borg_version='1.2.3',
|
2020-05-11 20:34:14 +02:00
|
|
|
progress=True,
|
|
|
|
extract_to_stdout=True,
|
|
|
|
)
|
|
|
|
|
|
|
|
|
2020-05-07 21:14:27 +02:00
|
|
|
def test_extract_archive_calls_borg_with_stdout_parameter_and_returns_process():
|
|
|
|
flexmock(module.os.path).should_receive('abspath').and_return('repo')
|
|
|
|
process = flexmock()
|
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
|
|
|
('borg', 'extract', '--stdout', 'repo::archive'),
|
|
|
|
output_file=module.subprocess.PIPE,
|
|
|
|
working_directory=None,
|
|
|
|
run_to_completion=False,
|
|
|
|
).and_return(process).once()
|
2022-02-10 19:09:18 +01:00
|
|
|
flexmock(module.feature).should_receive('available').and_return(True)
|
2020-05-07 21:14:27 +02:00
|
|
|
|
|
|
|
assert (
|
|
|
|
module.extract_archive(
|
|
|
|
dry_run=False,
|
|
|
|
repository='repo',
|
|
|
|
archive='archive',
|
|
|
|
paths=None,
|
|
|
|
location_config={},
|
|
|
|
storage_config={},
|
2022-02-10 19:09:18 +01:00
|
|
|
local_borg_version='1.2.3',
|
2020-05-07 21:14:27 +02:00
|
|
|
extract_to_stdout=True,
|
|
|
|
)
|
|
|
|
== process
|
|
|
|
)
|
|
|
|
|
|
|
|
|
2019-11-12 20:47:24 +01:00
|
|
|
def test_extract_archive_skips_abspath_for_remote_repository():
|
|
|
|
flexmock(module.os.path).should_receive('abspath').never()
|
|
|
|
flexmock(module).should_receive('execute_command').with_args(
|
2020-05-15 07:38:38 +02:00
|
|
|
('borg', 'extract', 'server:repo::archive'), working_directory=None
|
2019-11-12 20:47:24 +01:00
|
|
|
).once()
|
2022-02-10 19:09:18 +01:00
|
|
|
flexmock(module.feature).should_receive('available').and_return(True)
|
2019-11-12 20:47:24 +01:00
|
|
|
|
|
|
|
module.extract_archive(
|
|
|
|
dry_run=False,
|
|
|
|
repository='server:repo',
|
|
|
|
archive='archive',
|
|
|
|
paths=None,
|
|
|
|
location_config={},
|
|
|
|
storage_config={},
|
2022-02-10 19:09:18 +01:00
|
|
|
local_borg_version='1.2.3',
|
2019-11-12 20:47:24 +01:00
|
|
|
)
|