test_udm_default_is_unresolved_not_absent

Tests › tests/test_datamodel.py

passed Passed in the packaged run.

What this test is for

Why it exists

THE DISTINCTION THIS COLUMN EXISTS FOR, and all three states are in one assertion because separated they mislead. A UDM key's default is a base plus per-variant siblings that only a build's variant selection resolves, so no value is stored — but a key that declares NO default (280 of 1,606 in the measured corpus) must be distinguishable from one that declares several. `Uptime` is the empty case, and it is what makes this test fail against an implementation that simply marks every UDM key unresolved.

Given

  1. path = tmp_path / "widgetbus_001.yaml"
  2. path.write_text(UDM_MANIFEST, encoding="utf-8")
→

When

  1. keys = parse_udm_manifest(path, tmp_path)
  2. by_id = {k.key_id: k for k in keys}
  3. all(k.default_value is None and k.enum_name is None for k in keys)
→

Then

  1. ✓ keys is not None
  2. ✓ all(k.default_value is None and k.enum_name is None for k in keys) holds
  3. ✓ by_id["Sample of Rate"].unresolved_fields equals ("default_value",)
  4. ✓ by_id["Mode_Select"].unresolved_fields equals ("default_value", "enum_set")
  5. ✓ by_id["Uptime"].unresolved_fields equals ()

tests/test_datamodel.py:562 · its file's page

What it checks (5)

  1. assert keys is not None observes parse_udm_manifest via keys
  2. assert all(k.default_value is None and k.enum_name is None for k in keys) observes all
  3. assert by_id["Sample of Rate"].unresolved_fields == ("default_value",) not attributed
  4. assert by_id["Mode_Select"].unresolved_fields == ("default_value", "enum_set") not attributed
  5. assert by_id["Uptime"].unresolved_fields == () not attributed

Where the product reaches it

  • dossier → _rank_enum_over_mirror → _class_side_is_only_enum_mirrors → all (flow)

Call flow

test_udm_default_is_unresolved_not_absent→parse_udm_manifest→all

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_udm_default_is_unresolved_not_absent · 5 checksparse_udm_manifestrel_keyREQ-DDB-PIPE-003 · measuredparse_udm_manifestREQ-DDB-SCHEMA-013 · measuredallREQ-DDB-WIKI-054 · inferred
Also reaches 3 requirements

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