test_absent_corpus_is_reported_as_absent

Tests › tests/test_filedocs.py

passed Passed in the packaged run.

What this test is for

Why it exists

An index built before build 23 has no `file_docs` table. A detector that cannot look must not report a negative — this repo's most-repeated lesson, applied to its newest table.

Given

  1. db, repo = indexed
→

When

  1. has_file_docs(db)
  2. file_doc_rows(sqlite3.connect(db), ["anything"])
  3. ingest_file_docs(db, repo)
→

Then

  1. ✓ has_file_docs(db) is False
  2. ✓ file_doc_rows(sqlite3.connect(db), ["anything"]) equals []
  3. ✓ has_file_docs(db) is True

What it exercises

The parts of the system's flows this test ran, measured by per-test coverage: lit steps ran in this test, dimmed ones did not, and ▶ marks where the test called in. Each title opens the whole flow with these steps lit.

clew — `main` (clew/cli.py) · 3 of 400 steps

… 244 earlier steps

command-line usercommand-line usercommand-line usercommand-line userclew/query/symbols.pyclew/query/symbols.pyclew/query/symbols.pyclew/query/symbols.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/corpus.pyclew/query/corpus.pyclew/query/corpus.pyclew/query/corpus.pymain245. _file_candidates → _doc_brief245_doc_brief246. _file_candidates → file_doc_rows246file_doc_rows247. file_doc_rows → table_exists247table_exists▶ test enters248. _file_candidates → undocumented_path_rows248undocumented_path_rows249. undocumented_path_rows → table_exists249table_exists

… 38 steps between

command-line usercommand-line usercommand-line usercommand-line userclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/corpus.pyclew/query/corpus.pyclew/query/corpus.pyclew/query/corpus.pyother filesother filesother filesother filesopt (line 399)optmain288. _verdict → _unread_note288_unread_note289. _verdict → has_file_docs289has_file_docs290. has_file_docs → connect290connect▶ test enters291. has_file_docs → table_exists291table_exists292. search_emptiness → _scope_sentence292_scope_sentence293. _symbol_corpus → with_limit_disclosure293with_limit_disclosure

… 107 later steps

1 more

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

What it checks (3)

  1. assert has_file_docs(db) is False observes has_file_docs
  2. assert file_doc_rows(sqlite3.connect(db), ["anything"]) == [] observes file_doc_rows
  3. assert has_file_docs(db) is True observes has_file_docs

Where the product reaches it

  • main → query_main → _payload → export_search → corpus_payload → _symbol_corpus → search_counted → _file_candidates → file_doc_rows (flow)
  • main → query_main → _payload → export_search → corpus_payload → _symbol_corpus → search_emptiness → _verdict → has_file_docs (flow)

Call flow

test_absent_corpus_is_reported_as_absent→has_file_docs→file_doc_rows→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_absent_corpus_is_reported_as_absent · 3 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 · measuredhas_file_docsconnectREQ-DDB-QUERY-001 · measuredfile_doc_rowstable_existsREQ-DDB-QUERY-003 · measuredfile_doc_rowsREQ-DDB-QUERY-007 · measuredingest_file_docsensure_file_docs_tableREQ-DDB-SCHEMA-014 · measured
Also reaches 7 requirements

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