test_active_db_without_target_raises¶
Tests › tests/test_mcp_server.py
What this test is for
Why it exists
Tier-1 tools bound to a server with no DEFAULT target fail loudly rather than reading a bogus path — and name both remedies.
Verifies REQ-DDB-MCP-003 REQ-DDB-QUERY-006 REQ-DDB-QUERY-008 REQ-DDB-QUERY-009
Given
_mcp, state = serverfor accessor in (state.active_db, state.active_repo): with pytest.raises(RuntimeError, match="No default target repository") as exc: accessor() assert "target=" in str(exc.value), "the per-call remedy must be offered" assert "--repo" in str(exc.value), "and so must the launch-time one" ## The message must not name the retired tool. An error instructing a model to ## call `set_target` would send it after a tool that does not exist. assert "set_target" not in str(exc.value)
When
- —
Then
- —
tests/test_mcp_server.py:1793 · its file's page
What it checks (3)
assert "target=" in str(exc.value), "the per-call remedy must be offered"not attributedassert "--repo" in str(exc.value), "and so must the launch-time one"not attributedassert "set_target" not in str(exc.value)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 1 requirement
Its run touches their code; that is reach, not proof.
- REQ-DDB-MCP-001 measured