diff --git a/server/tests/integration/test_main.py b/server/tests/integration/test_main.py index a5a61778..634f3d9c 100644 --- a/server/tests/integration/test_main.py +++ b/server/tests/integration/test_main.py @@ -1,27 +1,15 @@ """Test main service routes.""" -import re +import pytest -import pytest_asyncio - -@pytest_asyncio.fixture(scope="session") +@pytest.mark.asyncio() async def test_service_info(async_client): - """Test /service_info endpoint - - uses semver-provided regex to check version numbers: - https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string # noqa: E501 - """ + """Simple test of /service_info endpoint""" response = await async_client.get("/api/service_info") assert response.status_code == 200 response_json = response.json() assert response_json["warnings"] == [] - semver_pattern = r"^(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)\.(?P0|[1-9]\d*)(?:-(?P(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?P[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$" - assert re.match(semver_pattern, response_json["curfu_version"]) - assert re.match(semver_pattern, response_json["fusor_version"]) - assert re.match(semver_pattern, response_json["cool_seq_tool_version"]) - # not sure if I want to include vrs-python - # also its current version number isn't legal semver - # assert re.match( - # SEMVER_PATTERN, response_json["vrs_python_version"] - # ) + assert response_json["curfu_version"] + assert response_json["fusor_version"] + assert response_json["cool_seq_tool_version"]