MCPcopy Create free account
hub / github.com/bigdra50/unity-cli / test_cleanup_expired

Method test_cleanup_expired

tests/test_request_cache.py:191–202  ·  view source on GitHub ↗

_cleanup_expired removes expired entries

(self, cache: RequestCache)

Source from the content-addressed store, hash-verified

189
190 @pytest.mark.asyncio
191 async def test_cleanup_expired(self, cache: RequestCache) -> None:
192 """_cleanup_expired removes expired entries"""
193 # Add fresh entry
194 cache._cache["fresh"] = CacheEntry(response={"success": True})
195
196 # Add expired entry
197 cache._cache["expired"] = CacheEntry(response={"success": True}, created_at=time.time() - 120)
198
199 await cache._cleanup_expired()
200
201 assert "fresh" in cache._cache
202 assert "expired" not in cache._cache
203
204 @pytest.mark.asyncio
205 async def test_start_stop(self, cache: RequestCache) -> None:

Callers

nothing calls this directly

Calls 2

CacheEntryClass · 0.90
_cleanup_expiredMethod · 0.80

Tested by

no test coverage detected