MCPcopy Index your code
hub / github.com/SourceCode-AI/aura / test_cache_purge

Function test_cache_purge

tests/test_cache.py:164–173  ·  view source on GitHub ↗
(tmock, threshold, tmp_path, fixtures, mock_cache)

Source from the content-addressed store, hash-verified

162@mock.patch("aura.cache.get_cache_threshold")
163@pytest.mark.parametrize("threshold", (0, 10))
164def test_cache_purge(tmock, threshold, tmp_path, fixtures, mock_cache):
165 tmock.return_value = threshold
166
167 for k, v in CACHE_ENTRIES.items():
168 create_cache_entry(k, v, fixtures=fixtures)
169
170 items = list(cache.CacheItem.analyze())
171 cache.CacheItem.cleanup(items=items)
172 total = sum(x.size for x in items if not x._deleted)
173 assert total <= threshold
174
175
176@mock.patch("aura.cache.CacheItem.cleanup")

Callers

nothing calls this directly

Calls 3

create_cache_entryFunction · 0.85
analyzeMethod · 0.45
cleanupMethod · 0.45

Tested by

no test coverage detected