(tmp_path)
| 22 | |
| 23 | |
| 24 | def test_persistence_roundtrip(tmp_path): |
| 25 | p = tmp_path / "graph.json" |
| 26 | g = KnowledgeGraph() |
| 27 | g.record_from_text("module main.ts has `Foo`", now=2.0) |
| 28 | g.save(p) |
| 29 | g2 = KnowledgeGraph.load(p) |
| 30 | assert g2.stats()["total"] == g.stats()["total"] |
| 31 | assert any(e.name == "main.ts" for e in g2.entities.values()) |
| 32 | |
| 33 | |
| 34 | def test_clear(): |
nothing calls this directly
no test coverage detected