test_an_elif_is_a_condition_at_the_same_depth¶
Tests › tests/test_wiki_activity.py
What this test is for
Why it exists
`elif` is not `else` + nested `if`; a final `else` keeps its own line.
Given
src = ( "def f(x):\n if x > 1:\n a()\n elif x:\n b()\n else:\n c()\n" )
When
steps = steps_of(src.splitlines(), "m.py", 1)
Then
- ✓ [(s.kind, s.text, s.first, s.depth) for s in steps] equals [ (COND, "if x > 1", 2, 0), (STMT, "a()", 3, 1), (COND, "elif x", 4, 0), (STMT, "b()", 5, 1), (ELSE, "else", 6, 0), (STMT, "c()", 7, 1), ]
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 · 9 of 400 steps
… 273 earlier steps
… 112 later steps
tests/test_wiki_activity.py:77 · its file's page
What it checks (1)
assert [(s.kind, s.text, s.first, s.depth) for s in steps] == [ (COND, "if x > 1", 2, 0), (STMT, "a()", 3, 1), (COND, "elif x", 4, 0), (STMT, "b()", 5, 1), (ELSE, "else", 6, 0), (STMT, "c()", 7, 1), ]observessteps_ofviasteps
Where the product reaches it
build_wiki→_build_site→symbol_pages→_section→_activity→steps_of(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-045 measured