Skip to content

Commit

Permalink
Validating report headers
Browse files Browse the repository at this point in the history
  • Loading branch information
root authored and root committed Nov 28, 2024
1 parent 7e98a75 commit 856c337
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions tests/test_reports_steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,30 +257,29 @@ def the_report_is_downloaded_successfully(shared_data):

# Check headers
if headers == expected_headers:
print("Headers are valid!")
logger.info("Headers are valid!")
return True
else:
print("Headers are invalid!")
print("Expected Headers:")
print(expected_headers)
print("Found Headers:")
print(headers)
logger.info("Headers are invalid!")
logger.info("Expected Headers:")
logger.info(expected_headers)
logger.info("Found Headers:")
logger.info(headers)

# Find missing or extra headers
missing_headers = [h for h in expected_headers if h not in headers]
extra_headers = [h for h in headers if h not in expected_headers]

if missing_headers:
print("Missing Headers:")
print(missing_headers)
logger.info("Missing Headers:")
logger.info(missing_headers)
if extra_headers:
print("Extra Headers:")
print(extra_headers)

logger.info("Extra Headers:")
logger.info(extra_headers)
return False

except Exception as e:
print(f"An error occurred while validating headers: {e}")
logger.info(f"An error occurred while validating headers: {e}")
return False


0 comments on commit 856c337

Please sign in to comment.