test_a_sourced_file_is_parsed_and_choices_group_their_members

Tests › tests/test_kconfig.py

passed Passed in the packaged run.

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

  1. —
→

When

  1. model = load_kconfig(discover_kconfig(repo), repo)
  2. by_name = {sym.name: sym for sym in model.symbols}
  3. alpha, beta = by_name["WIDGET_MOTOR_ALPHA"], by_name["WIDGET_MOTOR_BETA"]
→

Then

  1. ✓ model.error equals ""
  2. ✓ {"WIDGET_MOTOR_ALPHA", "WIDGET_MOTOR_BETA", "WIDGET_LOG_LEVEL"} is at most set(by_name)
  3. ✓ alpha.choice_key is not None
  4. ✓ alpha.choice_key equals beta.choice_key
  5. ✓ by_name["WIDGET_LOG_LEVEL"].choice_key is None
  6. ✓ len(model.choices) equals 1
  7. ✓ model.choices[0].prompt equals "Motor variant"

tests/test_kconfig.py:196 · its file's page

What it checks (7)

  1. assert model.error == "", model.error observes load_kconfig via model
  2. assert {"WIDGET_MOTOR_ALPHA", "WIDGET_MOTOR_BETA", "WIDGET_LOG_LEVEL"} <= set(by_name) not attributed
  3. assert alpha.choice_key is not None not attributed
  4. assert alpha.choice_key == beta.choice_key not attributed
  5. assert by_name["WIDGET_LOG_LEVEL"].choice_key is None, "an ungrouped symbol has no group" not attributed
  6. assert len(model.choices) == 1 observes load_kconfig via model
  7. assert model.choices[0].prompt == "Motor variant" observes load_kconfig via model

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_a_sourced_file_is_parsed_and_choices_group_their_members→load_kconfig→discover_kconfig

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_a_sourced_file_is_parsed_and_choices_group_their_members · 7 checksdiscover_kconfigREQ-DDB-CONFIG-005 · measuredload_kconfig_served_parse_errorREQ-DDB-PIPE-014 · measured

Requirements it verifies (2)

requirementlinked byimplementers exercised
REQ-DDB-PIPE-007catalogunknown
REQ-DDB-QUERY-006catalogunknown
Also reaches 2 requirements

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