test_a_comment_is_pushed_as_a_channel_notification¶
Tests › tests/test_wiki_channel.py
What this test is for
Why it exists
On a handshake-era session the push is `notifications/claude/channel`.
Given
sent = []async def notify(session, method, params): # noqa: ANN001, ANN202 sent.append((method, params))
6 more
monkeypatch.setattr(channel, "raw_notify", notify)monkeypatch.setattr(channel, "protocol_version", lambda session: "2025-06-18")hub = channel.Channel()hub.session = object()comment = { "page": "test-x.html", "anchor": "checks", "quote": "a < 2", "body": "Bound?", "id": "ab", }method, params = sent[0]
When
all(k.replace("_", "").isalnum() for k in params["meta"])
Then
- ✓ anyio.run(lambda: hub.send("clew-123", comment)) is True
- ✓ method equals "notifications/claude/channel"
- ✓ params["content"] contains "Bound?"
- ✓ params["content"] contains "test-x.html"
- ✓ params["meta"] equals {"repo": "clew-123", "page": "test-x.html", "comment_id": "ab"}
- ✓ all(k.replace("_", "").isalnum() for k in params["meta"]) holds
tests/test_wiki_channel.py:48 · its file's page
What it checks (5)
assert anyio.run(lambda: hub.send("clew-123", comment)) is Truenot attributedassert method == "notifications/claude/channel"not attributedassert "Bound?" in params["content"] and "test-x.html" in params["content"]not attributedassert params["meta"] == {"repo": "clew-123", "page": "test-x.html", "comment_id": "ab"}not attributedassert all(k.replace("_", "").isalnum() for k in params["meta"])observesall
Where the product reaches it
dossier→_rank_enum_over_mirror→_class_side_is_only_enum_mirrors→all(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 1 requirement
Its run touches their code; that is reach, not proof.
- REQ-DDB-WIKI-054 measured