test_a_sourced_file_is_parsed_and_choices_group_their_members¶
Tests › tests/test_kconfig.py
What this test is for
Why it exists
`source "Kconfig.motor"` is where a single-file fixture would have passed while the real path was broken, so the two grouped variants live there.
Verifies REQ-DDB-PIPE-007 REQ-DDB-QUERY-006
Given
- —
When
model = load_kconfig(discover_kconfig(repo), repo)by_name = {sym.name: sym for sym in model.symbols}alpha, beta = by_name["WIDGET_MOTOR_ALPHA"], by_name["WIDGET_MOTOR_BETA"]
Then
- ✓ model.error equals ""
- ✓ {"WIDGET_MOTOR_ALPHA", "WIDGET_MOTOR_BETA", "WIDGET_LOG_LEVEL"} is at most set(by_name)
- ✓ alpha.choice_key is not None
- ✓ alpha.choice_key equals beta.choice_key
- ✓ by_name["WIDGET_LOG_LEVEL"].choice_key is None
- ✓ len(model.choices) equals 1
- ✓ model.choices[0].prompt equals "Motor variant"
tests/test_kconfig.py:196 · its file's page
What it checks (7)
assert model.error == "", model.errorobservesload_kconfigviamodelassert {"WIDGET_MOTOR_ALPHA", "WIDGET_MOTOR_BETA", "WIDGET_LOG_LEVEL"} <= set(by_name)not attributedassert alpha.choice_key is not Nonenot attributedassert alpha.choice_key == beta.choice_keynot attributedassert by_name["WIDGET_LOG_LEVEL"].choice_key is None, "an ungrouped symbol has no group"not attributedassert len(model.choices) == 1observesload_kconfigviamodelassert model.choices[0].prompt == "Motor variant"observesload_kconfigviamodel
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
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 (2)
| requirement | linked by | implementers exercised |
|---|---|---|
| REQ-DDB-PIPE-007 | catalog | unknown |
| REQ-DDB-QUERY-006 | catalog | unknown |
Also reaches 2 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-CONFIG-005 measured
- REQ-DDB-PIPE-014 measured