test_ingest_covers_the_indexed_set_and_only_that

Tests › tests/test_filedocs.py

passed Passed in the packaged run.

What this test is for

Why it exists

Four claims in one pass, because they share a fixture and each is a different way the stage could be wrong: the documented files are in, the license-only file is out, the synthetic `[STL]` row and the directory row are out, and a file on disk that the index does not know about STAYS OUT — the stage must not widen the build's scope decision by globbing.

Given

  1. db, repo = indexed
→

When

  1. count = ingest_file_docs(db, repo)
  2. conn = sqlite3.connect(db)
  3. paths = {row[0] for row in conn.execute("SELECT file_path FROM file_docs")}
2 more
  1. headings = {row[0] for row in conn.execute("SELECT heading FROM supplementary_docs")}
  2. conn.close()
→

Then

  1. ✓ count equals 2
  2. ✓ paths equals {"src/cb.py", "src/mutex_order.c"}
  3. ✓ paths does not contain "src/plain.c"
  4. ✓ paths does not contain "src/unindexed.py"
  5. ✓ any("src/cb.py" in h for h in headings) holds

tests/test_filedocs.py:220 · its file's page

What it checks (5)

  1. assert count == 2 observes ingest_file_docs via count
  2. assert paths == {"src/cb.py", "src/mutex_order.c"} not attributed
  3. assert "src/plain.c" not in paths, "a license header is not documentation" not attributed
  4. assert "src/unindexed.py" not in paths, "the stage must read the INDEX, not the tree" not attributed
  5. assert any("src/cb.py" in h for h in headings) 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_ingest_covers_the_indexed_set_and_only_that→ingest_file_docs

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_ingest_covers_the_indexed_set_and_only_that · 5 checksingest_file_docs_collect_file_docsmemoizedREQ-DDB-INDEX-002 · measuredingest_file_docsREQ-DDB-PIPE-008 · measuredingest_file_docs_collect_file_docswithin_repoREQ-DDB-PIPE-014 · measuredingest_file_docsensure_file_docs_tableREQ-DDB-SCHEMA-014 · measured
Also reaches 4 requirements

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