mirror of
https://github.com/hoshikawa2/agent_platform_oci.git
synced 2026-07-09 22:04:21 +00:00
First commit
This commit is contained in:
12
tests/unit/test_cache_distributed.py
Normal file
12
tests/unit/test_cache_distributed.py
Normal file
@@ -0,0 +1,12 @@
|
||||
import pytest
|
||||
from agent_framework.cache.cache import DistributedCache, InMemoryCache
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_distributed_cache_populates_l1_from_l2():
|
||||
l1 = InMemoryCache(); l2 = InMemoryCache()
|
||||
await l2.set("k", {"v": 1})
|
||||
cache = DistributedCache(l1, l2)
|
||||
assert await cache.get("k") == {"v": 1}
|
||||
await l2.delete("k")
|
||||
assert await cache.get("k") == {"v": 1}
|
||||
Reference in New Issue
Block a user