(tmp_path)
| 17 | |
| 18 | |
| 19 | def _write_graph(tmp_path): |
| 20 | g = nx.DiGraph() |
| 21 | # A high-degree real entity (not a file/concept node): label != basename. |
| 22 | g.add_node("hub", label="Auth", file_type="code", source_file="auth.py", source_location="L1") |
| 23 | g.add_node("f", label="auth.py", file_type="code", source_file="auth.py", source_location=None) |
| 24 | for i in range(4): |
| 25 | g.add_node(f"caller{i}", label=f"c{i}()", file_type="code", source_file=f"m{i}.py", source_location="L1") |
| 26 | g.add_edge(f"caller{i}", "hub", relation="calls", confidence="EXTRACTED") |
| 27 | g.add_edge("f", "hub", relation="contains", confidence="EXTRACTED") |
| 28 | gp = tmp_path / "graph.json" |
| 29 | gp.write_text(json.dumps(json_graph.node_link_data(g, edges="links")), encoding="utf-8") |
| 30 | return gp |
| 31 | |
| 32 | |
| 33 | def _run(monkeypatch, argv): |
no test coverage detected