Skip to content

Commit

Permalink
Adapt ci
Browse files Browse the repository at this point in the history
  • Loading branch information
moritzsommer committed May 29, 2024
1 parent 018874a commit ef91c27
Showing 1 changed file with 24 additions and 11 deletions.
35 changes: 24 additions & 11 deletions test/test_resolving_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,24 +43,16 @@ def run_server():

app = FastAPI()
app.include_router(semantic_id_resolver_service.router)
print(str(config["SERVICE"]["ENDPOINT"]))
print(int(config["SERVICE"]["PORT"]))
uvicorn.run(app, host=str(config["SERVICE"]["ENDPOINT"]), port=int(config["SERVICE"]["PORT"]), log_level="error")


class TestSemanticMatchingService(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.server_process = multiprocessing.Process(target=run_server)
cls.server_process.start()

@classmethod
def tearDownClass(cls):
cls.server_process.terminate()
cls.server_process.join()

def test_semantic_matching_service_iri(self):
# TODO deposit DNS record
server_process = multiprocessing.Process(target=run_server)
server_process.start()

sms_request = SMSRequest(
semantic_id="foo://example.org:1234/over/there?name=bar#page=3",
)
Expand All @@ -73,7 +65,13 @@ def test_semantic_matching_service_iri(self):
response.json()["semantic_matching_service_endpoint"]
)

server_process.terminate()
server_process.join()

def test_semantic_matching_service_irdi_eclass(self):
server_process = multiprocessing.Process(target=run_server)
server_process.start()

sms_request = SMSRequest(
semantic_id="0173-1#01-ACK323#017",
)
Expand All @@ -86,7 +84,13 @@ def test_semantic_matching_service_irdi_eclass(self):
response.json()["semantic_matching_service_endpoint"]
)

server_process.terminate()
server_process.join()

def test_semantic_matching_service_irdi_cdd(self):
server_process = multiprocessing.Process(target=run_server)
server_process.start()

sms_request = SMSRequest(
semantic_id="0112-1#01-ACK323#017",
)
Expand All @@ -99,7 +103,13 @@ def test_semantic_matching_service_irdi_cdd(self):
response.json()["semantic_matching_service_endpoint"]
)

server_process.terminate()
server_process.join()

def test_semantic_matching_service_fallback(self):
server_process = multiprocessing.Process(target=run_server)
server_process.start()

sms_request = SMSRequest(
semantic_id="nothing",
)
Expand All @@ -112,6 +122,9 @@ def test_semantic_matching_service_fallback(self):
response.json()["semantic_matching_service_endpoint"]
)

server_process.terminate()
server_process.join()

# TODO check debug endpoints


Expand Down

0 comments on commit ef91c27

Please sign in to comment.