clear_cache sweeps cache/semantic-deep/ alongside semantic/ and ast/.
(tmp_path)
| 1283 | |
| 1284 | |
| 1285 | def 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 | |
| 1304 | def test_cached_files_includes_deep_namespace(tmp_path): |
nothing calls this directly
no test coverage detected