Test LRU eviction when cache is full.
(self)
| 84 | assert cache.duplicate_count == 0 |
| 85 | |
| 86 | def test_eviction(self): |
| 87 | """Test LRU eviction when cache is full.""" |
| 88 | cache = ResultCache(max_size=3) |
| 89 | cache.put("tool1", {"x": 1}, 1) |
| 90 | cache.put("tool2", {"x": 2}, 2) |
| 91 | cache.put("tool3", {"x": 3}, 3) |
| 92 | cache.put("tool4", {"x": 4}, 4) |
| 93 | |
| 94 | # First entry should be evicted |
| 95 | assert cache.get("tool1", {"x": 1}) is None |
| 96 | assert cache.get("tool4", {"x": 4}) is not None |
| 97 | |
| 98 | def test_get_stats(self, cache): |
| 99 | """Test get_stats returns correct info.""" |