Skip to content

Commit

Permalink
f -> test_func
Browse files Browse the repository at this point in the history
  • Loading branch information
ways committed Nov 29, 2024
1 parent c48c7f0 commit e27b0c9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion sedr/ogcapi10.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def requirement9_1(jsondata: dict) -> tuple[bool, str]:
Test that the landing page contains required elements.
TODO: See https://github.com/metno/sedr/issues/6
TODO: See https://github.com/metno/sedr/issues/6 - Should landing page in json only be tested if correct conformance class exists?
"""
spec_ref = f"{ogc_api_common_url}#_7c772474-7037-41c9-88ca-5c7e95235389"

Expand Down
16 changes: 8 additions & 8 deletions sedr/preflight.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ def main():
return False

# Run tests for landing
for f in util.test_functions["landing"]:
status, msg = f(landing_json)
for test_func in util.test_functions["landing"]:
status, msg = test_func(jsondata=landing_json)
if not status:
util.logger.error("Test %s failed with message: %s", f.__name__, msg)
util.logger.error("Test %s failed with message: %s", test_func.__name__, msg)
else:
util.logger.info("Test %s passed. (%s)", f.__name__, msg)
util.logger.info("Test %s passed. (%s)", test_func.__name__, msg)

# Get conformance
conformance_is_reachable, conformance_json = fetch_conformance(
Expand All @@ -66,12 +66,12 @@ def main():
return False

# Run tests for conformance page
for f in util.test_functions["conformance"]:
status, msg = f(conformance_json)
for test_func in util.test_functions["conformance"]:
status, msg = test_func(conformance_json)
if not status:
util.logger.error("Test %s failed with message: %s", f.__name__, msg)
util.logger.error("Test %s failed with message: %s", test_func.__name__, msg)
else:
util.logger.debug("Test %s passed. (%s)", f.__name__, msg)
util.logger.debug("Test %s passed. (%s)", test_func.__name__, msg)

util.logger.info("Preflight checks done.")
return True
Expand Down
10 changes: 5 additions & 5 deletions sedr/schemat.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,12 @@ def test_edr_collections(case):
)

# Run edr, ogc, profile tests
for f in util.test_functions["collection"]:
status, msg = f(collection_json)
for test_func in util.test_functions["collection"]:
status, msg = test_func(jsondata=collection_json)
if not status:
util.logger.error("Test %s failed with message: %s", f.__name__, msg)
raise AssertionError(f"Test {f.__name__} failed with message: {msg}")
util.logger.info("Test %s passed. (%s)", f.__name__, msg)
util.logger.error("Test %s failed with message: %s", test_func.__name__, msg)
raise AssertionError(f"Test {test_func.__name__} failed with message: {msg}")
util.logger.info("Test %s passed. (%s)", test_func.__name__, msg)

# Validation of spatial_bbox done above
extent = util.parse_spatial_bbox(collection_json)
Expand Down

0 comments on commit e27b0c9

Please sign in to comment.