_cleanup_expired removes expired entries
(self, cache: RequestCache)
| 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: |
nothing calls this directly
no test coverage detected