diff --git a/cve_bin_tool/mismatch_data/pypi/arrow/mismatch_relations.yml b/cve_bin_tool/mismatch_data/pypi/arrow/mismatch_relations.yml new file mode 100644 index 0000000000..cb2b663f47 --- /dev/null +++ b/cve_bin_tool/mismatch_data/pypi/arrow/mismatch_relations.yml @@ -0,0 +1,5 @@ +--- +purls: + - pkg:pypi/arrow +invalid_vendors: + - apache \ No newline at end of file diff --git a/test/test_no_scan_mode.py b/test/test_no_scan_mode.py new file mode 100644 index 0000000000..776c849c90 --- /dev/null +++ b/test/test_no_scan_mode.py @@ -0,0 +1,34 @@ +from cve_bin_tool.sbom_manager.generate import SBOMGenerate + +class FakeProduct: + def __init__(self, name, version): + self.product = name + self.version = version + self.source = "manual" + self.vendor = "UNKNOWN" + +def test_generate_sbom_without_scan(tmp_path): + output_file = tmp_path / "sbom.json" + + # Fake scan result object + fake_product = FakeProduct("zlib", "1.2.11") + + all_product_data = [fake_product] + all_cve_data = {} + + sbomgen = SBOMGenerate( + all_product_data=all_product_data, + all_cve_data=all_cve_data, + filename=str(output_file), + sbom_type="spdx", + sbom_format="tag", + sbom_root="CVE_BIN_TOOL_TEST" + ) + + sbomgen.generate_sbom() + + # Check the output file + assert output_file.exists() + content = output_file.read_text() + assert "zlib" in content + assert "1.2.11" in content \ No newline at end of file