test_an_spdx_sbom_reads_its_package_and_components

Tests › tests/test_wiki_sbom.py

passed Passed in the packaged run.

What this test is for

Why it exists

SPDX 2.3: the described package's licence, and every other package a component.

Given

  1. —
→

When

  1. package, components = read_sbom(_write(tmp_path, "sbom.spdx.json", _SPDX))
→

Then

  1. ✓ package equals ("demo", "MIT")
  2. ✓ components[0] equals Component( "zlib", "1.3.1", "Zlib", "library", "https://example.invalid/zlib.tar.gz", "SHA256:ab12" )
  3. ✓ components[1].licence equals "NOASSERTION"
  4. ✓ components[1].kind equals "file"

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

What it checks (3)

  1. assert package == ("demo", "MIT") not attributed
  2. assert components[0] == Component( "zlib", "1.3.1", "Zlib", "library", "https://example.invalid/zlib.tar.gz", "SHA256:ab12" ) not attributed
  3. assert components[1].licence == "NOASSERTION" and components[1].kind == "file" 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_an_spdx_sbom_reads_its_package_and_components→read_sbom→_write

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_an_spdx_sbom_reads_its_package_and_components · 3 checksread_sbomREQ-DDB-WIKI-051 · measured
Also reaches 1 requirement

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