test_udm_manifest_is_parsed

Tests › tests/test_datamodel.py

passed Passed in the packaged run.

What this test is for

Why it exists

EVERY FIELD NAME HERE DIFFERS FROM THE OTHER DIALECT'S, which is the whole argument for a second parser: `namespace` not `meta.id`, `name` not `id`, `data` not `keys`, and the type one level down at `type.mem` rather than a flat `type`. A mapping table shared with the ingot parser would have to guess which spelling it was looking at.

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)
→

Then

  1. ✓ keys is not None
  2. ✓ tuple(k.define_name for k in keys) equals UDM_DEFINES
  3. ✓ {k.dialect for k in keys} equals {DIALECT_UDM}
  4. ✓ [k.value_type for k in keys] equals ["uint16", "uint8", "uint32"]
  5. ✓ [k.helpers for k in keys] equals [True, False, True]
  6. ✓ {k.namespace for k in keys} equals {"widgetbus"}
  7. ✓ {k.class_name for k in keys} equals {"telemetry"}
  8. ✓ keys[0].manifest equals "widgetbus_001.yaml"

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

What it checks (8)

  1. assert keys is not None observes parse_udm_manifest via keys
  2. assert tuple(k.define_name for k in keys) == UDM_DEFINES observes parse_udm_manifest via keys
  3. assert {k.dialect for k in keys} == {DIALECT_UDM} observes parse_udm_manifest via keys
  4. assert [k.value_type for k in keys] == ["uint16", "uint8", "uint32"] observes parse_udm_manifest via keys
  5. assert [k.helpers for k in keys] == [True, False, True] observes parse_udm_manifest via keys
  6. assert {k.namespace for k in keys} == {"widgetbus"} observes parse_udm_manifest via keys
  7. assert {k.class_name for k in keys} == {"telemetry"} observes parse_udm_manifest via keys
  8. assert keys[0].manifest == "widgetbus_001.yaml" observes parse_udm_manifest via keys

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_udm_manifest_is_parsed→parse_udm_manifest

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_manifest_is_parsed · 8 checksparse_udm_manifestrel_keyREQ-DDB-PIPE-003 · measuredparse_udm_manifestREQ-DDB-SCHEMA-013 · measured
Also reaches 2 requirements

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