From b80559abdd9d0545c8281c206e42e92802ca1f27 Mon Sep 17 00:00:00 2001 From: Carmen Date: Tue, 18 Jun 2024 18:12:16 +0200 Subject: [PATCH 1/4] fix import error --- src/actinia_tiling_plugin/__init__.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/actinia_tiling_plugin/__init__.py b/src/actinia_tiling_plugin/__init__.py index ac3ff08..c39be44 100644 --- a/src/actinia_tiling_plugin/__init__.py +++ b/src/actinia_tiling_plugin/__init__.py @@ -25,13 +25,11 @@ __maintainer__ = "mundialis GmbH % Co. KG" -from pkg_resources import get_distribution, DistributionNotFound +import importlib.metadata try: # Change here if project is renamed and does not equal the package name - dist_name = __name__ - __version__ = get_distribution(dist_name).version -except DistributionNotFound: - __version__ = "unknown" -finally: - del get_distribution, DistributionNotFound + dist_name = 'actinia_metadata_plugin.wsgi' + __version__ = importlib.metadata.version(dist_name) +except Exception: + __version__ = 'unknown' From cbd2d430819aa70c1081671b86026da597f71422 Mon Sep 17 00:00:00 2001 From: Carmen Date: Tue, 18 Jun 2024 18:20:16 +0200 Subject: [PATCH 2/4] debug test --- tests/integrationtests/test_grid_tiling.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/integrationtests/test_grid_tiling.py b/tests/integrationtests/test_grid_tiling.py index d7507ae..eeb54cc 100644 --- a/tests/integrationtests/test_grid_tiling.py +++ b/tests/integrationtests/test_grid_tiling.py @@ -96,7 +96,8 @@ def test_get_grid_apidocs(self): url = f"{self.base_url}/tiling_processes/grid" resp = self.server.get(url, headers=self.user_auth_header) - assert type(resp) is Response, "The response is not of type Response" + # assert type(resp) is Response, "The response is not of type Response" + print(type(resp)) assert resp.status_code == 200, "The status code is not 200" assert "description" in resp.json, "No 'description' in response" assert "parameters" in resp.json, "No 'parameters' in response" From e6eea856ac4f064441d4ae8263933efee3bebda3 Mon Sep 17 00:00:00 2001 From: Carmen Date: Tue, 18 Jun 2024 18:21:54 +0200 Subject: [PATCH 3/4] debug test --- tests/integrationtests/test_grid_tiling.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integrationtests/test_grid_tiling.py b/tests/integrationtests/test_grid_tiling.py index eeb54cc..0fb693c 100644 --- a/tests/integrationtests/test_grid_tiling.py +++ b/tests/integrationtests/test_grid_tiling.py @@ -26,7 +26,7 @@ import pytest -from flask import Response +# from flask import Response from ..test_resource_base import URL_PREFIX from ..test_resource_base import ActiniaResourceTestCaseBase From 19272c6b28ebc4644cf60e996ebc88a8a9cad38c Mon Sep 17 00:00:00 2001 From: Carmen Date: Tue, 18 Jun 2024 18:28:38 +0200 Subject: [PATCH 4/4] debug test --- tests/integrationtests/test_grid_tiling.py | 2 -- tests/integrationtests/test_list_merge.py | 2 -- tests/integrationtests/test_list_tiling.py | 2 -- tests/integrationtests/test_patch_merge.py | 2 -- 4 files changed, 8 deletions(-) diff --git a/tests/integrationtests/test_grid_tiling.py b/tests/integrationtests/test_grid_tiling.py index 0fb693c..e3ccb0e 100644 --- a/tests/integrationtests/test_grid_tiling.py +++ b/tests/integrationtests/test_grid_tiling.py @@ -26,7 +26,6 @@ import pytest -# from flask import Response from ..test_resource_base import URL_PREFIX from ..test_resource_base import ActiniaResourceTestCaseBase @@ -96,7 +95,6 @@ def test_get_grid_apidocs(self): url = f"{self.base_url}/tiling_processes/grid" resp = self.server.get(url, headers=self.user_auth_header) - # assert type(resp) is Response, "The response is not of type Response" print(type(resp)) assert resp.status_code == 200, "The status code is not 200" assert "description" in resp.json, "No 'description' in response" diff --git a/tests/integrationtests/test_list_merge.py b/tests/integrationtests/test_list_merge.py index ab6129b..77a6fef 100644 --- a/tests/integrationtests/test_list_merge.py +++ b/tests/integrationtests/test_list_merge.py @@ -26,7 +26,6 @@ import pytest -from flask import Response from ..test_resource_base import URL_PREFIX from ..test_resource_base import ActiniaResourceTestCaseBase @@ -69,7 +68,6 @@ def test_get_merge_apidocs(self): url = f"{self.base_url}/merge_processes" resp = self.server.get(url, headers=self.user_auth_header) - assert type(resp) is Response, "The response is not of type Response" assert resp.status_code == 200, "The status code is not 200" assert "merge_processes" in resp.json[0], \ "No 'merge_processes' in response" diff --git a/tests/integrationtests/test_list_tiling.py b/tests/integrationtests/test_list_tiling.py index ef66eec..5fc21f2 100644 --- a/tests/integrationtests/test_list_tiling.py +++ b/tests/integrationtests/test_list_tiling.py @@ -26,7 +26,6 @@ import pytest -from flask import Response from ..test_resource_base import URL_PREFIX from ..test_resource_base import ActiniaResourceTestCaseBase @@ -69,7 +68,6 @@ def test_get_tiling_list_apidocs(self): url = f"{self.base_url}/tiling_processes" resp = self.server.get(url, headers=self.user_auth_header) - assert type(resp) is Response, "The response is not of type Response" assert resp.status_code == 200, "The status code is not 200" assert "tiling_processes" in resp.json[0], \ "No 'tiling_processes' in response" diff --git a/tests/integrationtests/test_patch_merge.py b/tests/integrationtests/test_patch_merge.py index 75d2f8b..40a65be 100644 --- a/tests/integrationtests/test_patch_merge.py +++ b/tests/integrationtests/test_patch_merge.py @@ -26,7 +26,6 @@ import pytest -from flask import Response from flask.json import loads as json_loads from jinja2 import Template @@ -290,7 +289,6 @@ def test_get_patch_apidocs(self): url = f"{self.base_url}/merge_processes/patch" resp = self.server.get(url, headers=self.user_auth_header) - assert type(resp) is Response, "The response is not of type Response" assert resp.status_code == 200, "The status code is not 200" assert "description" in resp.json, "No 'description' in response" assert "parameters" in resp.json, "No 'parameters' in response"