test_active_db_without_target_raises

Tests › tests/test_mcp_server.py

passed Passed in the packaged run.

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

  1. _mcp, state = server
  2. for 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

  1. —
→

Then

  1. —

tests/test_mcp_server.py:1793 · its file's page

What it checks (3)

  1. assert "target=" in str(exc.value), "the per-call remedy must be offered" not attributed
  2. assert "--repo" in str(exc.value), "and so must the launch-time one" not attributed
  3. assert "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)

requirementlinked byimplementers exercised
REQ-DDB-MCP-003catalogunknown
REQ-DDB-QUERY-006catalogunknown
REQ-DDB-QUERY-008catalogunknown
REQ-DDB-QUERY-009catalogunknown
Also reaches 1 requirement

Its run touches their code; that is reach, not proof.