test_every_accepted_option_can_actually_be_applied¶
Tests › tests/test_buildoptions.py
What this test is for
Why it exists
A key listed as accepted and then unhandled would raise "unknown" for a name this module itself advertises — the contradiction a reader has no way to diagnose. Driving the whole advertised set through the real function is the only check that cannot disagree with the advertisement.
Verifies REQ-DDB-CONFIG-008
Given
values: dict[str, object] = {name: ["X"] for name in bo.INLINE_LIST_OPTIONS}values["event_tags"] = {"emits": "producer"}
2 more
for key in (*bo.PATH_OPTIONS, *bo.MANIFEST_OPTIONS): values[key] = f"{key}.yaml"for key in bo.SECTION_DOCUMENT_OPTIONS: values[key] = {"predefined": ["X"]} if key == "preprocessor" else {"path": "Kconfig"}
When
list(bo.accepted_options())bo.accepted_options()repo_root = tmp_path
3 more
for key in bo.PATH_OPTIONS_MUST_EXIST: (repo_root / f"{key}.yaml").write_text("", encoding="utf-8")args = _args()bo.apply_options(args, values, repo_root)
Then
- ✓ sorted(values) equals list(bo.accepted_options())
- ✓ bo.apply_options(args, values, repo_root) equals list(bo.accepted_options())
tests/test_buildoptions.py:481 · its file's page
What it checks (2)
assert sorted(values) == list(bo.accepted_options()), "the advertised set must be complete"observeslistassert bo.apply_options(args, values, repo_root) == list(bo.accepted_options())observesapply_options
Where the product reaches it
dossier→subject_payload→_flatten_subject→list(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 (1)
| requirement | linked by | implementers exercised |
|---|---|---|
| REQ-DDB-CONFIG-008 | catalog | unknown |