Skip to content

Commit

Permalink
feat(test): remove the semver format test because API is not strictly…
Browse files Browse the repository at this point in the history
… using this scheme.

Related to #299
  • Loading branch information
demeringo committed Oct 2, 2024
1 parent 476eabd commit 8093bc1
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tests/api/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ async def test_get_api_version_is_not_empty_string():
res = await ac.get('/v1/utils/version')
assert res.json()

@pytest.mark.asyncio
async def test_get_api_version_is_semver():
async with AsyncClient(app=app, base_url="http://test") as ac:
res = await ac.get('/v1/utils/version')
# Check returned version matches semver regex
# See https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string
assert re.match("^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$", res.json())
# @pytest.mark.asyncio
# async def test_get_api_version_is_semver():
# async with AsyncClient(app=app, base_url="http://test") as ac:
# res = await ac.get('/v1/utils/version')
# # Check returned version matches semver regex
# # See https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string
# assert re.match("^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$", res.json())

0 comments on commit 8093bc1

Please sign in to comment.