-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #140 from hesa/hesa-update-py-meta
Update pyhton setup.py, add tests for external matrix
- Loading branch information
Showing
7 changed files
with
78 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"BSD-3-Clause": { | ||
"BSD-3-Clause": "Same", | ||
"Dummy": "Yes", | ||
"GPL-2.0-or-later": "No" | ||
}, | ||
"Dummy": { | ||
"BSD-3-Clause": "No", | ||
"Dummy": "Same", | ||
"GPL-2.0-or-later": "No" | ||
}, | ||
"GPL-2.0-or-later": { | ||
"BSD-3-Clause": "Yes", | ||
"Dummy": "Yes", | ||
"GPL-2.0-or-later": "Same" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# SPDX-FileCopyrightText: 2024 Henrik Sandklef | ||
# | ||
# SPDX-License-Identifier: GPL-3.0-or-later | ||
|
||
import pytest | ||
|
||
from flame.exception import FlameException | ||
from flame.license_db import FossLicenses, Validation | ||
import logging | ||
|
||
fl_default = FossLicenses(config={ | ||
'duals_file': 'tests/licenses-additional/duals.json', | ||
'compunds_file': 'tests/licenses-additional/compounds.json', | ||
'check': True, | ||
'license-dir': 'tests/licenses', | ||
'level': 'logging.INFO'}) | ||
fl_matrix = FossLicenses(config={ | ||
'duals_file': 'tests/licenses-additional/duals.json', | ||
'compunds_file': 'tests/licenses-additional/compounds.json', | ||
'check': True, | ||
'license-dir': 'tests/licenses', | ||
'level': 'logging.INFO', | ||
'license-matrix-file': 'tests/mini-matrix.json'}) | ||
|
||
def test_licenses(): | ||
licenses = fl_default.licenses() | ||
assert len(licenses) == 6 | ||
|
||
def test_compat_default(): | ||
compat = fl_default.expression_compatibility_as("MIT") | ||
assert compat['compat_license'] == 'MIT' | ||
|
||
def test_compat_matrix_mit(): | ||
compat = fl_default.expression_compatibility_as("MIT", validations=[Validation.OSADL]) | ||
assert compat['compat_license'] == 'MIT' | ||
|
||
def test_compat_matrix_unknown(): | ||
compat = fl_default.expression_compatibility_as("unknown") | ||
assert compat['compat_license'] == 'unknown' | ||
|
||
def test_compat_matrix_unknown_validate(): | ||
with pytest.raises(FlameException): | ||
compat = fl_default.expression_compatibility_as("unknown", validations=[Validation.OSADL]) | ||
|