From 2d26076b9a52697971b414bc8a1ab674a16cc127 Mon Sep 17 00:00:00 2001 From: Lars Falk-Petersen Date: Fri, 29 Nov 2024 09:14:46 +0100 Subject: [PATCH] Lint --- sedr/edreq12.py | 3 +-- sedr/preflight.py | 10 +++------- sedr/test_edreq12.py | 4 +++- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/sedr/edreq12.py b/sedr/edreq12.py index e56578e..0fd6be8 100644 --- a/sedr/edreq12.py +++ b/sedr/edreq12.py @@ -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) @@ -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}" diff --git a/sedr/preflight.py b/sedr/preflight.py index 8157b8d..2425696 100644 --- a/sedr/preflight.py +++ b/sedr/preflight.py @@ -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 @@ -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( diff --git a/sedr/test_edreq12.py b/sedr/test_edreq12.py index b6bad3a..7cf3328 100644 --- a/sedr/test_edreq12.py +++ b/sedr/test_edreq12.py @@ -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)