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

Method test_clear

tests/test_request_cache.py:162–171  ·  view source on GitHub ↗

clear removes all cached entries

(self, cache: RequestCache)

Source from the content-addressed store, hash-verified

160 assert cache.is_pending("req-1") is True
161
162 def test_clear(self, cache: RequestCache) -> None:
163 """clear removes all cached entries"""
164 cache._cache["req-1"] = CacheEntry(response={"success": True})
165 cache._cache["req-2"] = CacheEntry(response={"success": True})
166 cache._pending_results["req-3"] = {"success": True}
167
168 cache.clear()
169
170 assert cache.size == 0
171 assert len(cache._pending_results) == 0
172
173 def test_size(self, cache: RequestCache) -> None:
174 """size returns number of cached entries"""

Callers

nothing calls this directly

Calls 2

CacheEntryClass · 0.90
clearMethod · 0.45

Tested by

no test coverage detected