curl tests: reduce verbosity

This commit is contained in:
Alexandre Aubin 2024-08-25 12:12:29 +02:00
parent c705b6b171
commit a5b35d218d

View file

@ -160,10 +160,14 @@ def run(tests):
def display_result(result): def display_result(result):
print(f"URL : {result['url']}") if result["effective_url"] == result["url"]:
print(f"Real URL: {result['effective_url']}") print(f"URL : {result['url']} (redirected to -> {result['effective_url']})")
print(f"Code : {result['code']}") else:
print(f"Title : {result['title'].strip()}") print(f"URL : {result['url']}")
if result['code'] != 200:
print(f"Code : {result['code']}")
if result["title"].strip():
print(f"Title : {result['title'].strip()}")
print(f"Content extract:\n{result['content'][:250].strip()}") print(f"Content extract:\n{result['content'][:250].strip()}")
if result["errors"]: if result["errors"]:
print("Errors :\n -" + "\n -".join(result['errors'])) print("Errors :\n -" + "\n -".join(result['errors']))