summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Bruhin <git@the-compiler.org>2018-03-05 11:36:29 +0100
committerFlorian Bruhin <git@the-compiler.org>2018-03-05 11:36:29 +0100
commit2f8686ec70dac6cad921b4481779a4470dbebf21 (patch)
tree2e5ed8b0905b9a395cbf0d1feb7d3e9b4fba21dd
parentcc5da4d1fe2e9f648f3c2f9d8b6f31d3c0aad9b4 (diff)
downloadqutebrowser-2f8686ec70dac6cad921b4481779a4470dbebf21.tar.gz
qutebrowser-2f8686ec70dac6cad921b4481779a4470dbebf21.zip
Fix test_mhtml_e2e with Qt 5.11
See #3661
-rw-r--r--tests/end2end/data/downloads/mhtml/simple/simple-webengine.mht1
-rw-r--r--tests/end2end/test_mhtml_e2e.py10
2 files changed, 10 insertions, 1 deletions
diff --git a/tests/end2end/data/downloads/mhtml/simple/simple-webengine.mht b/tests/end2end/data/downloads/mhtml/simple/simple-webengine.mht
index 79bd1ae50..42a55ab7c 100644
--- a/tests/end2end/data/downloads/mhtml/simple/simple-webengine.mht
+++ b/tests/end2end/data/downloads/mhtml/simple/simple-webengine.mht
@@ -1,4 +1,5 @@
From: <Saved by Blink>
+Snapshot-Content-Location: http://localhost:(port)/data/downloads/mhtml/simple/simple.html
Subject: Simple MHTML test
Date: today
MIME-Version: 1.0
diff --git a/tests/end2end/test_mhtml_e2e.py b/tests/end2end/test_mhtml_e2e.py
index 78cc9eb81..feddc963d 100644
--- a/tests/end2end/test_mhtml_e2e.py
+++ b/tests/end2end/test_mhtml_e2e.py
@@ -26,6 +26,8 @@ import collections
import pytest
+from qutebrowser.utils import qtutils
+
def collect_tests():
basedir = os.path.dirname(__file__)
@@ -51,6 +53,11 @@ def normalize_line(line):
line = line.replace('Content-Type: application/x-javascript',
'Content-Type: application/javascript')
+ # Added with Qt 5.11
+ if (line.startswith('Snapshot-Content-Location: ') and
+ not qtutils.version_check('5.11', compiled=False)):
+ line = None
+
return line
@@ -74,7 +81,8 @@ 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]
+ 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]
assert actual_data == expected_data