test_ingest_requirements_yaml_reads_the_mapping_keyed_shape¶
Tests › tests/test_build_docs_db.py
What this test is for
Why it exists
The shape doxygen-guard 1.3.1 ships for its OWN catalog: a `requirements:` mapping keyed by requirement id, with the id as the key and `name` as the title field. Its schema is why — `formats_using_id_column` lists only csv and json, so a YAML catalog is keyed and self-describing.
Verifies REQ-DDB-PIPE-001 REQ-DDB-PIPE-010
Given
db = tmp_path / "clew.db"sqlite3.connect(str(db)).close()
3 more
yaml_path = tmp_path / "requirements.yaml"yaml_path.write_text( """ requirements: REQ-X-FOO-001: name: Doxygen presence check subsystem: Validate min_version: v0.1.0 REQ-X-BAR-002: name: Version staleness detection subsystem: Validate """, )guard_cfg = {"requirements": {"name_column": "name", "id_column": "Req ID"}}
When
ingest_requirements_yaml(db, yaml_path, guard_cfg)conn = sqlite3.connect(str(db))rows = conn.execute("SELECT id, title FROM requirements ORDER BY id").fetchall()conn.close()
Then
- ✓ rows equals [ ("REQ-X-BAR-002", "Version staleness detection"), ("REQ-X-FOO-001", "Doxygen presence check"), ]
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:1050 · its file's page
What it checks (1)
assert rows == [ ("REQ-X-BAR-002", "Version staleness detection"), ("REQ-X-FOO-001", "Doxygen presence check"), ]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