Sanity check the PDF file for :print --pdf test
This commit is contained in:
parent
fce825f9df
commit
77035851a3
@ -343,7 +343,7 @@ Feature: Various utility commands.
|
|||||||
When I open data/hello.txt
|
When I open data/hello.txt
|
||||||
And I run :print --pdf (tmpdir)/hello.pdf
|
And I run :print --pdf (tmpdir)/hello.pdf
|
||||||
And I wait for "Print to file: *" in the log or skip the test
|
And I wait for "Print to file: *" in the log or skip the test
|
||||||
Then the file hello.pdf should exist in the tmpdir
|
Then the PDF hello.pdf should exist in the tmpdir
|
||||||
|
|
||||||
# :pyeval
|
# :pyeval
|
||||||
|
|
||||||
|
@ -75,7 +75,8 @@ def check_cookie(quteproc, name, value):
|
|||||||
assert data['cookies'][name] == value
|
assert data['cookies'][name] == value
|
||||||
|
|
||||||
|
|
||||||
@bdd.then(bdd.parsers.parse('the file {filename} should exist in the tmpdir'))
|
@bdd.then(bdd.parsers.parse('the PDF {filename} should exist in the tmpdir'))
|
||||||
def file_exists(quteproc, tmpdir, filename):
|
def pdf_exists(quteproc, tmpdir, filename):
|
||||||
path = tmpdir / filename
|
path = tmpdir / filename
|
||||||
assert os.path.exists(str(path))
|
data = path.read_binary()
|
||||||
|
assert data.startswith(b'%PDF')
|
||||||
|
Loading…
Reference in New Issue
Block a user