test_unknown_enums_are_elided_but_only_the_named_ones

Tests › tests/test_wire.py

passed Passed in the packaged run.

What this test is for

Why it exists

A REGRESSION TEST for an inversion this module itself introduced.

Given

  1. row = { "name": "publish", "dispatch_mode": "unknown", "edge_kind": "unknown", "lock_kind": "unknown", "crosses_thread": False, }
→

When

  1. out = wire.one(_Envelope(callers=[]))
  2. pruned = wire.rows([_KeyRow(**row)])[0]
  3. determined = wire.rows([_KeyRow(**{**row, "dispatch_mode": "keyed"})])[0]
→

Then

  1. ✓ out is not None
  2. ✓ pruned does not contain "dispatch_mode"
  3. ✓ pruned does not contain "edge_kind"
  4. ✓ pruned["lock_kind"] equals "unknown"
  5. ✓ pruned["crosses_thread"] is False
  6. ✓ determined["dispatch_mode"] equals "keyed"

What it exercises

The parts of the system's flows this test ran, measured by per-test coverage: lit steps ran in this test, dimmed ones did not, and ▶ marks where the test called in. Each title opens the whole flow with these steps lit.

Look up one name: everything the index holds about it · 7 of 226 steps

… 27 earlier steps

callercallercallercallerclew/query/payload.pyclew/query/payload.pyclew/query/payload.pyclew/query/payload.pyother filesother filesother filesother filesopt (line 333)optdossier28. batch_payload → _flatten_subject28_flatten_subject29. _flatten_subject → one29one30. one → _listed30_listed▶ test enters31–36. one → _prune_rows31_prune_rows +5 more37–38. _flatten_subject → _config_found_on_the_wire37_config_found_on_the_wire +1 more

… 188 later steps

2 more

tests/test_wire.py:129 · its file's page

What it checks (6)

  1. assert out is not None observes one via out
  2. assert "dispatch_mode" not in pruned, "an undetermined dispatch_mode must not ship" observes rows via pruned
  3. assert "edge_kind" not in pruned, "an undetermined edge_kind must not ship" observes rows via pruned
  4. assert pruned["lock_kind"] == "unknown", ( "lock_kind='unknown' is a measurement — a lock of undetermined type is not no lock" ) observes rows via pruned
  5. assert pruned["crosses_thread"] is False, "a measured non-crossing must still ship" observes rows via pruned
  6. assert determined["dispatch_mode"] == "keyed" observes rows via determined

Where the product reaches it

  • dossier → subject_payload → _flatten_subject → one (flow)

Call flow

test_unknown_enums_are_elided_but_only_the_named_ones→one→rows

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_unknown_enums_are_elided_but_only_the_named_ones · 6 checksrowsREQ-DDB-QUERY-001 · measured
Also reaches 1 requirement

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