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

Function _write_graph

tests/test_lookup_exit_codes.py:17–43  ·  view source on GitHub ↗
(tmp_path)

Source from the content-addressed store, hash-verified

15
16
17def _write_graph(tmp_path):
18 nodes = [
19 ("src_a_alphaclient", "AlphaClient", "src/a.ts", "L1"),
20 ("src_a_alphaclient_nonce", ".nonce()", "src/a.ts", "L2"),
21 ("src_b_betaclient", "BetaClient", "src/b.ts", "L1"),
22 ("src_b_betaclient_nonce", ".nonce()", "src/b.ts", "L2"),
23 ("src_c_run", "run()", "src/c.ts", "L1"),
24 ("src_d_island", "island()", "src/d.ts", "L1"),
25 ]
26 links = [
27 ("src_c_run", "src_b_betaclient", "calls"),
28 ("src_b_betaclient", "src_b_betaclient_nonce", "method"),
29 ("src_a_alphaclient", "src_a_alphaclient_nonce", "method"),
30 ]
31 p = tmp_path / "graph.json"
32 p.write_text(json.dumps({
33 "directed": False, "multigraph": False, "graph": {},
34 "nodes": [
35 {"id": i, "label": lbl, "source_file": sf, "source_location": loc}
36 for i, lbl, sf, loc in nodes
37 ],
38 "links": [
39 {"source": a, "target": b, "relation": rel, "confidence": "EXTRACTED"}
40 for a, b, rel in links
41 ],
42 }))
43 return p
44
45
46def _run(monkeypatch, capsys, *argv):

Calls

no outgoing calls

Tested by

no test coverage detected