test_enrich_populates_topics¶
Tests › tests/test_enrichment.py
What this test is for
Why it exists
Each YAML entry becomes one row; scalar fields land verbatim and the list fields (key_files / key_concepts / prerequisite_topics) are stored as JSON that decodes back to the original lists.
Given
db = _enrich(tmp_path, _CURRICULUM)conn = sqlite3.connect(str(db))
3 more
rows = conn.execute( "SELECT topic, title, summary, key_files, key_concepts, " "prerequisite_topics, difficulty FROM architecture_topics ORDER BY topic" ).fetchall()conn.close()dataflow, event_bus = rows
When
- —
Then
- ✓ len(rows) equals 2
- ✓ event_bus[0] equals "event_bus"
- ✓ event_bus[1] equals "The Event Bus"
- ✓ json.loads(event_bus[3]) equals ["src/event_bus/event_bus.c"]
- ✓ json.loads(event_bus[4]) equals ["callback", "dispatch"]
- ✓ event_bus[6] equals 2
- ✓ dataflow[0] equals "dataflow"
- ✓ json.loads(dataflow[5]) equals ["event_bus"]
- ✓ dataflow[6] equals 3
tests/test_enrichment.py:66 · its file's page
What it checks (9)
assert len(rows) == 2not attributedassert event_bus[0] == "event_bus"not attributedassert event_bus[1] == "The Event Bus"not attributedassert json.loads(event_bus[3]) == ["src/event_bus/event_bus.c"]not attributedassert json.loads(event_bus[4]) == ["callback", "dispatch"]not attributedassert event_bus[6] == 2not attributedassert dataflow[0] == "dataflow"not attributedassert json.loads(dataflow[5]) == ["event_bus"]not attributedassert dataflow[6] == 3not 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
test_enrich_populates_topics→_enrichWhat 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-PIPE-001 measured