diff --git a/licomp_toolkit/data/reply_schema.json b/licomp_toolkit/data/reply_schema.json index d02713a..916f275 100644 --- a/licomp_toolkit/data/reply_schema.json +++ b/licomp_toolkit/data/reply_schema.json @@ -244,8 +244,11 @@ "description" : "The compatbility between the Outbound and Inbound license expressions" }, "explanation" : { - "type" : [ "string", "null" ], - "description" : "A text describing the compatiblity, e.g. how the compatibility was determined" + "type" : "array" , + "items": { + "type" : "string" + }, + "description" : "A list of texts describing the compatiblity, e.g. how the compatibility was determined" }, "api_version" : { "type" : "string", diff --git a/licomp_toolkit/toolkit.py b/licomp_toolkit/toolkit.py index c86df09..ae3f7ab 100644 --- a/licomp_toolkit/toolkit.py +++ b/licomp_toolkit/toolkit.py @@ -18,6 +18,8 @@ from licomp_dwheeler.dwheeler import LicompDw from licomp_hermione.hermione import LicompHermione from licomp_gnuguide.gnuguide import GnuQuickGuideLicense +from licomp_oslc_handbook.oslc_handbook import LicompOslcHandbook +from licomp_doubleopen.doubleopen import LicompDoubleOpen from licomp_toolkit.config import disclaimer from licomp_toolkit.config import licomp_toolkit_version @@ -47,7 +49,7 @@ def __init__(self): self._licomp_resources[licomp_instance.name()] = licomp_instance self._licomp_resources_optional = {} - for licomp in [LicompHermione, LicompProprietary, LicompDw, GnuQuickGuideLicense]: + for licomp in [LicompHermione, LicompProprietary, LicompDw, GnuQuickGuideLicense, LicompOslcHandbook, LicompDoubleOpen]: licomp_instance = licomp() self._licomp_resources_optional[licomp_instance.name()] = licomp_instance diff --git a/requirements.txt b/requirements.txt index 01323f7..4bfada0 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,5 +5,7 @@ licomp-dwheeler == 0.5.* licomp-proprietary == 0.5.* licomp-hermione == 0.5.* licomp-gnuguide == 0.5.* +licomp-doubleopen == 0.1.* +licomp-oslc-handbook == 0.1.* foss-flame PyYaml diff --git a/tests/python/test_resources.py b/tests/python/test_resources.py index d21c2fc..d4a7c10 100644 --- a/tests/python/test_resources.py +++ b/tests/python/test_resources.py @@ -27,6 +27,8 @@ def test_supported_resources(): assert "licomp_hermione" in resource_names assert "licomp_dwheeler" in resource_names assert "licomp_gnuguide" in resource_names + assert "licomp_oslc_handbook" in resource_names + assert "licomp_doubleopen" in resource_names def test_supported_resources_standard(): assert "licomp_reclicense" in standard_resource_names @@ -35,6 +37,8 @@ def test_supported_resources_standard(): assert "licomp_hermione" not in standard_resource_names assert "licomp_dwheeler" not in standard_resource_names assert "licomp_gnuguide" not in standard_resource_names + assert "licomp_oslc_handbook" in standard_resource_names + assert "licomp_doubleopen" in standard_resource_names def test_supported_resources_standard(): assert "licomp_reclicense" not in optional_resource_names @@ -43,3 +47,5 @@ def test_supported_resources_standard(): assert "licomp_hermione" in optional_resource_names assert "licomp_dwheeler" in optional_resource_names assert "licomp_gnuguide" in optional_resource_names + assert "licomp_oslc_handbook" in optional_resource_names + assert "licomp_doubleopen" in optional_resource_names diff --git a/tests/python/test_toolkit.py b/tests/python/test_toolkit.py index 03c4761..8057182 100644 --- a/tests/python/test_toolkit.py +++ b/tests/python/test_toolkit.py @@ -32,19 +32,18 @@ def test_provisioning_is_not_supported(): def test_compat(): ret = lt.outbound_inbound_compatibility("GPL-2.0-only", "BSD-3-Clause", UseCase.LIBRARY, Provisioning.BIN_DIST) logging.debug("ret: " + str(ret['summary']['results'])) - print("... hesa: " + str(ret['summary']['results']['yes'])) - assert ret['summary']['results']['yes']['count'] == 4 + assert ret['summary']['results']['yes']['count'] == 5 -def test_incompat(): +def test_incompat_1(): ret = lt.outbound_inbound_compatibility("BSD-3-Clause", "GPL-2.0-only", UseCase.LIBRARY, Provisioning.BIN_DIST) logging.debug("ret: " + str(ret['summary']['results'])) - assert ret['summary']['results']['no']['count'] == 2 + assert ret['summary']['results']['no']['count'] == 5 -def test_incompat(): +def test_incompat_2(): ret = lt.outbound_inbound_compatibility("BSD-3-Clause", "GPL-2.0-only", UseCase.LIBRARY, Provisioning.WEBUI) logging.debug("ret: " + str(ret['summary']['statuses'])) # all five resources fail on webui - assert len(ret['summary']['statuses']['failure']) == 6 + assert len(ret['summary']['statuses']['failure']) == 8 def test_disclaimer(): logging.debug(f'check disclaimer') diff --git a/tests/shell/test-cli.sh b/tests/shell/test-cli.sh index e3b6ace..c0c5f69 100755 --- a/tests/shell/test-cli.sh +++ b/tests/shell/test-cli.sh @@ -66,7 +66,7 @@ test_version() test_licomp_tk_text "--version" "" "$LT_VERSION" test_licomp_tk_text "--name" "" licomp-toolkit test_licomp_tk_text " -of text versions" "| head -1" "licomp-toolkit: $LT_VERSION" - test_licomp_tk_text " -of text versions" "| wc -l" "7" + test_licomp_tk_text " -of text versions" "| wc -l" "9" } test_supp_unsupp() @@ -101,23 +101,23 @@ test_snippet_bindist() test_supports_license() { echo "# supports license" - test_licomp_tk_text " -of text supports-license MIT" " | wc -l" 6 - test_licomp_tk_text " -of json supports-license MIT" " | jq .[].name | wc -l" 6 - test_licomp_tk_text " supports-license MIT" " | jq .[].name | wc -l" 6 + test_licomp_tk_text " -of text supports-license MIT" " | wc -l" 8 + test_licomp_tk_text " -of json supports-license MIT" " | jq .[].name | wc -l" 8 + test_licomp_tk_text " supports-license MIT" " | jq .[].name | wc -l" 8 } test_supports_provisioning() { echo "# supports provisioning" - test_licomp_tk_text " -of text supports-provisioning binary-distribution" " | wc -l" 6 + test_licomp_tk_text " -of text supports-provisioning binary-distribution" " | wc -l" 8 test_licomp_tk_text " -of text supports-provisioning provide-webui" " | grep -v \"^$\" | wc -l " 0 } test_supports_usecase() { echo "# supports usecase" - test_licomp_tk_text " -of text supports-usecase snippet" " | wc -l" 1 - test_licomp_tk_text " -of text supports-usecase library" " | wc -l " 5 + test_licomp_tk_text " -of text supports-usecase snippet" " | wc -l" 2 + test_licomp_tk_text " -of text supports-usecase library" " | wc -l " 6 } @@ -128,4 +128,3 @@ test_snippet_bindist test_supports_license test_supports_provisioning test_supports_usecase - diff --git a/tests/shell/test_validate.sh b/tests/shell/test_validate.sh index b92df2a..12f2b8e 100755 --- a/tests/shell/test_validate.sh +++ b/tests/shell/test_validate.sh @@ -77,11 +77,12 @@ incompatibles() validate_reply "GPL-2.0-only" "BSD-2-Clause AND Apache-2.0" 2 0 validate_reply "BSD-2-Clause AND Apache-2.0" "GPL-2.0-only" 2 0 validate_reply "Apache-2.0" "GPL-2.0-only" 2 0 + echo --------------------------------------------- validate_reply "Apache-2.0" "GPL-3.0-only" 9 0 " -r all" } echo "Compatibles" -compatibles +#compatibles echo "Incompatibles" incompatibles rm $REPLY_FILE