From b0923df07de4bee4acd428d1e57aa26048ea032e Mon Sep 17 00:00:00 2001 From: moritzsommer Date: Wed, 29 May 2024 06:45:05 +0200 Subject: [PATCH] Adapt ci oss and formatting of tests --- .github/workflows/ci.yml | 13 +++++++-- test/test_resolving_service.py | 49 +++++++++++++++++++++++----------- 2 files changed, 44 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 757a553..c650d37 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,16 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-latest, windows-latest] + os: + - ubuntu-latest + - ubuntu-22.04 + - ubuntu-20.04 + - windows-latest + - windows-2022 + - windows-2019 + - macos-latest + - macos-12 + - macos-11 steps: - name: Checkout code @@ -26,4 +35,4 @@ jobs: run: pip install -r requirements.txt - name: Run Python Tests - run: python -m unittest discover \ No newline at end of file + run: python -m unittest discover diff --git a/test/test_resolving_service.py b/test/test_resolving_service.py index 26daeeb..de602e8 100644 --- a/test/test_resolving_service.py +++ b/test/test_resolving_service.py @@ -68,36 +68,53 @@ def run_server_context(): class TestSemanticMatchingService(unittest.TestCase): def test_semantic_matching_service_iri(self): + # TODO deposit DNS record with run_server_context(): sms_request = SMSRequest(semantic_id="foo://example.org:1234/over/there?name=bar#page=3") - response = requests.get("http://localhost:8125/get_semantic_matching_service", - data=sms_request.model_dump_json()) - self.assertEqual("https://example.org/fallback_semantic_matching_service", - response.json()["semantic_matching_service_endpoint"]) + response = requests.get( + "http://localhost:8125/get_semantic_matching_service", + data=sms_request.model_dump_json() + ) + self.assertEqual( + "https://example.org/fallback_semantic_matching_service", + response.json()["semantic_matching_service_endpoint"] + ) def test_semantic_matching_service_irdi_eclass(self): with run_server_context(): sms_request = SMSRequest(semantic_id="0173-1#01-ACK323#017") - response = requests.get("http://localhost:8125/get_semantic_matching_service", - data=sms_request.model_dump_json()) - self.assertEqual("https://example.org/eclass_semantic_matching_service", - response.json()["semantic_matching_service_endpoint"]) + response = requests.get( + "http://localhost:8125/get_semantic_matching_service", + data=sms_request.model_dump_json() + ) + self.assertEqual( + "https://example.org/eclass_semantic_matching_service", + response.json()["semantic_matching_service_endpoint"] + ) def test_semantic_matching_service_irdi_cdd(self): with run_server_context(): sms_request = SMSRequest(semantic_id="0112-1#01-ACK323#017") - response = requests.get("http://localhost:8125/get_semantic_matching_service", - data=sms_request.model_dump_json()) - self.assertEqual("https://example.org/cdd_semantic_matching_service", - response.json()["semantic_matching_service_endpoint"]) + response = requests.get( + "http://localhost:8125/get_semantic_matching_service", + data=sms_request.model_dump_json() + ) + self.assertEqual( + "https://example.org/cdd_semantic_matching_service", + response.json()["semantic_matching_service_endpoint"] + ) def test_semantic_matching_service_fallback(self): with run_server_context(): sms_request = SMSRequest(semantic_id="nothing") - response = requests.get("http://localhost:8125/get_semantic_matching_service", - data=sms_request.model_dump_json()) - self.assertEqual("https://example.org/fallback_semantic_matching_service", - response.json()["semantic_matching_service_endpoint"]) + response = requests.get( + "http://localhost:8125/get_semantic_matching_service", + data=sms_request.model_dump_json() + ) + self.assertEqual( + "https://example.org/fallback_semantic_matching_service", + response.json()["semantic_matching_service_endpoint"] + ) # TODO check debug endpoints