test_repo_relative_when_the_script_lives_inside_the_repo

Tests › tests/test_init.py

passed Passed in the packaged run.

What this test is for

Why it exists

The developer-checkout case: `.venv/bin/clew-mcp` is real and usable but invisible to `which` unless the venv is activated. Relative keeps the committed config portable across clones of the same repo.

Verifies REQ-DDB-CLI-002

Given

  1. script = repo / ".venv" / "bin" / CONSOLE_SCRIPT
  2. script.parent.mkdir(parents=True)
  3. script.touch()
→

When

  1. resolution = resolve_server_command( repo, INIT_SCOPE_REPO, which=lambda _cmd: None, bindir=script.parent )
→

Then

  1. ✓ resolution.command equals f".venv/bin/{CONSOLE_SCRIPT}"
  2. ✓ resolution.portable holds

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.

clew — `main` (clew/cli.py) · 2 of 400 steps

… 166 earlier steps

command-line usercommand-line usercommand-line usercommand-line userclew/init_command.pyclew/init_command.pyclew/init_command.pyclew/init_command.pyother filesother filesother filesother filesmain167. diagnose → _check_server_command167_check_server_command168. _check_server_command → resolve_server_command168resolve_server_command169. resolve_server_command → _locate_script169_locate_script▶ test enters170. resolve_server_command → _repo_relative170_repo_relative171. resolve_server_command → _path_or_name171_path_or_name172. diagnose → _check_mcp_sdk172_check_mcp_sdk

… 228 later steps

tests/test_init.py:990 · its file's page

What it checks (2)

  1. assert resolution.command == f".venv/bin/{CONSOLE_SCRIPT}" observes resolve_server_command via resolution
  2. assert resolution.portable observes resolve_server_command via resolution

Where the product reaches it

  • main → init_main → _register → resolve_server_command (flow)

Call flow

test_repo_relative_when_the_script_lives_inside_the_repo→resolve_server_command

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.

test_repo_relative_when_the_script_lives_inside_the_repo · 2 checksresolve_server_commandREQ-DDB-MCP-001 · measured

Requirements it verifies (1)

requirementlinked byimplementers exercised
REQ-DDB-CLI-002catalogunknown
Also reaches 1 requirement

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