test_candidates_report_a_body_that_lives_in_another_file¶
Tests › tests/test_outofline_definitions.py
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
conn = _fixture(tmp_path)
When
try: rows = _common.function_candidates(conn, "run_turn") finally: conn.close()by_rowid = {row[0]: row for row in rows}
Then
- ✓ by_rowid contains OUT_OF_LINE
- ✓ by_rowid[OUT_OF_LINE][-1] holds
- ✓ {row[0] for row in rows} equals {OUT_OF_LINE, TEST_HELPER}
- ✓ 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
… 223 later steps
1 more
- Look up one name: everything the index holds about it · 4 of 226 steps
tests/test_outofline_definitions.py:132 · its file's page
What it checks (4)
assert OUT_OF_LINE in by_rowid, "the out-of-line definition is missing from candidates"not attributedassert 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 attributedassert {row[0] for row in rows} == {OUT_OF_LINE, TEST_HELPER}, ( f"candidates did not surface both meanings of the name: {rows}" )observesfunction_candidatesviarowsassert 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
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 2 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-QUERY-003 measured
- REQ-DDB-QUERY-010 measured