sbom/spdx: always use license ref IDs as is

Always return License ref IDs as is, if used as package license,
regardless if license_expression package is available. This will prevent
wrapping them again as extracted license info and generating yet another
license ref ID.

Signed-off-by: Tomáš Hozza <thozza@redhat.com>
This commit is contained in:
Tomáš Hozza 2025-02-17 06:56:03 +01:00 committed by Tomáš Hozza
parent 35993fe256
commit 551d1f4ef2
2 changed files with 9 additions and 0 deletions

View file

@ -27,6 +27,9 @@ def test_spdxlicenseexpressionfactory_license_expression_availability(licensing_
lf = SpdxLicenseExpressionCreator()
license_expression = lf.ensure_license_expression("MIT")
license_expression2 = lf.ensure_license_expression("LicenseRef-123")
assert license_expression2 == "LicenseRef-123"
if licensing_available:
assert mocked_licensing is not None
# The license string should be a SPDX license expression string.