MCPcopy Create free account
hub / github.com/Graphify-Labs/graphify / test_clear_cache_removes_deep_namespace

Function test_clear_cache_removes_deep_namespace

tests/test_cache.py:1285–1301  ·  view source on GitHub ↗

clear_cache sweeps cache/semantic-deep/ alongside semantic/ and ast/.

(tmp_path)

Source from the content-addressed store, hash-verified

1283
1284
1285def test_clear_cache_removes_deep_namespace(tmp_path):
1286 """clear_cache sweeps cache/semantic-deep/ alongside semantic/ and ast/."""
1287 from graphify.cache import save_semantic_cache
1288
1289 f = tmp_path / "doc.md"
1290 f.write_text("# Doc\n")
1291 save_semantic_cache([{"id": "p", "source_file": "doc.md"}], [], root=tmp_path)
1292 save_semantic_cache([{"id": "d", "source_file": "doc.md"}], [],
1293 root=tmp_path, mode="deep")
1294 base = tmp_path / "graphify-out" / "cache"
1295 assert list((base / "semantic").rglob("*.json"))
1296 assert list((base / "semantic-deep").rglob("*.json"))
1297
1298 clear_cache(tmp_path)
1299 assert not list(base.rglob("*.json")), (
1300 "clear_cache must remove entries in BOTH semantic namespaces"
1301 )
1302
1303
1304def test_cached_files_includes_deep_namespace(tmp_path):

Callers

nothing calls this directly

Calls 2

save_semantic_cacheFunction · 0.90
clear_cacheFunction · 0.90

Tested by

no test coverage detected