fix test part that only works with LocalCache

This commit is contained in:
Thomas Waldmann 2023-09-30 23:52:02 +02:00
parent 30f6f1a4c4
commit 8f2d41ab6c
No known key found for this signature in database
GPG Key ID: 243ACFA951F78E01
1 changed files with 3 additions and 1 deletions

View File

@ -277,6 +277,7 @@ def test_unknown_mandatory_feature_in_cache(archivers, request):
repository._location = Location(archiver.repository_location)
manifest = Manifest.load(repository, Manifest.NO_OPERATION_CHECK)
with Cache(repository, manifest) as cache:
is_localcache = isinstance(cache, LocalCache)
cache.begin_txn()
cache.cache_config.mandatory_features = {"unknown-feature"}
cache.commit()
@ -295,7 +296,8 @@ def test_unknown_mandatory_feature_in_cache(archivers, request):
with patch.object(LocalCache, "wipe_cache", wipe_wrapper):
cmd(archiver, "create", "test", "input")
assert called
if is_localcache:
assert called
with Repository(archiver.repository_path, exclusive=True) as repository:
if remote_repo: