test_a_declared_key_is_observed_under_ingots_own_spellings

Tests › tests/test_datamodel.py

passed Passed in the packaged run.

What this test is for

Why it exists

gh#42. THE JOIN MUST MATCH THE WAY INGOT MATCHES, or a declared key sits beside the identical observed key reading `observed = 0`. `filter.rs` accepts three spellings of one key, and its own comment says why the third exists::

Given

  1. declared = "B12_BATTERY_STATE_OF_CHARGE"
→

When

  1. observed_match(declared, frozenset({declared}))
  2. observed_match(declared, frozenset({f"DM_KEY_{declared}"}))
  3. observed_match(declared, frozenset({"B12BATTERYSTATEOFCHARGE"}))
  4. observed_match(declared, frozenset({"B12_BATTERY_VOLTAGE"}))
→

Then

  1. ✓ observed_match(declared, frozenset({declared})) holds
  2. ✓ observed_match(declared, frozenset({f"DM_KEY_{declared}"})) holds
  3. ✓ observed_match(declared, frozenset({"B12BATTERYSTATEOFCHARGE"})) holds
  4. ✓ observed_match(declared, frozenset({"B12_BATTERY_VOLTAGE"})) is false

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

What it checks (4)

  1. assert observed_match(declared, frozenset({declared})), "the bare spelling must match" observes observed_match
  2. assert observed_match(declared, frozenset({f"DM_KEY_{declared}"})), ( "ingot's generated key_definitions.h emits the DM_KEY_ form" ) observes observed_match
  3. assert observed_match(declared, frozenset({"B12BATTERYSTATEOFCHARGE"})), ( "ingot normalizes by stripping underscores, so a YAML-era name still matches" ) observes observed_match
  4. assert not observed_match(declared, frozenset({"B12_BATTERY_VOLTAGE"})), ( "a different key must not match, or every declared key would read as observed" ) observes observed_match

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_declared_key_is_observed_under_ingots_own_spellings→observed_match

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_declared_key_is_observed_under_ingots_own_spellings · 4 checksobserved_matchREQ-DDB-SCHEMA-013 · measured
Also reaches 1 requirement

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