test_ingest_is_idempotent

Tests › tests/test_filedocs.py

passed Passed in the packaged run.

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

  1. db, repo = indexed
→

When

  1. ingest_file_docs(db, repo)
  2. ingest_file_docs(db, repo)
  3. conn = sqlite3.connect(db)
2 more
  1. total = conn.execute("SELECT COUNT(*) FROM file_docs").fetchone()[0]
  2. conn.close()
→

Then

  1. ✓ total equals 2

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

What it checks (1)

  1. assert total == 2 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_is_idempotent→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_is_idempotent · 1 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.