()
| 21 | assert out.exists() |
| 22 | |
| 23 | def test_to_json_valid_json(): |
| 24 | G = make_graph() |
| 25 | communities = cluster(G) |
| 26 | with tempfile.TemporaryDirectory() as tmp: |
| 27 | out = Path(tmp) / "graph.json" |
| 28 | to_json(G, communities, str(out)) |
| 29 | data = json.loads(out.read_text()) |
| 30 | assert "nodes" in data |
| 31 | assert "links" in data |
| 32 | |
| 33 | |
| 34 | def test_to_json_includes_graph_schema_metadata(tmp_path): |
nothing calls this directly
no test coverage detected