parent
cc5da4d1fe
commit
2f8686ec70
@ -1,4 +1,5 @@
|
|||||||
From: <Saved by Blink>
|
From: <Saved by Blink>
|
||||||
|
Snapshot-Content-Location: http://localhost:(port)/data/downloads/mhtml/simple/simple.html
|
||||||
Subject: Simple MHTML test
|
Subject: Simple MHTML test
|
||||||
Date: today
|
Date: today
|
||||||
MIME-Version: 1.0
|
MIME-Version: 1.0
|
||||||
|
@ -26,6 +26,8 @@ import collections
|
|||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
from qutebrowser.utils import qtutils
|
||||||
|
|
||||||
|
|
||||||
def collect_tests():
|
def collect_tests():
|
||||||
basedir = os.path.dirname(__file__)
|
basedir = os.path.dirname(__file__)
|
||||||
@ -51,6 +53,11 @@ def normalize_line(line):
|
|||||||
line = line.replace('Content-Type: application/x-javascript',
|
line = line.replace('Content-Type: application/x-javascript',
|
||||||
'Content-Type: application/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
|
return line
|
||||||
|
|
||||||
|
|
||||||
@ -74,7 +81,8 @@ 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 = [normalize_line(line) for line in f
|
||||||
|
if normalize_line(line) is not None]
|
||||||
actual_data = self.read_file()
|
actual_data = self.read_file()
|
||||||
actual_data = [normalize_line(line) for line in actual_data]
|
actual_data = [normalize_line(line) for line in actual_data]
|
||||||
assert actual_data == expected_data
|
assert actual_data == expected_data
|
||||||
|
Loading…
Reference in New Issue
Block a user