Compare strings in mhtml tests

This commit is contained in:
Florian Bruhin 2018-09-24 10:25:33 +02:00
parent 165ed19bef
commit 87c6b361f8

View File

@ -81,10 +81,12 @@ class DownloadDir:
def compare_mhtml(self, filename): def compare_mhtml(self, filename):
with open(filename, 'r', encoding='utf-8') as f: with open(filename, 'r', encoding='utf-8') as f:
expected_data = [normalize_line(line) for line in f expected_data = '\n'.join(normalize_line(line)
if normalize_line(line) is not None] for line in f
actual_data = self.read_file() if normalize_line(line) is not None)
actual_data = [normalize_line(line) for line in actual_data] actual_data = '\n'.join(normalize_line(line)
for line in self.read_file())
assert actual_data == expected_data assert actual_data == expected_data