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:
parent
29201a0eb5
commit
e21343d2a8
1 changed files with 6 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue