mirror of
https://github.com/rommapp/romm.git
synced 2026-11-28 17:48:31 +01:00
14 lines
414 B
Python
14 lines
414 B
Python
from unittest.mock import AsyncMock
|
|
|
|
from utils.cache import VersionedCacheStore
|
|
|
|
|
|
def schema_stamp_get(*stores: VersionedCacheStore) -> AsyncMock:
|
|
"""Mock `async_cache.get` so the given stores read as currently stamped."""
|
|
stamps = {store.schema_key: str(store.version) for store in stores}
|
|
|
|
async def get(key: str) -> str | None:
|
|
return stamps.get(key)
|
|
|
|
return AsyncMock(side_effect=get)
|