test_probed_module_name_is_derived_from_the_real_import

Tests › tests/test_mcp_server.py

passed Passed in the packaged run.

What this test is for

Why it exists

The doctor's probe target must come FROM the import, not from a literal beside it.

Verifies REQ-DDB-MCP-001 REQ-DDB-MCP-003 REQ-DDB-QUERY-006 REQ-DDB-QUERY-008 REQ-DDB-QUERY-009

Given

  1. —
→

When

  1. —
→

Then

  1. ✓ _sdk.Context.__module__.startswith(_sdk.MCP_SERVER_MODULE + ".") holds
  2. ✓ importlib.util.find_spec(_sdk.MCP_SERVER_MODULE) is not None

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

What it checks (2)

  1. assert _sdk.Context.__module__.startswith(_sdk.MCP_SERVER_MODULE + "."), ( "the probed module must be a package prefix of the module Context really came from" ) not attributed
  2. assert importlib.util.find_spec(_sdk.MCP_SERVER_MODULE) is not None, ( "the derived name must be importable — the doctor reports on this exact string" ) 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 (5)

requirementlinked byimplementers exercised
REQ-DDB-MCP-001catalogunknown
REQ-DDB-MCP-003catalogunknown
REQ-DDB-QUERY-006catalogunknown
REQ-DDB-QUERY-008catalogunknown
REQ-DDB-QUERY-009catalogunknown