test_ingest_is_idempotent¶
Tests › tests/test_filedocs.py
What this test is for
Why it exists
A rebuild of the same database must not double the corpus. `DELETE` then insert, the same shape `ingest_supplementary_docs` uses.
Given
db, repo = indexed
When
ingest_file_docs(db, repo)ingest_file_docs(db, repo)conn = sqlite3.connect(db)
2 more
total = conn.execute("SELECT COUNT(*) FROM file_docs").fetchone()[0]conn.close()
Then
- ✓ total equals 2
tests/test_filedocs.py:270 · its file's page
What it checks (1)
assert total == 2not 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