1
0
mirror of https://github.com/moparisthebest/wget synced 2024-07-03 16:38:41 -04:00
wget/testenv/conf/files_crawled.py
2014-07-24 16:51:58 +05:30

19 lines
589 B
Python

from misc.colour_terminal import print_red
from conf import hook
from exc.test_failed import TestFailed
@hook()
class FilesCrawled:
def __init__(self, request_headers):
self.request_headers = request_headers
def __call__(self, test_obj):
for headers, remaining in zip(map(set, self.request_headers),
test_obj.request_remaining()):
diff = headers.symmetric_difference(remaining)
if diff:
print_red (str(diff))
raise TestFailed('Not all files were crawled correctly.')