Normalize mhtml for Qt 5.12

See #4025
This commit is contained in:
Florian Bruhin 2018-09-24 11:03:38 +02:00
parent 87c6b361f8
commit 9eccaea09c

View File

@ -61,6 +61,12 @@ def normalize_line(line):
return line
def normalize_whole(s):
if qtutils.version_check('5.12', compiled=False):
s = s.replace('\n\n-----=_qute-UUID', '\n-----=_qute-UUID')
return s
class DownloadDir:
"""Abstraction over a download directory."""
@ -86,6 +92,7 @@ class DownloadDir:
if normalize_line(line) is not None)
actual_data = '\n'.join(normalize_line(line)
for line in self.read_file())
actual_data = normalize_whole(actual_data)
assert actual_data == expected_data