Skip to content

Commit

Permalink
test: update logging during tests
Browse files Browse the repository at this point in the history
  • Loading branch information
stijnpiron committed Dec 26, 2024
1 parent 8e2b5b4 commit 0a106a6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/check_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ def check_api(api_config):
f'Record {i} in API "{name}": Missing fields {missing_fields}'
)
else:
logger.info(f'Record {i} in API "{name}": PASSED - All fields found')
parking_name = record.get("name") or record.get("id_parking")
logger.info(f'Record {i} in API "{name}": PASSED - All fields found for parking "{parking_name}"')

if all_fields_found:
logger.info(f'API "{name}": PASSED - All records have expected fields')
Expand All @@ -96,9 +97,9 @@ def main():
for api in PARKING_API_URLS:
result = check_api(api)
if result:
logger.info(f"API \"{api['name']}\": SUCCESS")
logger.info(f'API "{api['name']}": SUCCESS')
else:
logger.error(f"API \"{api['name']}\": FAILURE")
logger.error(f'API "{api['name']}": FAILURE')
all_passed = False

if all_passed:
Expand Down

0 comments on commit 0a106a6

Please sign in to comment.