From 87c6b361f818773c2f5c70cd0fa211eb4e3b705f Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 24 Sep 2018 10:25:33 +0200 Subject: [PATCH] Compare strings in mhtml tests --- tests/end2end/test_mhtml_e2e.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/end2end/test_mhtml_e2e.py b/tests/end2end/test_mhtml_e2e.py index feddc963d..8244a1a00 100644 --- a/tests/end2end/test_mhtml_e2e.py +++ b/tests/end2end/test_mhtml_e2e.py @@ -81,10 +81,12 @@ class DownloadDir: def compare_mhtml(self, filename): with open(filename, 'r', encoding='utf-8') as f: - expected_data = [normalize_line(line) for line in f - if normalize_line(line) is not None] - actual_data = self.read_file() - actual_data = [normalize_line(line) for line in actual_data] + expected_data = '\n'.join(normalize_line(line) + for line in f + if normalize_line(line) is not None) + actual_data = '\n'.join(normalize_line(line) + for line in self.read_file()) + assert actual_data == expected_data