test_a_catalog_entry_declares_its_modes¶
Tests › tests/test_failure_modes.py
What this test is for
Why it exists
`failure_modes` is a mapping of id to meaning; anything else is refused by name.
Given
- —
When
modes_of("REQ-A-001", {"failure_modes": {"FM-A-001-1": "overflow wraps silently"}})modes_of("REQ-A-002", {"title": "x"})import pytestmodes_of("REQ-A-003", {"failure_modes": ["FM-1"]})
Then
- ✓ [ (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")]
- ✓ modes_of("REQ-A-002", {"title": "x"}) equals []
- ✓ raises ValueError
tests/test_failure_modes.py:61 · its file's page
What it checks (2)
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")]observesmodes_ofassert modes_of("REQ-A-002", {"title": "x"}) == []observesmodes_of
Where the product reaches it
main→_run→run_precommit→_validate_files→load_failure_mode_ids→modes_of(flow)
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 1 requirement
Its run touches their code; that is reach, not proof.
- REQ-DDB-SCHEMA-006 measured