test_a_catalog_entry_declares_its_modes

Tests › tests/test_failure_modes.py

passed Passed in the packaged run.

What this test is for

Why it exists

`failure_modes` is a mapping of id to meaning; anything else is refused by name.

Given

  1. —
→

When

  1. modes_of("REQ-A-001", {"failure_modes": {"FM-A-001-1": "overflow wraps silently"}})
  2. modes_of("REQ-A-002", {"title": "x"})
  3. import pytest
  4. modes_of("REQ-A-003", {"failure_modes": ["FM-1"]})
→

Then

  1. ✓ [ (m.req_id, m.mode_id, m.meaning) for m in modes_of("REQ-A-001", {"failure_modes": {"FM-A-001-1": "overflow wraps silently"}}) ] equals [("REQ-A-001", "FM-A-001-1", "overflow wraps silently")]
  2. ✓ modes_of("REQ-A-002", {"title": "x"}) equals []
  3. ✓ raises ValueError

tests/test_failure_modes.py:61 · its file's page

What it checks (2)

  1. assert [ (m.req_id, m.mode_id, m.meaning) for m in modes_of("REQ-A-001", {"failure_modes": {"FM-A-001-1": "overflow wraps silently"}}) ] == [("REQ-A-001", "FM-A-001-1", "overflow wraps silently")] observes modes_of
  2. assert modes_of("REQ-A-002", {"title": "x"}) == [] observes modes_of

Where the product reaches it

  • main → _run → run_precommit → _validate_files → load_failure_mode_ids → modes_of (flow)

Call flow

test_a_catalog_entry_declares_its_modes→modes_of

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_catalog_entry_declares_its_modes · 2 checksmodes_ofREQ-DDB-SCHEMA-006 · measured
Also reaches 1 requirement

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