test_enrich_is_idempotent¶
Tests › tests/test_enrichment.py
What this test is for
Why it exists
The docstring promises re-running the build idempotently overwrites the table (DELETE before insert). A second enrich with fewer topics must leave exactly those topics, not the union.
Given
db = _enrich(tmp_path, _CURRICULUM)yaml_path = tmp_path / "topics.yaml"yaml_path.write_text("- topic: only\n title: Only\n summary: S\n", encoding="utf-8")
When
enrich_database(db, yaml_path)conn = sqlite3.connect(str(db))rows = conn.execute("SELECT topic FROM architecture_topics").fetchall()conn.close()
Then
- ✓ rows equals [("only",)]
tests/test_enrichment.py:118 · its file's page
What it checks (1)
assert rows == [("only",)]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.
Also reaches 1 requirement
Its run touches their code; that is reach, not proof.
- REQ-DDB-PIPE-001 measured