Fix test_mhtml_e2e with QtWebKit + Qt 5.12
Fixup for 9eccaea09c
See #4025
This commit is contained in:
parent
0953596ed6
commit
aec348d929
@ -61,8 +61,8 @@ def normalize_line(line):
|
|||||||
return line
|
return line
|
||||||
|
|
||||||
|
|
||||||
def normalize_whole(s):
|
def normalize_whole(s, webengine):
|
||||||
if qtutils.version_check('5.12', compiled=False):
|
if qtutils.version_check('5.12', compiled=False) and webengine:
|
||||||
s = s.replace('\n\n-----=_qute-UUID', '\n-----=_qute-UUID')
|
s = s.replace('\n\n-----=_qute-UUID', '\n-----=_qute-UUID')
|
||||||
return s
|
return s
|
||||||
|
|
||||||
@ -71,8 +71,9 @@ class DownloadDir:
|
|||||||
|
|
||||||
"""Abstraction over a download directory."""
|
"""Abstraction over a download directory."""
|
||||||
|
|
||||||
def __init__(self, tmpdir):
|
def __init__(self, tmpdir, config):
|
||||||
self._tmpdir = tmpdir
|
self._tmpdir = tmpdir
|
||||||
|
self._config = config
|
||||||
self.location = str(tmpdir)
|
self.location = str(tmpdir)
|
||||||
|
|
||||||
def read_file(self):
|
def read_file(self):
|
||||||
@ -92,14 +93,15 @@ class DownloadDir:
|
|||||||
if normalize_line(line) is not None)
|
if normalize_line(line) is not None)
|
||||||
actual_data = '\n'.join(normalize_line(line)
|
actual_data = '\n'.join(normalize_line(line)
|
||||||
for line in self.read_file())
|
for line in self.read_file())
|
||||||
actual_data = normalize_whole(actual_data)
|
actual_data = normalize_whole(actual_data,
|
||||||
|
webengine=self._config.webengine)
|
||||||
|
|
||||||
assert actual_data == expected_data
|
assert actual_data == expected_data
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
def download_dir(tmpdir):
|
def download_dir(tmpdir, pytestconfig):
|
||||||
return DownloadDir(tmpdir)
|
return DownloadDir(tmpdir, pytestconfig)
|
||||||
|
|
||||||
|
|
||||||
def _test_mhtml_requests(test_dir, test_path, server):
|
def _test_mhtml_requests(test_dir, test_path, server):
|
||||||
|
Loading…
Reference in New Issue
Block a user