test_registry_roundtrip_and_drop¶
Tests › tests/test_mcp_server.py
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
home = tmp_path / "state"reg = st.TargetRegistry(home)
4 more
repo = tmp_path / "repo"repo.mkdir()target = reg.register(repo)Path(target.db_path).write_text("db")
When
- —
Then
- ✓ [t.repo_path for t in st.TargetRegistry(home).targets()] equals [target.repo_path]
- ✓ reg.drop(target.repo_path) is True
- ✓ reg.targets() equals []
- ✓ Path(target.db_path).parent.exists() is false
- ✓ 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
… 105 later steps
4 more
- Build, refresh and check the index · 1 of 153 steps
- clew — `main` (clew/cli.py) · 1 of 400 steps
- clew-mcp — `main` (clew/mcp_server/server.py) · 1 of 17 steps
- `main` (scripts/incremental_probe.py) · 1 of 3 steps
tests/test_mcp_server.py:2093 · its file's page
What it checks (5)
assert [t.repo_path for t in st.TargetRegistry(home).targets()] == [target.repo_path]not attributedassert reg.drop(target.repo_path) is Truenot attributedassert reg.targets() == []not attributedassert not Path(target.db_path).parent.exists()not attributedassert reg.drop(target.repo_path) is Falsenot 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)
| 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