test_a_stale_extent_bundles_no_wrong_body

Tests › tests/test_wiki_symbols.py

passed Passed in the packaged run.

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.

Verifies REQ-DDB-WIKI-025 REQ-DDB-WIKI-026 REQ-DDB-WIKI-027

Given

  1. (tmp_path / "m.py").write_text("def other():\n return 1\n\n\ndef mine():\n return 2\n")
  2. stale = Definition(1, "mine", "m.py", "mine()", "", 1, 2)
  3. fresh = Definition(1, "mine", "m.py", "mine()", "", 5, 6)
→

When

  1. —
→

Then

  1. ✓ _body(tmp_path, stale) does not contain "return 1"
  2. ✓ _body( tmp_path, stale ) contains "older than this file"
  3. ✓ _body(tmp_path, fresh) contains "return 2"

tests/test_wiki_symbols.py:111 · its file's page

What it checks (2)

  1. assert "return 1" not in _body(tmp_path, stale) and "older than this file" in _body( tmp_path, stale ) not attributed
  2. assert "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)

requirementlinked byimplementers exercised
REQ-DDB-WIKI-025catalogunknown
REQ-DDB-WIKI-026catalogunknown
REQ-DDB-WIKI-027catalogunknown