test_no_convention_yields_an_empty_but_valid_draft_that_says_so¶
Tests › tests/test_propose.py
What this test is for
Why it exists
The failure to avoid is a draft that fills the silence with something plausible. With a real index to measure against and nothing to find, every section must report a MEASURED absence — `no_candidates`, with the counts that make it legible — and the document must contain no activatable YAML at all.
Given
root = _repo(tmp_path / "plain", _PLAIN_SOURCE)db = _index(tmp_path / "plain.db", "src/app.c", [(1, "helper", 1, 5), (2, "main_loop", 7, 10)])
When
proposal = propose(root, db)shared = _section(proposal, SECTION_SHARED_KEY)marked_lines(proposal.yaml_text)
2 more
uncomment(proposal.yaml_text)section_names()
Then
- ✓ shared.status is SectionStatus.NO_CANDIDATES
- ✓ shared.checked["families"] equals 0
- ✓ _section(proposal, SECTION_THREADS).status is SectionStatus.NO_CANDIDATES
- ✓ any(s.entries for s in proposal.sections) is false
- ✓ marked_lines(proposal.yaml_text) equals []
- ✓ uncomment(proposal.yaml_text).strip() equals ""
- ✓ proposal.yaml_text.count("STATUS:") equals len(section_names())
What it exercises
The parts of the system's flows this test ran, measured by per-test coverage: lit steps ran in this test, dimmed ones did not, and ▶ marks where the test called in. Each title opens the whole flow with these steps lit.
clew — `main` (clew/cli.py) · 84 of 400 steps
… 3 earlier steps
… 18 steps between
… 15 steps between
… 2 steps between
… 248 later steps
4 more
- thread `clew-first-build-` — `_first_build_worker` (clew/mcp_server/server.py) · 12 of 142 steps
- Build this wiki from the index · 8 of 400 steps
- Build, refresh and check the index · 2 of 153 steps
- `main` (clew/guard/main.py) · 2 of 357 steps
tests/test_propose.py:325 · its file's page
What it checks (7)
assert shared.status is SectionStatus.NO_CANDIDATES, shared.reasonobserves_sectionviasharedassert shared.checked["families"] == 0observes_sectionviasharedassert _section(proposal, SECTION_THREADS).status is SectionStatus.NO_CANDIDATESobserves_sectionassert not any(s.entries for s in proposal.sections)observesproposeviaproposalassert marked_lines(proposal.yaml_text) == [], "an empty draft must carry no YAML"observesmarked_linesassert uncomment(proposal.yaml_text).strip() == ""observesuncommentassert proposal.yaml_text.count("STATUS:") == len(section_names())observessection_names
Where the product reaches it
Call flow
test_no_convention_yields_an_empty_but_valid_draft_that_says_so→_repo→_index→propose→_section→marked_lines→uncomment→section_namesWhat 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 14 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-CONFIG-001 measured
- REQ-DDB-CONFIG-006 measured
- REQ-DDB-CONFIG-007 measured
- REQ-DDB-GUARD-012 inferred
- REQ-DDB-PIPE-003 measured
- REQ-DDB-PIPE-005 measured
- REQ-DDB-PIPE-010 measured
- REQ-DDB-PIPE-011 measured
- REQ-DDB-PIPE-012 inferred
- REQ-DDB-SCHEMA-002 measured
- REQ-DDB-SCHEMA-005 measured
- REQ-DDB-SCHEMA-007 measured
- REQ-DDB-SCHEMA-012 measured
- REQ-DDB-WIKI-054 inferred