test_a_comment_is_kept_with_where_it_was_made

Tests › tests/test_wiki_comments.py

passed Passed in the packaged run.

What this test is for

Why it exists

A comment records its page, anchor, the quoted text, its body and its time.

Given

  1. store = _store(tmp_path)
  2. got = store.add(page="test-x.html", anchor="checks", quote="assert a < 2", body="Wrong bound?")
→

When

  1. —
→

Then

  1. ✓ got["status"] equals "new"
  2. ✓ got["page"] equals "test-x.html"
  3. ✓ got["anchor"] equals "checks"
  4. ✓ got["quote"] equals "assert a < 2"
  5. ✓ got["body"] equals "Wrong bound?"
  6. ✓ got["id"] holds
  7. ✓ got["at"].endswith("Z") holds
  8. ✓ [c["id"] for c in store.unread()] equals [got["id"]]

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.

thread `clew-first-build-` — `_first_build_worker` (clew/mcp_server/server.py) · 3 of 142 steps

… 105 earlier steps

thread startthread startthread startthread startclew/declaration.pyclew/declaration.pyclew/declaration.pyclew/declaration.pyclew/guard/config.pyclew/guard/config.pyclew/guard/config.pyclew/guard/config.pyother filesother filesother filesother filesopt (line 529)optloop (line 135)loopopt (line 137)optopt (line 531)opt_first_build_worker106. _checked_section → _checked_list_section106_checked_list_section107. _checked_list_section → all107all108. all → _events108_events▶ test enters109–110. all → _public109_public +1 more111. _checked_section → _checked_requirements111_checked_requirements112. _checked_requirements → _validate_node112_validate_node

… 30 later steps

4 more

tests/test_wiki_comments.py:27 · its file's page

What it checks (4)

  1. assert got["status"] == "new" and got["page"] == "test-x.html" and got["anchor"] == "checks" not attributed
  2. assert got["quote"] == "assert a < 2" and got["body"] == "Wrong bound?" not attributed
  3. assert got["id"] and got["at"].endswith("Z") not attributed
  4. assert [c["id"] for c in store.unread()] == [got["id"]] observes _store via store

Where the product reaches it

No product flow reaches this code: no product entry point's flow calls any of the functions this test calls.

Call flow

test_a_comment_is_kept_with_where_it_was_made→_store

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 1 requirement

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