test_registry_roundtrip_and_drop

Tests › tests/test_mcp_server.py

passed Passed in the packaged run.

What this test is for

Why it exists

Registration persists, and drop removes both the entry and the db dir.

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

Given

  1. home = tmp_path / "state"
  2. reg = st.TargetRegistry(home)
4 more
  1. repo = tmp_path / "repo"
  2. repo.mkdir()
  3. target = reg.register(repo)
  4. Path(target.db_path).write_text("db")
→

When

  1. —
→

Then

  1. ✓ [t.repo_path for t in st.TargetRegistry(home).targets()] equals [target.repo_path]
  2. ✓ reg.drop(target.repo_path) is True
  3. ✓ reg.targets() equals []
  4. ✓ Path(target.db_path).parent.exists() is false
  5. ✓ reg.drop(target.repo_path) is False

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.

thread `clew-first-build-` — `_first_build_worker` (clew/mcp_server/server.py) · 1 of 142 steps

… 32 earlier steps

thread startthread startthread startthread startclew/mcp_server/server.pyclew/mcp_server/server.pyclew/mcp_server/server.pyclew/mcp_server/server.pyclew/scope.pyclew/scope.pyclew/scope.pyclew/scope.pyclew/mcp_server/state.pyclew/mcp_server/state.pyclew/mcp_server/state.pyclew/mcp_server/state.pytry (line 1664)tryopt (line 1666)optopt (line 352)opt_first_build_worker33. _first_build_worker → target_for33target_for34. target_for → _safe_index_name34_safe_index_name35. target_for → state_home35state_home▶ test enters36. _first_build_worker → _run_build36_run_build37. _run_build → nested_tree_cache37nested_tree_cache

… 105 later steps

4 more

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

What it checks (5)

  1. assert [t.repo_path for t in st.TargetRegistry(home).targets()] == [target.repo_path] not attributed
  2. assert reg.drop(target.repo_path) is True not attributed
  3. assert reg.targets() == [] not attributed
  4. assert not Path(target.db_path).parent.exists() not attributed
  5. assert reg.drop(target.repo_path) is False 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-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.