mirror of
https://git.selfprivacy.org/SelfPrivacy/selfprivacy-rest-api.git
synced 2025-03-11 17:13:49 +00:00
test(backups):check that snapshot cache invalidation invalidates both ways.
This commit is contained in:
parent
c5b7ca7565
commit
e9bb6d9973
1 changed files with 28 additions and 0 deletions
|
@ -552,6 +552,34 @@ def test_snapshots_caching(backups, dummy_service):
|
||||||
assert len(cached_snapshots) == 1
|
assert len(cached_snapshots) == 1
|
||||||
|
|
||||||
|
|
||||||
|
def lowlevel_forget(snapshot_id):
|
||||||
|
Backups.provider().backupper.forget_snapshot(snapshot_id)
|
||||||
|
|
||||||
|
|
||||||
|
# Storage
|
||||||
|
def test_snapshots_cache_invalidation(backups, dummy_service):
|
||||||
|
Backups.back_up(dummy_service)
|
||||||
|
cached_snapshots = Storage.get_cached_snapshots()
|
||||||
|
assert len(cached_snapshots) == 1
|
||||||
|
|
||||||
|
Storage.invalidate_snapshot_storage()
|
||||||
|
cached_snapshots = Storage.get_cached_snapshots()
|
||||||
|
assert len(cached_snapshots) == 0
|
||||||
|
|
||||||
|
Backups.force_snapshot_cache_reload()
|
||||||
|
cached_snapshots = Storage.get_cached_snapshots()
|
||||||
|
assert len(cached_snapshots) == 1
|
||||||
|
snap = cached_snapshots[0]
|
||||||
|
|
||||||
|
lowlevel_forget(snap.id)
|
||||||
|
cached_snapshots = Storage.get_cached_snapshots()
|
||||||
|
assert len(cached_snapshots) == 1
|
||||||
|
|
||||||
|
Backups.force_snapshot_cache_reload()
|
||||||
|
cached_snapshots = Storage.get_cached_snapshots()
|
||||||
|
assert len(cached_snapshots) == 0
|
||||||
|
|
||||||
|
|
||||||
# Storage
|
# Storage
|
||||||
def test_init_tracking_caching(backups, raw_dummy_service):
|
def test_init_tracking_caching(backups, raw_dummy_service):
|
||||||
assert Storage.has_init_mark() is False
|
assert Storage.has_init_mark() is False
|
||||||
|
|
Loading…
Add table
Reference in a new issue