test_state_home_env_override¶
Tests › tests/test_mcp_server.py
What this test is for
Why it exists
The state root is env-overridable and XDG-aware — never a hardcoded machine path.
Verifies REQ-DDB-MCP-003 REQ-DDB-QUERY-006 REQ-DDB-QUERY-008 REQ-DDB-QUERY-009
Given
monkeypatch.setenv(st.STATE_HOME_ENV, str(tmp_path / "explicit"))
When
st.state_home()monkeypatch.delenv(st.STATE_HOME_ENV)monkeypatch.setenv("XDG_STATE_HOME", str(tmp_path / "xdg"))
Then
- ✓ st.state_home() equals tmp_path / "explicit"
- ✓ st.state_home() equals tmp_path / "xdg" / "clew"
tests/test_mcp_server.py:2069 · its file's page
What it checks (2)
assert st.state_home() == tmp_path / "explicit"observesstate_homeassert st.state_home() == tmp_path / "xdg" / "clew"observesstate_home
Where the product reaches it
main→query_main→_locate→target_for→state_home(flow)
Call flow
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