tests: relax pdfjs tests
Updating the whole snippet in two places is bad, so we relax the testing code.
This commit is contained in:
parent
ffa276a182
commit
a9ac123bfa
@ -36,11 +36,11 @@ from qutebrowser.browser import pdfjs
|
|||||||
'http://foobar/%22);alert(%22attack!%22);'),
|
'http://foobar/%22);alert(%22attack!%22);'),
|
||||||
])
|
])
|
||||||
def test_generate_pdfjs_script(url, expected):
|
def test_generate_pdfjs_script(url, expected):
|
||||||
expected_code = ('PDFJS.verbosity = PDFJS.VERBOSITY_LEVELS.info;\n'
|
expected_open = 'open("{}");'.format(expected)
|
||||||
'PDFView.open("{}");\n'.format(expected))
|
|
||||||
url = QUrl(url)
|
url = QUrl(url)
|
||||||
actual = pdfjs._generate_pdfjs_script(url)
|
actual = pdfjs._generate_pdfjs_script(url)
|
||||||
assert actual == expected_code
|
assert expected_open in actual
|
||||||
|
assert 'PDFView' in actual
|
||||||
|
|
||||||
|
|
||||||
def test_fix_urls():
|
def test_fix_urls():
|
||||||
|
Loading…
Reference in New Issue
Block a user