test_enrich_is_idempotent

Tests › tests/test_enrichment.py

passed Passed in the packaged run.

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

  1. db = _enrich(tmp_path, _CURRICULUM)
  2. yaml_path = tmp_path / "topics.yaml"
  3. yaml_path.write_text("- topic: only\n title: Only\n summary: S\n", encoding="utf-8")
→

When

  1. enrich_database(db, yaml_path)
  2. conn = sqlite3.connect(str(db))
  3. rows = conn.execute("SELECT topic FROM architecture_topics").fetchall()
  4. conn.close()
→

Then

  1. ✓ rows equals [("only",)]

tests/test_enrichment.py:118 · its file's page

What it checks (1)

  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

test_enrich_is_idempotent→_enrich→enrich_database

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.

test_enrich_is_idempotent · 1 checksenrich_databaseREQ-DDB-PIPE-001 · measured
Also reaches 1 requirement

Its run touches their code; that is reach, not proof.