From a5b35d218d790640172184ebd0af965b942d7759 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Sun, 25 Aug 2024 12:12:29 +0200 Subject: [PATCH] curl tests: reduce verbosity --- lib/curl_tests.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/curl_tests.py b/lib/curl_tests.py index c122e21..6bb4cbf 100644 --- a/lib/curl_tests.py +++ b/lib/curl_tests.py @@ -160,10 +160,14 @@ def run(tests): def display_result(result): - print(f"URL : {result['url']}") - print(f"Real URL: {result['effective_url']}") - print(f"Code : {result['code']}") - print(f"Title : {result['title'].strip()}") + if result["effective_url"] == result["url"]: + print(f"URL : {result['url']} (redirected to -> {result['effective_url']})") + else: + 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()}") if result["errors"]: print("Errors :\n -" + "\n -".join(result['errors']))