|
17 | 17 | from spdx.model.checksum import Checksum, ChecksumAlgorithm |
18 | 18 | from spdx.model.document import Document |
19 | 19 | from spdx.model.package import Package, PackagePurpose, PackageVerificationCode |
20 | | -from spdx.model.relationship import RelationshipType |
21 | 20 | from spdx.model.spdx_no_assertion import SPDX_NO_ASSERTION_STRING, SpdxNoAssertion |
22 | 21 | from spdx.model.spdx_none import SPDX_NONE_STRING, SpdxNone |
23 | 22 | from tests.spdx.fixtures import ( |
24 | 23 | annotation_fixture, |
25 | 24 | creation_info_fixture, |
26 | 25 | document_fixture, |
27 | 26 | external_package_ref_fixture, |
28 | | - file_fixture, |
29 | 27 | package_fixture, |
30 | | - relationship_fixture, |
31 | | - snippet_fixture, |
32 | 28 | ) |
33 | 29 | from tests.spdx.mock_utils import assert_mock_method_called_with_arguments |
34 | 30 |
|
@@ -66,7 +62,6 @@ def converter( |
66 | 62 | (PackageProperty.DOWNLOAD_LOCATION, "downloadLocation"), |
67 | 63 | (PackageProperty.EXTERNAL_REFS, "externalRefs"), |
68 | 64 | (PackageProperty.FILES_ANALYZED, "filesAnalyzed"), |
69 | | - (PackageProperty.HAS_FILES, "hasFiles"), |
70 | 65 | (PackageProperty.HOMEPAGE, "homepage"), |
71 | 66 | (PackageProperty.LICENSE_COMMENTS, "licenseComments"), |
72 | 67 | (PackageProperty.LICENSE_CONCLUDED, "licenseConcluded"), |
@@ -230,7 +225,6 @@ def test_null_values(converter: PackageConverter): |
230 | 225 | assert converter.json_property_name(PackageProperty.ATTRIBUTION_TEXTS) not in converted_dict |
231 | 226 | assert converter.json_property_name(PackageProperty.CHECKSUMS) not in converted_dict |
232 | 227 | assert converter.json_property_name(PackageProperty.EXTERNAL_REFS) not in converted_dict |
233 | | - assert converter.json_property_name(PackageProperty.HAS_FILES) not in converted_dict |
234 | 228 | assert converter.json_property_name(PackageProperty.LICENSE_INFO_FROM_FILES) not in converted_dict |
235 | 229 |
|
236 | 230 |
|
@@ -314,45 +308,3 @@ def test_package_annotations(converter: PackageConverter): |
314 | 308 | ) |
315 | 309 | converted_file_annotations = converted_dict.get(converter.json_property_name(PackageProperty.ANNOTATIONS)) |
316 | 310 | assert converted_file_annotations == ["mock_converted_annotation", "mock_converted_annotation"] |
317 | | - |
318 | | - |
319 | | -def test_has_files(converter: PackageConverter): |
320 | | - package = package_fixture() |
321 | | - first_contained_file = file_fixture(spdx_id="firstFileId") |
322 | | - second_contained_file = file_fixture(spdx_id="secondFileId") |
323 | | - non_contained_file = file_fixture(spdx_id="otherFileId") |
324 | | - snippet = snippet_fixture() |
325 | | - document = document_fixture( |
326 | | - packages=[package], files=[first_contained_file, second_contained_file, non_contained_file], snippets=[snippet] |
327 | | - ) |
328 | | - package_contains_file_relationship = relationship_fixture( |
329 | | - spdx_element_id=package.spdx_id, |
330 | | - relationship_type=RelationshipType.CONTAINS, |
331 | | - related_spdx_element_id=first_contained_file.spdx_id, |
332 | | - ) |
333 | | - file_contained_in_package_relationship = relationship_fixture( |
334 | | - spdx_element_id=second_contained_file.spdx_id, |
335 | | - relationship_type=RelationshipType.CONTAINED_BY, |
336 | | - related_spdx_element_id=package.spdx_id, |
337 | | - ) |
338 | | - package_contains_snippet_relationship = relationship_fixture( |
339 | | - spdx_element_id=package.spdx_id, |
340 | | - relationship_type=RelationshipType.CONTAINS, |
341 | | - related_spdx_element_id=snippet.spdx_id, |
342 | | - ) |
343 | | - package_describes_file_relationship = relationship_fixture( |
344 | | - spdx_element_id=package.spdx_id, |
345 | | - relationship_type=RelationshipType.DESCRIBES, |
346 | | - related_spdx_element_id=non_contained_file.spdx_id, |
347 | | - ) |
348 | | - document.relationships = [ |
349 | | - package_contains_file_relationship, |
350 | | - file_contained_in_package_relationship, |
351 | | - package_contains_snippet_relationship, |
352 | | - package_describes_file_relationship, |
353 | | - ] |
354 | | - |
355 | | - converted_dict = converter.convert(package, document) |
356 | | - |
357 | | - has_files = converted_dict.get(converter.json_property_name(PackageProperty.HAS_FILES)) |
358 | | - assert has_files == [first_contained_file.spdx_id, second_contained_file.spdx_id] |
0 commit comments