mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-08-01 16:58:06 +00:00
test: sync mock cache manager signature with CacheManager.get
test_circuit_breaker has been failing on main: plugin_health passes memory_ttl= to cache_manager.get(), and the conftest mock's signature was never updated — the same component/double drift class as the monitored_update bug (#392). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FqzC1nzTWL4kaqgMaQZFam
This commit is contained in:
+5
-1
@@ -38,7 +38,11 @@ def mock_cache_manager():
|
|||||||
mock._memory_cache_timestamps = {}
|
mock._memory_cache_timestamps = {}
|
||||||
mock.cache_dir = "/tmp/test_cache"
|
mock.cache_dir = "/tmp/test_cache"
|
||||||
|
|
||||||
def mock_get(key: str, max_age: int = 300) -> Optional[Dict]:
|
def mock_get(key: str, max_age: Optional[int] = 300,
|
||||||
|
memory_ttl: Optional[int] = None) -> Optional[Dict]:
|
||||||
|
# Signature mirrors CacheManager.get — keep in sync or callers
|
||||||
|
# passing keyword args (health tracker, resource monitor) break
|
||||||
|
# only in tests, hiding real-API compatibility.
|
||||||
return mock._memory_cache.get(key)
|
return mock._memory_cache.get(key)
|
||||||
|
|
||||||
def mock_set(key: str, data: Dict, ttl: Optional[int] = None) -> None:
|
def mock_set(key: str, data: Dict, ttl: Optional[int] = None) -> None:
|
||||||
|
|||||||
Reference in New Issue
Block a user