|
1 | 1 | import pytest
|
2 | 2 |
|
3 | 3 | from pyp2spec.license_processor import classifiers_to_spdx_identifiers, license_keyword_to_spdx_identifiers
|
4 |
| -from pyp2spec.license_processor import _is_compliant_with_fedora, good_for_fedora |
| 4 | +from pyp2spec.license_processor import _is_compliant_with_fedora |
5 | 5 | from pyp2spec.license_processor import NoSuchClassifierError, check_compliance, generate_spdx_expression
|
6 | 6 |
|
7 | 7 |
|
@@ -82,21 +82,6 @@ def test_compliance_check_with_fedora(identifier, expected, fake_fedora_licenses
|
82 | 82 | assert _is_compliant_with_fedora(identifier, fake_fedora_licenses) is expected
|
83 | 83 |
|
84 | 84 |
|
85 |
| -@pytest.mark.parametrize( |
86 |
| - ("identifiers", "expected"), |
87 |
| - ( |
88 |
| - (["AAL", "MIT", "CECILL-B"], (True, {"bad": [], "good": ["AAL", "MIT", "CECILL-B"]})), |
89 |
| - ([], (False, {"bad": [], "good": []})), |
90 |
| - (["LicenseRef-LPPL", "MIT"], (False, {"bad": ["LicenseRef-LPPL"], "good": ["MIT"]})), # mixed not allowed/allowed |
91 |
| - (["LicenseRef-LPPL", "Aladdin", "LicenseRef-OpenFlow", "APL-1.0"], (False, {"bad": ["LicenseRef-LPPL", "Aladdin", "LicenseRef-OpenFlow", "APL-1.0"], "good": []})), |
92 |
| - ), |
93 |
| -) |
94 |
| -def test_is_allowed_in_fedora(identifiers, expected, fake_fedora_licenses): |
95 |
| - """Test the function logic, bear in mind that Fedora status may change in time""" |
96 |
| - |
97 |
| - assert good_for_fedora(identifiers, licenses_dict=fake_fedora_licenses) == expected |
98 |
| - |
99 |
| - |
100 | 85 | def test_no_license_classifiers_and_no_license_keyword():
|
101 | 86 | classifiers = []
|
102 | 87 | license_keyword = ""
|
@@ -151,6 +136,10 @@ def test_license_keyword_and_classifiers():
|
151 | 136 | ("MIT AND EUPL-1.0", ["MIT"], ["EUPL-1.0"], False),
|
152 | 137 | ("RSCPL", [], ["RSCPL"], False),
|
153 | 138 | ("Fake-identifier", [], [], False), # not a valid identifier, ergo not in "bad" list
|
| 139 | + ("AAL AND MIT AND CECILL-B", ["AAL", "CECILL-B", "MIT"], [], True), |
| 140 | + ("", [], [], False), |
| 141 | +
|
| 142 | +
|
154 | 143 | )
|
155 | 144 | )
|
156 | 145 | def test_check_compliance(license, good, bad, expected, fake_fedora_licenses):
|
|
0 commit comments