test_a_sub_index_name_that_matches_nothing_is_refused¶
Tests › tests/test_sub_index_refusal.py
What this test is for
Why it exists
THE REFUSAL NAMES THE ALTERNATIVES, because a caller who mistyped a name cannot discover the right one from anywhere else — gh#38 is the same gap seen from `targets`. A bare "unknown sub_index" would cost the round trip that the fifteen-minute build cost.
Given
repo = _split_repo(tmp_path / "repo")
When
bogus = target_for(repo, tmp_path / "state", name="no-such-tree")rejection = _sub_index_rejection(bogus, repo)for buildable in (FIRST_PARTY_INDEX, "deps-tinyfsm", "deps-libIoT"): assert buildable in rejection, f"the refusal must name {buildable!r} as an alternative"
Then
- ✓ rejection is not None
- ✓ rejection contains "no-such-tree"
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.
thread `clew-first-build-` — `_first_build_worker` (clew/mcp_server/server.py) · 45 of 142 steps
… 82 later steps
6 more
- Build, refresh and check the index · 45 of 153 steps
- clew — `main` (clew/cli.py) · 24 of 400 steps
- Build this wiki from the index · 2 of 400 steps
- `main` (clew/guard/main.py) · 2 of 357 steps
- clew-mcp — `main` (clew/mcp_server/server.py) · 2 of 17 steps
- `main` (scripts/incremental_probe.py) · 2 of 3 steps
tests/test_sub_index_refusal.py:62 · its file's page
What it checks (3)
assert rejection is not None, "a name matching no nested tree must be refused"observes_sub_index_rejectionviarejectionassert "no-such-tree" in rejection, "the refusal must quote the name that failed"observes_sub_index_rejectionviarejectionassert buildable in rejection, f"the refusal must name {buildable!r} as an alternative"observes_sub_index_rejectionviarejection
Where the product reaches it
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.
Also reaches 3 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-CONFIG-001 measured
- REQ-DDB-INDEX-002 measured
- REQ-DDB-MCP-001 measured