mirror of
https://github.com/borgbackup/borg.git
synced 2026-06-13 10:50:21 -04:00
improve/clarify strange test code, fixes #6070
This commit is contained in:
parent
01b921dea4
commit
25d6649bcd
1 changed files with 3 additions and 7 deletions
|
|
@ -1854,15 +1854,11 @@ class ArchiverTestCase(ArchiverTestCaseBase):
|
|||
|
||||
@pytest.mark.allow_cache_wipe
|
||||
def test_unknown_mandatory_feature_in_cache(self):
|
||||
if self.prefix:
|
||||
path_prefix = 'ssh://__testsuite__'
|
||||
else:
|
||||
path_prefix = ''
|
||||
|
||||
remote_repo = bool(self.prefix)
|
||||
print(self.cmd('init', '--encryption=repokey', self.repository_location))
|
||||
|
||||
with Repository(self.repository_path, exclusive=True) as repository:
|
||||
if path_prefix:
|
||||
if remote_repo:
|
||||
repository._location = Location(self.repository_location)
|
||||
manifest, key = Manifest.load(repository, Manifest.NO_OPERATION_CHECK)
|
||||
with Cache(repository, key, manifest) as cache:
|
||||
|
|
@ -1887,7 +1883,7 @@ class ArchiverTestCase(ArchiverTestCaseBase):
|
|||
assert called
|
||||
|
||||
with Repository(self.repository_path, exclusive=True) as repository:
|
||||
if path_prefix:
|
||||
if remote_repo:
|
||||
repository._location = Location(self.repository_location)
|
||||
manifest, key = Manifest.load(repository, Manifest.NO_OPERATION_CHECK)
|
||||
with Cache(repository, key, manifest) as cache:
|
||||
|
|
|
|||
Loading…
Reference in a new issue