test_a_client_advertising_no_roots_is_never_asked

Tests › tests/test_mcp_server.py

passed Passed in the packaged run.

What this test is for

Why it exists

Gated on `client_capabilities.roots`, so a client that does not offer the capability is not sent a request it would reject. The reply must still be the legible no-target error rather than a traceback.

Verifies REQ-DDB-QUERY-006 REQ-DDB-QUERY-008 REQ-DDB-QUERY-009

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 · 13 of 153 steps

… 4 earlier steps

callercallercallercallerclew/mcp_server/server.pyclew/mcp_server/server.pyclew/mcp_server/server.pyclew/mcp_server/server.pyclew/mcp_server/state.pyclew/mcp_server/state.pyclew/mcp_server/state.pyclew/mcp_server/state.pytry (line 2509)tryloop (line 2353)loopindex5–6. build_or_refresh → _build_subject5_build_subject +1 more7. ensure_target → _target_from_roots7_target_from_roots▶ test enters8–9. _target_from_roots → _roots8_roots +1 more10. _roots_askable → roots_request_supported10roots_request_supported11. roots_request_supported → server_request_surface11server_request_surface

… 2 steps between

callercallercallercallerclew/mcp_server/server.pyclew/mcp_server/server.pyclew/mcp_server/server.pyclew/mcp_server/server.pyclew/mcp_server/state.pyclew/mcp_server/state.pyclew/mcp_server/state.pyclew/mcp_server/state.pyclew/wiki/themes/clew/static/web.jsclew/wiki/themes/clew/static/web.jsclew/wiki/themes/clew/static/web.jsclew/wiki/themes/clew/static/web.jsclew/mcp_server/routing.pyclew/mcp_server/routing.pyclew/mcp_server/routing.pyclew/mcp_server/routing.pyloop (line 2353)loopindex14. list → link14link15. _target_from_roots → root_uri_to_path15root_uri_to_path16. ensure_target → adopt16adopt▶ test enters17. adopt → repo_indexes17repo_indexes18. repo_indexes → target_for18target_for

… 3 steps between

callercallercallercallerclew/mcp_server/server.pyclew/mcp_server/server.pyclew/mcp_server/server.pyclew/mcp_server/server.pyclew/mcp_server/state.pyclew/mcp_server/state.pyclew/mcp_server/state.pyclew/mcp_server/state.pyclew/wiki/themes/clew/static/web.jsclew/wiki/themes/clew/static/web.jsclew/wiki/themes/clew/static/web.jsclew/wiki/themes/clew/static/web.jsclew/mcp_server/freshness.pyclew/mcp_server/freshness.pyclew/mcp_server/freshness.pyclew/mcp_server/freshness.pyopt (line 2070)optloop (line 662)loopcatch (line 562)catchindex22. adopt → target_for22target_for23. adopt → _sync_tier123_sync_tier124. _sync_tier1 → register_query_tools24register_query_tools▶ test enters25–29. register_query_tools → _add_tool25_add_tool +4 more30. _answering_with_refresh → refused30refused31. _answering_with_refresh → _take_context31_take_context32. _take_context → list32list33. register_query_tools → list33list34. adopt → db_status34db_status35. db_status → _options_meta35_options_meta

… 118 later steps

1 more

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

What it checks (3)

  1. assert status["active"] is False
  2. assert status["error"] == NO_TARGET_ERROR
  3. assert ctx.session.roots_calls == 0, "an unadvertised capability must not be probed"

Where the product reaches it

Call flow

test_a_client_advertising_no_roots_is_never_asked→build_server

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.

test_a_client_advertising_no_roots_is_never_asked · 3 checksbuild_serverREQ-DDB-MCP-001 · measuredbuild_server_refusal_as_tool_errorREQ-DDB-MCP-004 · measuredbuild_server_register_promptsREQ-DDB-WIKI-034 · measured

Requirements it verifies (3)

requirementlinked byimplementers exercised
REQ-DDB-QUERY-006catalogunknown
REQ-DDB-QUERY-008catalogunknown
REQ-DDB-QUERY-009catalogunknown
Also reaches 6 requirements

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