test_enrich_optional_field_defaults

Tests › tests/test_enrichment.py

passed Passed in the packaged run.

What this test is for

Why it exists

A minimal entry (only the required scalar fields) inserts cleanly: the absent list fields default to `[]` and difficulty to 1.

Given

  1. minimal = "- topic: t\n title: T\n summary: S\n"
  2. db = _enrich(tmp_path, minimal)
3 more
  1. conn = sqlite3.connect(str(db))
  2. row = conn.execute( "SELECT key_files, key_concepts, prerequisite_topics, difficulty FROM architecture_topics" ).fetchone()
  3. conn.close()
→

When

  1. —
→

Then

  1. ✓ json.loads(row[0]) equals []
  2. ✓ json.loads(row[1]) equals []
  3. ✓ json.loads(row[2]) equals []
  4. ✓ row[3] equals 1

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

What it checks (4)

  1. assert json.loads(row[0]) == [] not attributed
  2. assert json.loads(row[1]) == [] not attributed
  3. assert json.loads(row[2]) == [] not attributed
  4. assert row[3] == 1 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_optional_field_defaults→_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_optional_field_defaults · 4 checks_enrichenrich_databaseREQ-DDB-PIPE-001 · measured
Also reaches 1 requirement

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