test_root_uri_parsing_verifies_before_it_trusts

Tests › tests/test_mcp_server.py

passed Passed in the packaged run.

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)

  1. assert st.root_uri_to_path(spaced.as_uri()) == spaced, "percent-encoding must round-trip"
  2. assert "%20" in spaced.as_uri(), "premise: the URI really is encoded"
  3. assert st.root_uri_to_path(plain_file.as_uri()) is None, "a file is not a repo root"
  4. assert st.root_uri_to_path((tmp_path / "absent").as_uri()) is None
  5. assert st.root_uri_to_path("https://example.invalid/repo") is None, "only file:// is local"
  6. 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

test_root_uri_parsing_verifies_before_it_trusts→root_uri_to_path

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_root_uri_parsing_verifies_before_it_trusts · 6 checksroot_uri_to_pathREQ-DDB-MCP-001 · measured

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.