test_ingest_covers_the_indexed_set_and_only_that¶
Tests › tests/test_filedocs.py
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
db, repo = indexed
When
count = ingest_file_docs(db, repo)conn = sqlite3.connect(db)paths = {row[0] for row in conn.execute("SELECT file_path FROM file_docs")}
2 more
headings = {row[0] for row in conn.execute("SELECT heading FROM supplementary_docs")}conn.close()
Then
- ✓ count equals 2
- ✓ paths equals {"src/cb.py", "src/mutex_order.c"}
- ✓ paths does not contain "src/plain.c"
- ✓ paths does not contain "src/unindexed.py"
- ✓ any("src/cb.py" in h for h in headings) holds
tests/test_filedocs.py:220 · its file's page
What it checks (5)
assert count == 2observesingest_file_docsviacountassert paths == {"src/cb.py", "src/mutex_order.c"}not attributedassert "src/plain.c" not in paths, "a license header is not documentation"not attributedassert "src/unindexed.py" not in paths, "the stage must read the INDEX, not the tree"not attributedassert 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
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 4 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-INDEX-002 measured
- REQ-DDB-PIPE-008 measured
- REQ-DDB-PIPE-014 measured
- REQ-DDB-SCHEMA-014 measured