(self, tmp_path)
| 925 | assert "[[concepts/transformer]]" in text |
| 926 | |
| 927 | def test_skips_already_linked(self, tmp_path): |
| 928 | wiki = tmp_path / "wiki" |
| 929 | summaries = wiki / "summaries" |
| 930 | summaries.mkdir(parents=True) |
| 931 | (summaries / "paper.md").write_text( |
| 932 | "---\nsources: [paper.pdf]\n---\n\n# Summary\n\nSee [[concepts/attention]].", |
| 933 | encoding="utf-8", |
| 934 | ) |
| 935 | _backlink_summary(wiki, "paper", ["attention", "transformer"]) |
| 936 | text = (summaries / "paper.md").read_text() |
| 937 | # attention already linked, should not duplicate |
| 938 | assert text.count("[[concepts/attention]]") == 1 |
| 939 | # transformer should be added |
| 940 | assert "[[concepts/transformer]]" in text |
| 941 | |
| 942 | def test_no_op_when_all_linked(self, tmp_path): |
| 943 | wiki = tmp_path / "wiki" |
nothing calls this directly
no test coverage detected