test_enrich_populates_topics

Tests › tests/test_enrichment.py

passed Passed in the packaged run.

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

  1. db = _enrich(tmp_path, _CURRICULUM)
  2. conn = sqlite3.connect(str(db))
3 more
  1. rows = conn.execute( "SELECT topic, title, summary, key_files, key_concepts, " "prerequisite_topics, difficulty FROM architecture_topics ORDER BY topic" ).fetchall()
  2. conn.close()
  3. dataflow, event_bus = rows
→

When

  1. —
→

Then

  1. ✓ len(rows) equals 2
  2. ✓ event_bus[0] equals "event_bus"
  3. ✓ event_bus[1] equals "The Event Bus"
  4. ✓ json.loads(event_bus[3]) equals ["src/event_bus/event_bus.c"]
  5. ✓ json.loads(event_bus[4]) equals ["callback", "dispatch"]
  6. ✓ event_bus[6] equals 2
  7. ✓ dataflow[0] equals "dataflow"
  8. ✓ json.loads(dataflow[5]) equals ["event_bus"]
  9. ✓ dataflow[6] equals 3

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

What it checks (9)

  1. assert len(rows) == 2 not attributed
  2. assert event_bus[0] == "event_bus" not attributed
  3. assert event_bus[1] == "The Event Bus" not attributed
  4. assert json.loads(event_bus[3]) == ["src/event_bus/event_bus.c"] not attributed
  5. assert json.loads(event_bus[4]) == ["callback", "dispatch"] not attributed
  6. assert event_bus[6] == 2 not attributed
  7. assert dataflow[0] == "dataflow" not attributed
  8. assert json.loads(dataflow[5]) == ["event_bus"] not attributed
  9. assert dataflow[6] == 3 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_populates_topics→_enrich

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_populates_topics · 9 checks_enrichenrich_databaseREQ-DDB-PIPE-001 · measured
Also reaches 1 requirement

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