Skip to content
Snippets Groups Projects
Commit 0284ba94 authored by Emanuele Aina's avatar Emanuele Aina
Browse files

test_urls: Collect broken URLs in a list


Signed-off-by: Emanuele Aina's avatarEmanuele Aina <emanuele.aina@collabora.com>
parent 91549fbb
No related branches found
No related tags found
1 merge request!279URL checker tweaks
......@@ -81,7 +81,7 @@ headers={
"User-Agent" : "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36",
}
broken = 0
broken = []
for url in urls:
print("%s : " %(url), end='')
sys.stdout.flush()
......@@ -106,10 +106,10 @@ for url in urls:
end = time.perf_counter()
if not status:
broken += 1
broken.append(url)
print(url, "OK" if status else "FAIL", f"{end - start:0.4f}s")
print("Found %d broken URLs in %d tested" %(broken, len(urls)))
print(f"Found {len(broken)} broken URLs in {len(urls)} tested")
if broken:
sys.exit(1)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment