test_functions_sit_in_their_block_on_rings_by_call_depth¶
Tests › tests/test_wiki_web.py
What this test is for
Why it exists
THE WEB'S THREADS: an entry point (no non-test caller) is ring 0 at the centre; each call takes its callee one ring out. Test code is not drawn — it is a lens, not a block.
Given
data = _data(db)nodes = {n["name"]: n for n in data["nodes"]}
2 more
blocks = {b["id"]: b for b in data["blocks"]}for n in data["nodes"]: block = data["blocks"][n["block"]] angle = math.atan2(n["y"], n["x"]) % (2 * math.pi) assert block["a0"] - 1e-6 <= angle <= block["a1"] + 1e-6, n["name"]
When
- —
Then
- ✓ nodes does not contain "test_save"
- ✓ (nodes["handle"]["ring"], nodes["save"]["ring"], nodes["clean"]["ring"]) equals (0, 1, 2)
- ✓ nodes["clean"]["block"] equals [b["id"] for b in data["blocks"]].index("Core")
- ✓ blocks["Core"]["inferred_files"] equals ["pkg/util.py"]
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.
Build this wiki from the index · 20 of 400 steps
… 140 earlier steps
… 234 later steps
tests/test_wiki_web.py:90 · its file's page
What it checks (5)
assert "test_save" not in nodesnot attributedassert (nodes["handle"]["ring"], nodes["save"]["ring"], nodes["clean"]["ring"]) == (0, 1, 2)not attributedassert block["a0"] - 1e-6 <= angle <= block["a1"] + 1e-6, n["name"]not attributedassert nodes["clean"]["block"] == [b["id"] for b in data["blocks"]].index("Core")observes_dataviadataassert blocks["Core"]["inferred_files"] == ["pkg/util.py"]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_functions_sit_in_their_block_on_rings_by_call_depth→_dataWhat 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 4 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-QUERY-001 measured
- REQ-DDB-QUERY-003 measured
- REQ-DDB-WIKI-019 measured
- REQ-DDB-WIKI-022 measured