test_noassertion_and_unaccepted_licences_are_flagged¶
Tests › tests/test_wiki_sbom.py
What this test is for
Why it exists
Against the accepted list: Zlib passes, NOASSERTION and WTFPL are flagged.
Given
- —
When
spdx = read_sbom(_write(tmp_path, "sbom.spdx.json", _SPDX))cdx = read_sbom(_write(tmp_path, "bom.cdx.json", _CDX))html = sbom_html([("sbom.spdx.json", *spdx), ("bom.cdx.json", *cdx)], ("MIT", "Zlib"), {}, 0)rows = { name: html.split(f"<code>{name}</code>", 1)[1].split("</tr>", 1)[0] for name in ("zlib", "weights", "left-pad") }
Then
- ✓ rows["zlib"] does not contain 'class="flag'
- ✓ rows["weights"] contains 'class="flag noassertion"'
- ✓ rows["left-pad"] contains 'class="flag unaccepted"'
tests/test_wiki_sbom.py:95 · its file's page
What it checks (3)
assert 'class="flag' not in rows["zlib"]not attributedassert 'class="flag noassertion"' in rows["weights"]not attributedassert 'class="flag unaccepted"' in rows["left-pad"]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
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 2 requirements
Its run touches their code; that is reach, not proof.
- REQ-DDB-WIKI-051 measured
- REQ-DDB-WIKI-054 inferred