test_building_a_target_does_register_it¶
Tests › tests/test_mcp_server.py
What this test is for
Why it exists
THE POSITIVE HALF, and without it the fix above is satisfied by never registering at all — which would break `targets` and `cull` completely. Registration is EARNED by a build, because a build has to have somewhere to write.
Verifies REQ-DDB-MCP-001 REQ-DDB-MCP-003 REQ-DDB-QUERY-006 REQ-DDB-QUERY-008 REQ-DDB-QUERY-009
Given
reg = st.TargetRegistry(tmp_path / "state")repo = tmp_path / "real"
2 more
repo.mkdir()target = reg.register(str(repo))
When
- —
Then
- ✓ [t.repo_path for t in reg.targets()] equals [str(repo)]
- ✓ Path(target.db_path).parent.is_dir() holds
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) · 1 of 142 steps
… 32 earlier steps
… 105 later steps
4 more
- Build, refresh and check the index · 1 of 153 steps
- clew — `main` (clew/cli.py) · 1 of 400 steps
- clew-mcp — `main` (clew/mcp_server/server.py) · 1 of 17 steps
- `main` (scripts/incremental_probe.py) · 1 of 3 steps
tests/test_mcp_server.py:3445 · its file's page
What it checks (2)
assert [t.repo_path for t in reg.targets()] == [str(repo)], ( "a registered target must be listed — this is what `targets` and `cull` operate on" )not attributedassert Path(target.db_path).parent.is_dir(), "a build needs its directory to exist"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.
Requirements it verifies (5)
| requirement | linked by | implementers exercised |
|---|---|---|
| REQ-DDB-MCP-001 | tag | 5 of 56: load, register, save, target_for and 1 more |
| REQ-DDB-MCP-003 | catalog | unknown |
| REQ-DDB-QUERY-006 | catalog | unknown |
| REQ-DDB-QUERY-008 | catalog | unknown |
| REQ-DDB-QUERY-009 | catalog | unknown |