1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2025-02-21 13:47:16 +00:00

Fix ArchiverTestCaseBinary.test_init_refuse_to_overwrite_keyfile

This commit is contained in:
Andrey Bienkowski 2022-02-05 22:18:52 +03:00
parent 29201a0eb5
commit e21343d2a8

View file

@ -2874,8 +2874,12 @@ def test_init_refuse_to_overwrite_keyfile(self):
self.cmd('init', '--encryption=keyfile', self.repository_location + '0')
with open(keyfile) as file:
before = file.read()
with pytest.raises(borg.helpers.errors.Error):
self.cmd('init', '--encryption=keyfile', self.repository_location + '1')
arg = ('init', '--encryption=keyfile', self.repository_location + '1')
if self.FORK_DEFAULT:
self.cmd(*arg, exit_code=2)
else:
with pytest.raises(borg.helpers.errors.Error):
self.cmd(*arg)
with open(keyfile) as file:
after = file.read()
assert before == after