3838from spdx_tools .spdx3 .model .licensing import (
3939 CustomLicense ,
4040 CustomLicenseAddition ,
41- LicenseField ,
4241 ListedLicense ,
4342 ListedLicenseException ,
4443)
44+ from spdx_tools .spdx3 .model .positive_integer_range import PositiveIntegerRange
4545from spdx_tools .spdx3 .model .security import (
4646 CvssV2VulnAssessmentRelationship ,
4747 CvssV3VulnAssessmentRelationship ,
@@ -164,6 +164,39 @@ def namespace_map_fixture(
164164 return NamespaceMap (prefix = prefix , namespace = namespace )
165165
166166
167+ def listed_license_fixture (
168+ license_id = "https://spdx.test/tools-python/license_id" ,
169+ license_name = "license name" ,
170+ license_text = "license text" ,
171+ license_comment = "license comment" ,
172+ see_also = None ,
173+ is_osi_approved = True ,
174+ is_fsf_libre = True ,
175+ standard_license_header = "license header" ,
176+ standard_license_template = "license template" ,
177+ is_deprecated_license_id = True ,
178+ obsoleted_by = "https://spdx.test/tools-python/obsoleted_by_license_id" ,
179+ list_version_added = "2.1" ,
180+ deprecated_version = "2.2" ,
181+ ):
182+ see_also = ["https://see.also/license" ] if see_also is None else see_also
183+ return ListedLicense (
184+ license_id = license_id ,
185+ license_name = license_name ,
186+ license_text = license_text ,
187+ license_comment = license_comment ,
188+ see_also = see_also ,
189+ is_osi_approved = is_osi_approved ,
190+ is_fsf_libre = is_fsf_libre ,
191+ standard_license_header = standard_license_header ,
192+ standard_license_template = standard_license_template ,
193+ is_deprecated_license_id = is_deprecated_license_id ,
194+ obsoleted_by = obsoleted_by ,
195+ list_version_added = list_version_added ,
196+ deprecated_version = deprecated_version ,
197+ )
198+
199+
167200ELEMENT_DICT = {
168201 "spdx_id" : "https://spdx.test/tools-python/element_fixture" ,
169202 "creation_info" : creation_info_fixture (),
@@ -346,9 +379,9 @@ def namespace_map_fixture(
346379
347380SOFTWARE_ARTIFACT_DICT = {
348381 "content_identifier" : "https://spdx.test/tools-python/contentIdentifier" ,
349- "purpose" : SoftwarePurpose .OTHER ,
350- "concluded_license" : LicenseField ,
351- "declared_license" : LicenseField ,
382+ "purpose" : [ SoftwarePurpose .OTHER ] ,
383+ "concluded_license" : listed_license_fixture () ,
384+ "declared_license" : listed_license_fixture () ,
352385 "copyright_text" : "copyrightText" ,
353386 "attribution_text" : "attributionText" ,
354387}
@@ -363,7 +396,7 @@ def namespace_map_fixture(
363396 "source_info" : "sourceInfo" ,
364397}
365398
366- SNIPPET_DICT = {"byte_range" : (1024 , 2048 ), "line_range" : (1 , 4 )}
399+ SNIPPET_DICT = {"byte_range" : PositiveIntegerRange (1024 , 2048 ), "line_range" : PositiveIntegerRange (1 , 4 )}
367400
368401SOFTWARE_DEPENDENCY_RELATIONSHIP_DICT = {
369402 "software_linkage" : SoftwareDependencyLinkType .OTHER ,
@@ -385,7 +418,6 @@ def namespace_map_fixture(
385418 "dataset_availability" : DatasetAvailabilityType .QUERY ,
386419}
387420
388-
389421FIXTURE_DICTS = {
390422 Agent : [ELEMENT_DICT ],
391423 Person : [ELEMENT_DICT ],
0 commit comments