Skip to content

Commit

Permalink
[review] add explanation for tests
Browse files Browse the repository at this point in the history
Signed-off-by: Meret Behrens <meret.behrens@tngtech.com>
  • Loading branch information
meretp committed Mar 30, 2023
1 parent 5a72c4a commit b5374ad
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/spdx/parser/rdf/test_extracted_licensing_info_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,16 @@


@pytest.mark.parametrize(
"parent_node_object, license_id, extracted_text, comment, license_name, cross_references",
"license_id, extracted_text, comment, license_name, cross_references",
[
(
SPDX_NAMESPACE.SpdxDocument,
"LicenseRef-1",
"extractedText",
"licenseComment",
"licenseName",
["https://see.also"],
),
(
SPDX_NAMESPACE.Package,
"LicenseRef-2",
"extractedText",
"licenseComment",
Expand All @@ -38,9 +36,11 @@
),
],
)
def test_parse_extracted_licensing_info(
parent_node_object, license_id, extracted_text, comment, license_name, cross_references
):
# In rdf, as a short form, the explicit node for licenseId can be omitted, since the ID is also encoded in the URIRef
# of the ExtractedLicensingInfo node. The first test case has an explicit licenseId node whereas the second test case
# does not. This behaviour is similar to the externalDocumentRefId, see the discussion here:
# https://github.com/spdx/spdx-spec/issues/816
def test_parse_extracted_licensing_info(license_id, extracted_text, comment, license_name, cross_references):
graph = Graph().parse(os.path.join(os.path.dirname(__file__), "data/file_to_test_rdf_parser.rdf.xml"))
doc_namespace = "https://some.namespace"
extracted_licensing_info_node = get_extracted_licensing_info_node_by_license_id(graph, license_id)
Expand Down

0 comments on commit b5374ad

Please sign in to comment.