Skip to content

Commit

Permalink
Fix ArchiverTestCaseBinary.test_init_refuse_to_overwrite_keyfile
Browse files Browse the repository at this point in the history
  • Loading branch information
hexagonrecursion committed Feb 5, 2022
1 parent b442eb4 commit 365c1c8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/borg/testsuite/archiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -2582,8 +2582,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.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.Error):
self.cmd(*arg)
with open(keyfile) as file:
after = file.read()
assert before == after
Expand Down

0 comments on commit 365c1c8

Please sign in to comment.