test_discover_doxyfile_refuses_to_guess_among_strays¶
Tests › tests/test_build_docs_db.py
What this test is for
Why it exists
#55, found by dogfooding clew on itself. discover_doxyfile used to fall back to sorted(repo.glob("*/Doxyfile"))[0] — ANY subdirectory, picked alphabetically. On clew that selected sample/Doxyfile, the demobot TEST FIXTURE, to index the whole project, and ran doxygen with cwd=sample/.
Verifies REQ-DDB-PIPE-001 REQ-DDB-PIPE-010
Given
repo = tmp_path / "repo"(repo / "sample").mkdir(parents=True)(repo / "sample" / "Doxyfile").write_text("PROJECT_NAME = fixture\n")
When
discover_doxyfile(repo)(repo / "docs").mkdir()(repo / "docs" / "Doxyfile").write_text("PROJECT_NAME = real\n")(repo / "Doxyfile").write_text("PROJECT_NAME = root\n")
Then
- ✓ discover_doxyfile(repo) is None
- ✓ discover_doxyfile(repo) equals repo / "docs" / "Doxyfile"
- ✓ discover_doxyfile(repo) equals repo / "Doxyfile"
tests/test_build_docs_db.py:2047 · its file's page
What it checks (3)
assert discover_doxyfile(repo) is None, "a fixture Doxyfile must not be adopted"observesdiscover_doxyfileassert discover_doxyfile(repo) == repo / "docs" / "Doxyfile"observesdiscover_doxyfileassert discover_doxyfile(repo) == repo / "Doxyfile"observesdiscover_doxyfile
Where the product reaches it
main→init_main→diagnose→_check_indexable→discover_doxyfile(flow)
Call flow
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.
Requirements it verifies (2)
| requirement | linked by | implementers exercised |
|---|---|---|
| REQ-DDB-PIPE-001 | catalog | unknown |
| REQ-DDB-PIPE-010 | catalog | unknown |
Also reaches 1 requirement
Its run touches their code; that is reach, not proof.
- REQ-DDB-INDEX-001 measured