Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
ways committed Nov 29, 2024
1 parent 0820ce4 commit 2d26076
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
3 changes: 1 addition & 2 deletions sedr/edreq12.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ def requrementA5_2(jsondata: dict) -> tuple[bool, str]:
"""

spec_url = f"{edr_root_url}#req_core_rc-bbox-definition"
collection_url = util.parse_collection_url(jsondata)

extent = None
extent = util.parse_spatial_bbox(jsondata)
Expand All @@ -92,7 +91,7 @@ def requrementA5_2(jsondata: dict) -> tuple[bool, str]:
False,
f"Extent→spatial→bbox should be a list of bboxes with exactly "
f"one bbox in, found {len(extent)} in collection "
f"<{jsondata['id']}>. See {spec_url} for more info."
f"<{jsondata['id']}>. See {spec_url} for more info.",
)
return True, f"Extent→spatial→bbox for collection is {extent}"

Expand Down
10 changes: 3 additions & 7 deletions sedr/preflight.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,11 @@ def fetch_landing(url: str, timeout: int) -> tuple[bool, dict]:
response = requests.get(url, timeout=timeout)
landing_json = response.json()
except requests.exceptions.ConnectionError as err:
util.logger.error(
f"Unable to get landing page <%s>.\n%s", url, err
)
util.logger.error("Unable to get landing page <%s>.\n%s", url, err)
return False, landing_json
except json.decoder.JSONDecodeError as err:
util.logger.error(
f"fetch_landing Landing page <%s> is not valid JSON.\n%s", url, err
"fetch_landing Landing page <%s> is not valid JSON.\n%s", url, err
)
return False, landing_json
return True, landing_json
Expand All @@ -36,9 +34,7 @@ def fetch_conformance(url: str, timeout: int) -> tuple[bool, dict]:
response = requests.get(conformance_url, timeout=timeout)
conformance_json = response.json()
except requests.exceptions.ConnectionError as err:
util.logger.error(
f"Unable to get conformance <%s>.\n%s", url, err
)
util.logger.error("Unable to get conformance <%s>.\n%s", url, err)
return False, conformance_json
except json.decoder.JSONDecodeError as err:
util.logger.error(
Expand Down
4 changes: 3 additions & 1 deletion sedr/test_edreq12.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ def test_requrementA5_2(self):

# Bad tests
jsondata = {}
with open("testdata/edrisobaric_collection_bad_bbox.json", "r", encoding="utf-8") as f:
with open(
"testdata/edrisobaric_collection_bad_bbox.json", "r", encoding="utf-8"
) as f:
jsondata = json.load(f)
ok, _ = edreq.requrementA5_2(jsondata)
self.assertFalse(ok)
Expand Down

0 comments on commit 2d26076

Please sign in to comment.