test_the_sdk_still_offers_the_deprecated_roots_route¶
Tests › tests/test_mcp_server.py
What this test is for
Why it exists
TRIPWIRE. Fails the day mcp removes `ServerSession.list_roots`, which is the day resolution link (3) stops existing.
Verifies REQ-DDB-MCP-001 REQ-DDB-MCP-003 REQ-DDB-QUERY-006 REQ-DDB-QUERY-008 REQ-DDB-QUERY-009
Given
- —
When
surface = st.server_request_surface()
Then
- ✓ callable(getattr(ServerSession, "list_roots", None)) holds
- ✓ getattr(ServerSession.list_roots, "__deprecated__", "") contains st.ROOTS_DEPRECATION_SEP
- ✓ issubclass(MCPDeprecationWarning, Warning) holds
- ✓ surface is not None
- ✓ any(method == st.TARGET_SOURCE_ROOTS for method, _version in surface) holds
tests/test_mcp_server.py:2713 · its file's page
What it checks (5)
assert callable(getattr(ServerSession, "list_roots", None)), ( "mcp removed ServerSession.list_roots — resolution link (3) is gone; " "delete the roots path rather than migrating it (there is no successor request)" )not attributedassert st.ROOTS_DEPRECATION_SEP in getattr(ServerSession.list_roots, "__deprecated__", ""), ( "the deprecation notice on list_roots changed shape; re-read it before trusting " f"{st.ROOTS_DEPRECATION_SEP} facts recorded in state.py" )not attributedassert issubclass(MCPDeprecationWarning, Warning), "the silenced category must stay a Warning"not attributedassert surface is not None, ( "the SDK's server-request map moved; roots_request_supported now fails open" )observesserver_request_surfaceviasurfaceassert any(method == st.TARGET_SOURCE_ROOTS for method, _version in surface), ( f"no protocol revision carries a standalone {st.TARGET_SOURCE_ROOTS} request any more" )observesserver_request_surfaceviasurface
Where the product reaches it
index→_index_action→read_comments→ensure_target→_target_from_roots→_roots→_roots_askable→roots_request_supported→server_request_surface(flow)
Call flow
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 | catalog | unknown |
| REQ-DDB-MCP-003 | catalog | unknown |
| REQ-DDB-QUERY-006 | catalog | unknown |
| REQ-DDB-QUERY-008 | catalog | unknown |
| REQ-DDB-QUERY-009 | catalog | unknown |