test_issues_link_to_requirements_three_ways_and_never_by_prefix¶
Tests › tests/test_wiki_issues.py
What this test is for
Why it exists
THE ID IN TITLE OR BODY, a `req:` label, a `clew-req:` marker line; `REQ-W-0011` does not link `REQ-W-001`.
Given
issues = [ Issue("1", "REQ-W-001 is slow", "", (), "u1", "open"), Issue("2", "Crash", "", ("req:REQ-X-001",), "u2", "open"), Issue("3", "Other", "details\nclew-req: REQ-W-002\n", (), "u3", "open"), Issue("4", "REQ-W-0011 only", "", (), "u4", "open"), Issue("5", "Unrelated", "", (), "u5", "open"), ]
When
linked, unlinked = link_issues(issues, ["REQ-W-001", "REQ-W-002", "REQ-X-001"])
Then
- ✓ [i.id for i in linked["REQ-W-001"]] equals ["1"]
- ✓ [i.id for i in linked["REQ-X-001"]] equals ["2"]
- ✓ [i.id for i in linked["REQ-W-002"]] equals ["3"]
- ✓ [i.id for i in unlinked] equals ["4", "5"]
tests/test_wiki_issues.py:128 · its file's page
What it checks (4)
assert [i.id for i in linked["REQ-W-001"]] == ["1"]not attributedassert [i.id for i in linked["REQ-X-001"]] == ["2"]not attributedassert [i.id for i in linked["REQ-W-002"]] == ["3"]not attributedassert [i.id for i in unlinked] == ["4", "5"]not attributed
Where the product reaches it
build_wiki→_build_site→_fetch_issues→link_issues(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-028 measured