mirror of
https://github.com/borgmatic-collective/borgmatic.git
synced 2026-07-29 21:03:02 +02:00
Additional test coverage (#966).
This commit is contained in:
@@ -33,6 +33,21 @@ def test_make_environment_with_passphrase_should_set_environment():
|
||||
assert environment.get('BORG_PASSPHRASE') == 'pass'
|
||||
|
||||
|
||||
def test_make_environment_with_credential_tag_passphrase_should_load_it_and_set_environment():
|
||||
flexmock(module.borgmatic.borg.passcommand).should_receive(
|
||||
'get_passphrase_from_passcommand'
|
||||
).and_return(None)
|
||||
flexmock(module.os).should_receive('pipe').never()
|
||||
flexmock(module.os.environ).should_receive('get').and_return(None)
|
||||
flexmock(module.borgmatic.hooks.credential.tag).should_receive('resolve_credential').with_args(
|
||||
'!credential systemd pass'
|
||||
).and_return('pass')
|
||||
|
||||
environment = module.make_environment({'encryption_passphrase': '!credential systemd pass'})
|
||||
|
||||
assert environment.get('BORG_PASSPHRASE') == 'pass'
|
||||
|
||||
|
||||
def test_make_environment_with_ssh_command_should_set_environment():
|
||||
flexmock(module.borgmatic.borg.passcommand).should_receive(
|
||||
'get_passphrase_from_passcommand'
|
||||
|
||||
Reference in New Issue
Block a user