-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DOn't bother w/ semver checks (out of control of this app) and use pr…
…oper fixture mode
- Loading branch information
1 parent
bf1ec41
commit 8e576fb
Showing
1 changed file
with
6 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"^(?P<major>0|[1-9]\d*)\.(?P<minor>0|[1-9]\d*)\.(?P<patch>0|[1-9]\d*)(?:-(?P<prerelease>(?: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<buildmetadata>[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"] |