test_noassertion_and_unaccepted_licences_are_flagged

Tests › tests/test_wiki_sbom.py

passed Passed in the packaged run.

What this test is for

Why it exists

Against the accepted list: Zlib passes, NOASSERTION and WTFPL are flagged.

Given

  1. —
→

When

  1. spdx = read_sbom(_write(tmp_path, "sbom.spdx.json", _SPDX))
  2. cdx = read_sbom(_write(tmp_path, "bom.cdx.json", _CDX))
  3. html = sbom_html([("sbom.spdx.json", *spdx), ("bom.cdx.json", *cdx)], ("MIT", "Zlib"), {}, 0)
  4. rows = { name: html.split(f"<code>{name}</code>", 1)[1].split("</tr>", 1)[0] for name in ("zlib", "weights", "left-pad") }
→

Then

  1. ✓ rows["zlib"] does not contain 'class="flag'
  2. ✓ rows["weights"] contains 'class="flag noassertion"'
  3. ✓ rows["left-pad"] contains 'class="flag unaccepted"'

tests/test_wiki_sbom.py:95 · its file's page

What it checks (3)

  1. assert 'class="flag' not in rows["zlib"] not attributed
  2. assert 'class="flag noassertion"' in rows["weights"] not attributed
  3. assert '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

test_noassertion_and_unaccepted_licences_are_flagged→read_sbom→_write→sbom_html

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.

test_noassertion_and_unaccepted_licences_are_flagged · 3 checksread_sbomREQ-DDB-WIKI-051 · measuredsbom_html_row_acceptedallREQ-DDB-WIKI-054 · inferred
Also reaches 2 requirements

Its run touches their code; that is reach, not proof.