(tmp_path, files: dict[str, str])
| 17 | |
| 18 | |
| 19 | def _extract(tmp_path, files: dict[str, str]): |
| 20 | for name, body in files.items(): |
| 21 | p = tmp_path / name |
| 22 | p.parent.mkdir(parents=True, exist_ok=True) |
| 23 | p.write_text(body) |
| 24 | old = os.getcwd() |
| 25 | try: |
| 26 | os.chdir(tmp_path) |
| 27 | r = extract([Path(n) for n in files], cache_root=Path(tempfile.mkdtemp())) |
| 28 | finally: |
| 29 | os.chdir(old) |
| 30 | case_of = {(e["source"], e["target"]) for e in r["edges"] if e["relation"] == "case_of"} |
| 31 | return case_of, r |
| 32 | |
| 33 | |
| 34 | def _find(r, label): |
no test coverage detected