test_given_when_then_come_from_the_syntax¶
Tests › tests/test_wiki_testcard.py
What this test is for
Why it exists
Given = setup before the first product call; When = the product calls; Then = asserts.
Given
html = _card()given, rest = html.split('class="tc-when"', 1)when, then = rest.split('class="tc-then"', 1)
When
- —
Then
- ✓ when contains "make_repo(tmp_path)"
- ✓ when contains "build_wiki(repo)"
- ✓ when contains "panel = site["flow-x.html"]"
- ✓ then contains "panel contains "traces/run.json""
- ✓ then contains "panel contains "confirmed""
- ✓ then contains "len(site) equals 3"
- ✓ then contains "site.get("error") is false"
- ✓ then.count('class="ck passed"') equals 4
tests/test_wiki_testcard.py:58 · its file's page
What it checks (5)
assert "make_repo(tmp_path)" in when and "build_wiki(repo)" in whennot attributedassert "panel = site["flow-x.html"]" in when, ( "a statement after the first product call is When" )not attributedassert ( "panel contains "traces/run.json"" in then and "panel contains "confirmed"" in then )not attributedassert "len(site) equals 3" in then and "site.get("error") is false" in thennot attributedassert then.count('class="ck passed"') == 4not 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_given_when_then_come_from_the_syntax→_cardWhat 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-026 measured