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

Method test_get_cached_existing

tests/test_request_cache.py:131–138  ·  view source on GitHub ↗

get_cached returns cached entry if exists and not expired

(self, cache: RequestCache)

Source from the content-addressed store, hash-verified

129 assert call_count == 1 # Only called once
130
131 def test_get_cached_existing(self, cache: RequestCache) -> None:
132 """get_cached returns cached entry if exists and not expired"""
133 cache._cache["req-cached"] = CacheEntry(response={"success": True, "data": "cached"})
134
135 result = cache.get_cached("req-cached")
136
137 assert result is not None
138 assert result["data"] == "cached"
139
140 def test_get_cached_nonexistent(self, cache: RequestCache) -> None:
141 """get_cached returns None for nonexistent entries"""

Callers

nothing calls this directly

Calls 2

CacheEntryClass · 0.90
get_cachedMethod · 0.80

Tested by

no test coverage detected