test_a_github_style_heading_anchor_resolves¶
Tests › tests/test_wiki_prose_copy.py
What this test is for
Why it exists
P6: OVERVIEW's `[Programmatic use](#programmatic-use)` and `GUARD.md#files-the-gate-skips` work on GitHub but MyST reported "target not found" / "local id not found" (and 7 more on sassafras-class): MyST makes heading anchors only when told to. A real render, judged by the warning MyST emits and by the cross-document link landing on the section.
Given
source, html = tmp_path / "src", tmp_path / "out" / "html"source.mkdir()
4 more
(source / "index.md").write_text( "# Top\n\n```{toctree}\nguard\n```\n\nSee [use](#programmatic-use) and " "[skips](guard.md#files-the-gate-skips).\n\n## Programmatic use\n\nText.\n", encoding="utf-8", )(source / "guard.md").write_text( "# Guard\n\n## Files the gate skips\n\nText.\n", encoding="utf-8" )_render(source, html, WikiConfig(), tmp_path)err = capfd.readouterr().err
When
- —
Then
- ✓ err does not contain "xref_missing"
- ✓ (html / "index.html").read_text( encoding="utf-8" ) contains 'href="guard.html#files-the-gate-skips"'
tests/test_wiki_prose_copy.py:49 · its file's page
What it checks (2)
assert "xref_missing" not in err, errnot attributedassert 'href="guard.html#files-the-gate-skips"' in (html / "index.html").read_text( encoding="utf-8" )not attributed
What it reaches
Each row runs from this test, through the calls it makes, to the code a requirement names. If that code breaks, the test's checks are what should catch it. Reaching is not proving: a check only proves what it observes. No mutation records were given, so these rows say what the test REACHES.
Also reaches 3 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-WIKI-011 measured
- REQ-DDB-WIKI-022 measured
- REQ-DDB-WIKI-025 measured