test_ingest_requirements_yaml_loads_rows¶
Tests › tests/test_build_docs_db.py
What this test is for
Given
db = tmp_path / "clew.db"sqlite3.connect(str(db)).close()
2 more
yaml_path = tmp_path / "requirements.yaml"yaml_path.write_text( """ - id: REQ-0001 block: startup title: Device boots and reports ready acceptance: Device emits ready event within 30s of power on priority: P0 - id: REQ-0002 block: connectivity title: Device connects to wifi acceptance: Device joins configured SSID within 60s priority: P1 """, )
When
ingest_requirements_yaml(db, yaml_path)conn = sqlite3.connect(str(db))rows = conn.execute( "SELECT id, block, title, acceptance, priority FROM requirements ORDER BY id", ).fetchall()conn.close()
Then
- ✓ rows equals [ ( "REQ-0001", "startup", "Device boots and reports ready", "Device emits ready event within 30s of power on", "P0", ), ( "REQ-0002", "connectivity", "Device connects to wifi", "Device joins configured SSID within 60s", "P1", ), ]
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.
`main` (clew/guard/main.py) · 1 of 357 steps
… 72 earlier steps
… 280 later steps
tests/test_build_docs_db.py:1008 · its file's page
What it checks (1)
assert rows == [ ( "REQ-0001", "startup", "Device boots and reports ready", "Device emits ready event within 30s of power on", "P0", ), ( "REQ-0002", "connectivity", "Device connects to wifi", "Device joins configured SSID within 60s", "P1", ), ]not attributed
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.
Requirements it verifies (2)
| requirement | linked by | implementers exercised |
|---|---|---|
| REQ-DDB-PIPE-001 | catalog | unknown |
| REQ-DDB-PIPE-010 | catalog | unknown |
Also reaches 5 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-CONFIG-001 measured
- REQ-DDB-CONFIG-003 measured
- REQ-DDB-SCHEMA-006 measured
- REQ-DDB-SCHEMA-015 measured
- REQ-DDB-WIKI-054 inferred