|
18 | 18 |
|
19 | 19 |
|
20 | 20 | @pytest.mark.parametrize(
|
21 |
| - "parent_node_object, license_id, extracted_text, comment, license_name, cross_references", |
| 21 | + "license_id, extracted_text, comment, license_name, cross_references", |
22 | 22 | [
|
23 | 23 | (
|
24 |
| - SPDX_NAMESPACE.SpdxDocument, |
25 | 24 | "LicenseRef-1",
|
26 | 25 | "extractedText",
|
27 | 26 | "licenseComment",
|
28 | 27 | "licenseName",
|
29 | 28 | ["https://see.also"],
|
30 | 29 | ),
|
31 | 30 | (
|
32 |
| - SPDX_NAMESPACE.Package, |
33 | 31 | "LicenseRef-2",
|
34 | 32 | "extractedText",
|
35 | 33 | "licenseComment",
|
|
38 | 36 | ),
|
39 | 37 | ],
|
40 | 38 | )
|
41 |
| -def test_parse_extracted_licensing_info( |
42 |
| - parent_node_object, license_id, extracted_text, comment, license_name, cross_references |
43 |
| -): |
| 39 | +# In rdf, as a short form, the explicit node for licenseId can be omitted, since the ID is also encoded in the URIRef |
| 40 | +# of the ExtractedLicensingInfo node. The first test case has an explicit licenseId node whereas the second test case |
| 41 | +# does not. This behaviour is similar to the externalDocumentRefId, see the discussion here: |
| 42 | +# https://github.com/spdx/spdx-spec/issues/816 |
| 43 | +def test_parse_extracted_licensing_info(license_id, extracted_text, comment, license_name, cross_references): |
44 | 44 | graph = Graph().parse(os.path.join(os.path.dirname(__file__), "data/file_to_test_rdf_parser.rdf.xml"))
|
45 | 45 | doc_namespace = "https://some.namespace"
|
46 | 46 | extracted_licensing_info_node = get_extracted_licensing_info_node_by_license_id(graph, license_id)
|
|
0 commit comments