Skip to content

Commit

Permalink
Fine tune extended test
Browse files Browse the repository at this point in the history
  • Loading branch information
CasperWA committed Jul 22, 2020
1 parent 5ce1f01 commit 156127b
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions tests/server/test_middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,19 +90,16 @@ def test_wrong_version(both_clients):
from optimade.server.middleware import CheckWronglyVersionedBaseUrls

version = "/v0"
url = f"{CONFIG.base_url}{version}/info"

with pytest.raises(VersionNotSupported):
CheckWronglyVersionedBaseUrls(both_clients.app).check_url(
urllib.parse.urlparse(url)
)

url = f"{CONFIG.base_url}{version}"
urls = (
f"{CONFIG.base_url}{version}/info",
f"{CONFIG.base_url}{version}",
)

with pytest.raises(VersionNotSupported):
CheckWronglyVersionedBaseUrls(both_clients.app).check_url(
urllib.parse.urlparse(url)
)
for url in urls:
with pytest.raises(VersionNotSupported):
CheckWronglyVersionedBaseUrls(both_clients.app).check_url(
urllib.parse.urlparse(url)
)


def test_wrong_version_json_response(check_error_response, both_clients):
Expand Down

0 comments on commit 156127b

Please sign in to comment.