borgmatic/tests/unit/actions/test_export_key.py
Dan Helfman 6dca7c1c15
All checks were successful
continuous-integration/drone/push Build is passing
Add "key export" action to export a copy of the repository key (#345).
2023-08-07 12:28:39 -07:00

21 lines
670 B
Python

from flexmock import flexmock
from borgmatic.actions import export_key as module
def test_run_export_key_does_not_raise():
flexmock(module.logger).answer = lambda message: None
flexmock(module.borgmatic.config.validate).should_receive('repositories_match').and_return(True)
flexmock(module.borgmatic.borg.export_key).should_receive('export_key')
export_arguments = flexmock(repository=flexmock())
module.run_export_key(
repository={'path': 'repo'},
config={},
local_borg_version=None,
export_arguments=export_arguments,
global_arguments=flexmock(),
local_path=None,
remote_path=None,
)