test_build_or_refresh_without_target_is_an_error¶
Tests › tests/test_mcp_server.py
What this test is for
Why it exists
build_or_refresh reports (never raises) when no source supplied a target, and does not register tier-1.
Verifies REQ-DDB-MCP-003 REQ-DDB-QUERY-006 REQ-DDB-QUERY-008 REQ-DDB-QUERY-009
Given
mcp, state = serverresult = await state.build_or_refresh(_FakeCtx())for source in ("--repo", "CLAUDE_PROJECT_DIR", "roots/list"): assert source in result["error"], f"the error must name the {source} source"
When
- —
Then
- ✓ result["ok"] is False
- ✓ result["error"] equals NO_TARGET_ERROR
- ✓ result["error"] does not contain "set_target"
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.
Build, refresh and check the index · 6 of 153 steps
… 2 earlier steps
… 2 steps between
… 135 later steps
tests/test_mcp_server.py:623 · its file's page
What it checks (4)
assert result["ok"] is Falsenot attributedassert result["error"] == NO_TARGET_ERRORnot attributedassert "set_target" not in result["error"]not attributedassert source in result["error"], f"the error must name the {source} source"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 (4)
| requirement | linked by | implementers exercised |
|---|---|---|
| REQ-DDB-MCP-003 | catalog | unknown |
| REQ-DDB-QUERY-006 | catalog | unknown |
| REQ-DDB-QUERY-008 | catalog | unknown |
| REQ-DDB-QUERY-009 | catalog | unknown |
Also reaches 5 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-CONFIG-001 measured
- REQ-DDB-CONFIG-008 measured
- REQ-DDB-MCP-001 measured
- REQ-DDB-MCP-002 measured
- REQ-DDB-MCP-004 measured