test_candidates_report_a_body_that_lives_in_another_file

Tests › tests/test_outofline_definitions.py

passed Passed in the packaged run.

What this test is for

Why it exists

`has_body` is published in `dossier`'s `candidates`, so a wrong value does not merely mis-sort — it TELLS the reader the real method has no body. Observed on entropic: `has_body: false` for a row whose body spans lines 2826-2841.

Given

  1. conn = _fixture(tmp_path)
→

When

  1. try: rows = _common.function_candidates(conn, "run_turn") finally: conn.close()
  2. by_rowid = {row[0]: row for row in rows}
→

Then

  1. ✓ by_rowid contains OUT_OF_LINE
  2. ✓ by_rowid[OUT_OF_LINE][-1] holds
  3. ✓ {row[0] for row in rows} equals {OUT_OF_LINE, TEST_HELPER}
  4. ✓ by_rowid[TEST_HELPER][-1] holds

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.

Build this wiki from the index · 4 of 400 steps

… 169 earlier steps

callercallercallercallerclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyclew/query/_common.pyother filesother filesother filesother filesopt (line 201)optbuild_wiki170. _entry_rowids → identity_rowids170identity_rowids171. identity_rowids → function_candidates171function_candidates172. function_candidates → table_exists172table_exists▶ test enters173–175. function_candidates → _test_scope_term173_test_scope_term +2 more176–177. matching_identity → qualified_name_of176qualified_name_of +1 more

… 223 later steps

1 more

tests/test_outofline_definitions.py:132 · its file's page

What it checks (4)

  1. assert OUT_OF_LINE in by_rowid, "the out-of-line definition is missing from candidates" not attributed
  2. assert by_rowid[OUT_OF_LINE][-1], ( "the out-of-line definition is reported as having NO body, so a reader is told the " "real method is a declaration when its body spans 2826-2841 of another file" ) not attributed
  3. assert {row[0] for row in rows} == {OUT_OF_LINE, TEST_HELPER}, ( f"candidates did not surface both meanings of the name: {rows}" ) observes function_candidates via rows
  4. assert by_rowid[TEST_HELPER][-1], "the in-place helper genuinely has a body too" not attributed

Where the product reaches it

  • dossier → identity_rowids → function_candidates (flow)

Call flow

test_candidates_report_a_body_that_lives_in_another_file→_fixture→function_candidates

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_candidates_report_a_body_that_lives_in_another_file · 4 checksfunction_candidatesREQ-DDB-QUERY-003 · measuredfunction_candidatesREQ-DDB-QUERY-010 · measured
Also reaches 2 requirements

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