test_an_unreadable_database_yields_no_hint

Tests › tests/test_recovery_hint.py

passed Passed in the packaged run.

What this test is for

Why it exists

NEVER RAISES ON THE MISS PATH. This runs while building a reply that has already failed, so a database that cannot be opened — the very case `unbuilt_index_message` exists for — must not turn a clean negative into a traceback.

Given

  1. —
→

When

  1. recovery_hint(None, "execute")
  2. recovery_hint(tmp_path / "missing.db", "execute")
  3. junk = tmp_path / "junk.db"
3 more
  1. junk.write_text("this is not a database", encoding="utf-8")
  2. recovery_hint(junk, "execute")
  3. recovery_hint(tmp_path / "missing.db", None)
→

Then

  1. ✓ recovery_hint(None, "execute") equals ""
  2. ✓ recovery_hint(tmp_path / "missing.db", "execute") equals ""
  3. ✓ recovery_hint(junk, "execute") equals ""
  4. ✓ recovery_hint(tmp_path / "missing.db", None) equals ""

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.

Look up one name: everything the index holds about it · 11 of 226 steps

… 6 earlier steps

callercallercallercallercallerclew/query/payload.pyclew/query/payload.pyclew/query/payload.pyclew/query/payload.pyclew/query/payload.pyclew/query/subject.pyclew/query/subject.pyclew/query/subject.pyclew/query/subject.pyclew/query/subject.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/recovery.pyclew/query/recovery.pyclew/query/recovery.pyclew/query/recovery.pyclew/query/recovery.pyother filesother filesother filesother filesother filestry (line 266)tryopt (line 296)optloop (line 154)loopdossier7. _batch_miss → _kind_limitation_clause7_kind_limitation_clause8. batch_payload → recovery_hint8recovery_hint9. recovery_hint → connect9connect▶ test enters10–11. recovery_hint → _hint_from10_hint_from +1 more12. _hint_from → _indexed_path12_indexed_path13. _indexed_path → table_exists13table_exists14–15. _hint_from → bare_tail14bare_tail +1 more16. _name_exists → table_exists16table_exists17. _hint_from → _documentation_mentions17_documentation_mentions18. _documentation_mentions → table_exists18table_exists19. _documentation_mentions → has_columns19has_columns20. has_columns → table_exists20table_exists21–22. _hint_from → _name_exists21_name_exists +1 more23. _qualified_forms → table_exists23table_exists24. _qualified_forms → qualified_name_of24qualified_name_of25. batch_payload → unresolved_kinds25unresolved_kinds

… 201 later steps

tests/test_recovery_hint.py:283 · its file's page

What it checks (4)

  1. assert recovery_hint(None, "execute") == "" observes recovery_hint
  2. assert recovery_hint(tmp_path / "missing.db", "execute") == "" observes recovery_hint
  3. assert recovery_hint(junk, "execute") == "" observes recovery_hint
  4. assert recovery_hint(tmp_path / "missing.db", None) == "" observes recovery_hint

Where the product reaches it

  • dossier → _batched_dossiers → batch_payload → recovery_hint (flow)

Call flow

test_an_unreadable_database_yields_no_hint→recovery_hint

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_an_unreadable_database_yields_no_hint · 4 checksrecovery_hintconnectREQ-DDB-QUERY-001 · measuredrecovery_hint_hint_from_indexed_pathtable_existsREQ-DDB-QUERY-003 · measuredrecovery_hintREQ-DDB-QUERY-013 · measured
Also reaches 3 requirements

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