test_activate_tier1_notifies_tool_list_changed

Tests › tests/test_mcp_server.py

passed Passed in the packaged run.

What this test is for

Why it exists

Activation registers the tools AND fires tools/list_changed exactly once (asserted through the fake session, never a live transport).

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

Given

  1. mcp, state = server
  2. ctx = _FakeCtx()
  3. names = await state._activate_tier1(ctx)
→

When

  1. —
→

Then

  1. ✓ set(names) equals set(TIER1_TOOLS)
  2. ✓ state.tier1_active is True
  3. ✓ ctx.session.notifications equals 1
  4. ✓ set(TIER1_TOOLS) is at most await _names(mcp)

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

… 22 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.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.pyloop (line 662)loopcatch (line 562)catchindex23–24. adopt → _sync_tier123_sync_tier1 +1 more25–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

… 104 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.pyopt (line 2549)optopt (line 3032)optindex140–141. build_or_refresh → adopt140adopt +1 more142. _activate_tier1 → register_query_tools142register_query_tools▶ test enters143. build_or_refresh → db_status143db_status144. _index_action → read_comments144read_comments

… 9 later steps

1 more

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

What it checks (4)

  1. assert set(names) == set(TIER1_TOOLS) not attributed
  2. assert state.tier1_active is True not attributed
  3. assert ctx.session.notifications == 1 not attributed
  4. assert set(TIER1_TOOLS) <= await _names(mcp) 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 (4)

requirementlinked byimplementers exercised
REQ-DDB-MCP-001catalogunknown
REQ-DDB-QUERY-006catalogunknown
REQ-DDB-QUERY-008catalogunknown
REQ-DDB-QUERY-009catalogunknown
Also reaches 3 requirements

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