test_root_uri_parsing_verifies_before_it_trusts¶
Tests › tests/test_mcp_server.py
What this test is for
Why it exists
A root is a client-supplied string that this server turns into a repo it will INDEX, so it fails closed on anything it cannot verify.
Verifies REQ-DDB-MCP-003 REQ-DDB-QUERY-006 REQ-DDB-QUERY-008 REQ-DDB-QUERY-009
tests/test_mcp_server.py:2839 · its file's page
What it checks (6)
assert st.root_uri_to_path(spaced.as_uri()) == spaced, "percent-encoding must round-trip"assert "%20" in spaced.as_uri(), "premise: the URI really is encoded"assert st.root_uri_to_path(plain_file.as_uri()) is None, "a file is not a repo root"assert st.root_uri_to_path((tmp_path / "absent").as_uri()) is Noneassert st.root_uri_to_path("https://example.invalid/repo") is None, "only file:// is local"assert st.root_uri_to_path("") is None
Where the product reaches it
index→_index_action→read_comments→ensure_target→_target_from_roots→root_uri_to_path(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 (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