test_a_stale_extent_bundles_no_wrong_body¶
Tests › tests/test_wiki_symbols.py
What this test is for
Why it exists
FOUND ON THE DEMO: an index older than the file bundled another function's lines under this one's name. A recorded extent that no longer names the function says so instead.
Given
(tmp_path / "m.py").write_text("def other():\n return 1\n\n\ndef mine():\n return 2\n")stale = Definition(1, "mine", "m.py", "mine()", "", 1, 2)fresh = Definition(1, "mine", "m.py", "mine()", "", 5, 6)
When
- —
Then
- ✓ _body(tmp_path, stale) does not contain "return 1"
- ✓ _body( tmp_path, stale ) contains "older than this file"
- ✓ _body(tmp_path, fresh) contains "return 2"
tests/test_wiki_symbols.py:111 · its file's page
What it checks (2)
assert "return 1" not in _body(tmp_path, stale) and "older than this file" in _body( tmp_path, stale )not attributedassert "return 2" in _body(tmp_path, fresh)not attributed
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.
Requirements it verifies (3)
| requirement | linked by | implementers exercised |
|---|---|---|
| REQ-DDB-WIKI-025 | catalog | unknown |
| REQ-DDB-WIKI-026 | catalog | unknown |
| REQ-DDB-WIKI-027 | catalog | unknown |