test_scope_derived_roots_are_not_subject_to_the_guard¶
Tests › tests/test_extra_input_patterns.py
What this test is for
Why it exists
`_apply_scope` PREPENDS the derived scope roots — and on the whole-repo fallback the repo root itself — into the same `args.extra_input` list the user's entries live in. Judging the mutated list would refuse builds over roots the user never named, so the guard must run against the user's own entries only.
Given
doxyfile = _doxyfile(tmp_path, "FILE_PATTERNS = *.h")_write(tmp_path / "library" / "aes.c")args = argparse.Namespace( doxyfile=str(doxyfile), repo_root=str(tmp_path), ## from-guard, not doxyfile: gh#333 made this the default and removed the ## `index_whole_repo` back door that used to reach the same scope from the ## narrow setting — two paths to one scope being two things that can disagree. scope=cli.SCOPE_FROM_GUARD, guard_config=None, extra_input=None, extra_exclude=None, )
When
cli._apply_scope(args, tmp_path)cli._verify_extra_input_is_read(doxyfile, None, None, tmp_path)
Then
- ✓ args.extra_input equals [str(tmp_path)]
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) · 24 of 400 steps
… 10 earlier steps
… 26 steps between
… 329 later steps
4 more
- thread `clew-first-build-` — `_first_build_worker` (clew/mcp_server/server.py) · 23 of 142 steps
- Build, refresh and check the index · 20 of 153 steps
- Build this wiki from the index · 3 of 400 steps
- `main` (clew/guard/main.py) · 2 of 357 steps
tests/test_extra_input_patterns.py:279 · its file's page
What it checks (1)
assert args.extra_input == [str(tmp_path)], "the resolved scope injects the repo root"not attributed
Where the product reaches it
No product flow reaches this code: no product entry point's flow calls any of the functions this test calls.
Call flow
test_scope_derived_roots_are_not_subject_to_the_guard→_doxyfile→_write→_apply_scope→_verify_extra_input_is_readWhat 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.
Also reaches 4 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-CONFIG-001 measured
- REQ-DDB-GUARD-012 inferred
- REQ-DDB-INDEX-001 measured
- REQ-DDB-WIKI-054 inferred