(tmp_path: Path, files: dict[str, bytes])
| 140 | |
| 141 | |
| 142 | def _graph(tmp_path: Path, files: dict[str, bytes]): |
| 143 | for name, data in files.items(): |
| 144 | p = tmp_path / name |
| 145 | p.parent.mkdir(parents=True, exist_ok=True) |
| 146 | p.write_bytes(data) |
| 147 | old = os.getcwd() |
| 148 | try: |
| 149 | os.chdir(tmp_path) |
| 150 | r = extract([Path(n) for n in files], cache_root=tmp_path / ".cache") |
| 151 | finally: |
| 152 | os.chdir(old) |
| 153 | nodes = {(n["id"], n["label"]) for n in r["nodes"]} |
| 154 | edges = {(e["source"], e["target"], e["relation"]) for e in r["edges"]} |
| 155 | return nodes, edges |
| 156 | |
| 157 | |
| 158 | SOURCES = { |
no test coverage detected