mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-08-01 08:48:05 +00:00
fix(testing): clear get_cached_data_with_strategy_calls in MockCacheManager.reset()
reset() cleared get_calls/set_calls/delete_calls but not the newer get_cached_data_with_strategy_calls tracker, so a reused mock (e.g. across test cases sharing a fixture) retained stale strategy-call records after reset(). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KEZK1P1Q1fu5pcuVrkrCFZ
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
ee5df2a321
commit
131a913017
@@ -137,6 +137,7 @@ class MockCacheManager:
|
||||
self.get_calls = []
|
||||
self.set_calls = []
|
||||
self.delete_calls = []
|
||||
self.get_cached_data_with_strategy_calls = []
|
||||
|
||||
|
||||
class MockConfigManager:
|
||||
|
||||
@@ -37,3 +37,9 @@ class TestMockCacheManagerStrategyMethod:
|
||||
cm = MockCacheManager()
|
||||
cm.save_cache("standings_nfl", {"teams": ["KC", "BUF"]})
|
||||
assert cm.get_cached_data_with_strategy("standings_nfl") == {"teams": ["KC", "BUF"]}
|
||||
|
||||
def test_reset_clears_strategy_call_tracking(self):
|
||||
cm = MockCacheManager()
|
||||
cm.get_cached_data_with_strategy("k", "sports_live")
|
||||
cm.reset()
|
||||
assert cm.get_cached_data_with_strategy_calls == []
|
||||
|
||||
Reference in New Issue
Block a user