test_udm_manifest_is_parsed¶
Tests › tests/test_datamodel.py
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
path = tmp_path / "widgetbus_001.yaml"path.write_text(UDM_MANIFEST, encoding="utf-8")
When
keys = parse_udm_manifest(path, tmp_path)
Then
- ✓ keys is not None
- ✓ tuple(k.define_name for k in keys) equals UDM_DEFINES
- ✓ {k.dialect for k in keys} equals {DIALECT_UDM}
- ✓ [k.value_type for k in keys] equals ["uint16", "uint8", "uint32"]
- ✓ [k.helpers for k in keys] equals [True, False, True]
- ✓ {k.namespace for k in keys} equals {"widgetbus"}
- ✓ {k.class_name for k in keys} equals {"telemetry"}
- ✓ keys[0].manifest equals "widgetbus_001.yaml"
tests/test_datamodel.py:452 · its file's page
What it checks (8)
assert keys is not Noneobservesparse_udm_manifestviakeysassert tuple(k.define_name for k in keys) == UDM_DEFINESobservesparse_udm_manifestviakeysassert {k.dialect for k in keys} == {DIALECT_UDM}observesparse_udm_manifestviakeysassert [k.value_type for k in keys] == ["uint16", "uint8", "uint32"]observesparse_udm_manifestviakeysassert [k.helpers for k in keys] == [True, False, True]observesparse_udm_manifestviakeysassert {k.namespace for k in keys} == {"widgetbus"}observesparse_udm_manifestviakeysassert {k.class_name for k in keys} == {"telemetry"}observesparse_udm_manifestviakeysassert keys[0].manifest == "widgetbus_001.yaml"observesparse_udm_manifestviakeys
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.
Also reaches 2 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-PIPE-003 measured
- REQ-DDB-SCHEMA-013 measured