test(backups): test that we do use cache

This commit is contained in:
Houkime 2023-04-07 18:12:05 +00:00
parent 5ad9f50b94
commit f25e57c51a

View file

@ -192,6 +192,17 @@ def test_redis_storage(backups_backblaze):
assert restored_provider.key == "KEY"
def test_snapshots_caching(backups, dummy_service):
Backups.back_up(dummy_service)
# we test indirectly that we do redis calls instead of shell calls
start = datetime.now()
for i in range(10):
snapshots = Backups.get_snapshots(dummy_service)
assert len(snapshots) == 1
assert datetime.now() - start < timedelta(seconds=0.5)
# lowlevel
def test_init_tracking_caching(backups, raw_dummy_service):
assert Backups._has_redis_init_mark(raw_dummy_service) is False