tests.test_sbom_base moduleΒΆ
The two failure modes need opposite remedies, so they cannot share a message.
A distribution shipping a writer library below the floor already satisfies
[sbom-offline], so telling its user to install that extra strands them: they install it again, nothing changes, and the only clue left is a symbol name belonging to no package they can name. NixOS carries exactly such acyclonedx-python-lib.
- tests.test_sbom_base.test_spdx_names_a_missing_packageurl_python()[source]ΒΆ
A missing packageurl-python disables the SPDX writer under its own name.
spdx-tools does not depend on it, so an install can carry spdx-tools alone. A message calling spdx-tools too old would send the user to upgrade the wrong package. Runs in a fresh interpreter, where a blocked
packageurlimport and a hidden distribution stand for the missing one.
- class tests.test_sbom_base.CannedStatsSBOM(stats)[source]ΒΆ
Bases:
SBOMA document reporting fixed statistics, to drive the summary adapter.
Defaults to JSON export format.
- stats()[source]ΒΆ
Return a summary of what landed in the document.
Format-agnostic counters live in the base implementation; SPDX and CycloneDX subclasses extend the returned dict with their own merged-documents, dependency-graph, and any other format-specific counts. Surfaced by the CLI as a post-run INFO-level summary and usable by tests or programmatic consumers without re-parsing the rendered document.
- tests.test_sbom_base.test_sbom_summary_notes(stats, bundled, notes)[source]ΒΆ
Each note appears when the run produced what it counts, and only then.