Sanity check the PDF file for :print --pdf test

This commit is contained in:
Florian Bruhin 2016-07-12 13:28:43 +02:00
parent fce825f9df
commit 77035851a3
2 changed files with 5 additions and 4 deletions

View File

@ -343,7 +343,7 @@ Feature: Various utility commands.
When I open data/hello.txt
And I run :print --pdf (tmpdir)/hello.pdf
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

View File

@ -75,7 +75,8 @@ def check_cookie(quteproc, name, value):
assert data['cookies'][name] == value
@bdd.then(bdd.parsers.parse('the file {filename} should exist in the tmpdir'))
def file_exists(quteproc, tmpdir, filename):
@bdd.then(bdd.parsers.parse('the PDF {filename} should exist in the tmpdir'))
def pdf_exists(quteproc, tmpdir, filename):
path = tmpdir / filename
assert os.path.exists(str(path))
data = path.read_binary()
assert data.startswith(b'%PDF')