Skip to content

Commit

Permalink
Don't fail on known issues with the standard.
Browse files Browse the repository at this point in the history
  • Loading branch information
ways committed Nov 26, 2024
1 parent c3f50e2 commit 66dd8be
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions sedr/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ def parse_locations(jsondata) -> None:
def test_conformance_links(jsondata: dict, timeout: int) -> tuple[bool, str]:
"""Test that all conformance links are valid and resolves."""
msg = ""
valid = True
for link in jsondata["conformsTo"]:
if link in [
"http://www.opengis.net/spec/ogcapi-common-2/1.0/conf/conformance",
Expand All @@ -150,12 +151,12 @@ def test_conformance_links(jsondata: dict, timeout: int) -> tuple[bool, str]:
try:
response = requests.head(url=link, timeout=timeout)
except requests.exceptions.MissingSchema as error:
valid = False
msg += f"test_conformance_links Link <{link}> from /conformance is malformed: {error}). "
if not response.status_code < 400:
valid = False
msg += f"test_conformance_links Link {link} from /conformance is broken (gives status code {response.status_code}). "
if msg:
return False, msg
return True, ""
return valid, msg


def locate_openapi_url(url: str, timeout: int) -> str:
Expand Down

0 comments on commit 66dd8be

Please sign in to comment.