test_pages_served_by_the_hub_carry_the_live_script¶
Tests › tests/test_wiki_hub.py
What this test is for
Why it exists
THE STATIC SITE STAYS SERVER-FREE: the hub injects `/live.js` into the pages it serves.
Given
server, builder, live, _gone = hubbuilder.release.set()
6 more
site = server.site_dir(live)site.mkdir(parents=True)(site / "index.html").write_text("<html><body><p>x</p></body></html>")cookie = f"clew_wiki={server.token}"_status, page, _h = _get(f"http://127.0.0.1:{server.port}/r/{live.slug}/", cookie)status, script, headers = _get(f"http://127.0.0.1:{server.port}/live.js", cookie)
When
- —
Then
- ✓ page contains '<script src="/live.js"></script></body>'
- ✓ status equals 200
- ✓ script contains "EventSource"
- ✓ headers["Content-Type"] contains "javascript"
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 `WikiHub._build` — `_build` (clew/mcp_server/wikihub.py) · 1 of 7 steps
… 3 later steps
tests/test_wiki_hub.py:224 · its file's page
What it checks (2)
assert '<script src="/live.js"></script></body>' in pagenot attributedassert status == 200 and "EventSource" in script and "javascript" in headers["Content-Type"]not attributed
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_pages_served_by_the_hub_carry_the_live_script→_getWhat 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-032 | catalog | unknown |
| REQ-DDB-WIKI-033 | catalog | unknown |
| REQ-DDB-WIKI-054 | catalog | unknown |
Also reaches 2 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-MCP-001 measured
- REQ-DDB-WIKI-034 measured