Test case for issue #200

This commit is contained in:
James R. Barlow
2017-11-26 22:52:53 -08:00
parent 2040ae4856
commit 965de3a235
3 changed files with 17 additions and 6 deletions
+7 -4
View File
@@ -61,6 +61,9 @@ under the terms of the license in LICENSE.rst.
* - cmyk.pdf
- @jbarlow83
- a CMYK image created in Photoshop
* - crom.png
- @jbarlow83
- test for non-dictionary words
* - enormous.pdf
- @jbarlow83
- very large PDF page
@@ -69,7 +72,7 @@ under the terms of the license in LICENSE.rst.
- a linearized PDF containing some unusual indirect objects, created by an Epson printer; printout of a Wikipedia article (CC BY-SA)
* - formxobject.pdf
- @jbarlow83
- hand-crafted exotic PDF containing an image inside a Form XObject
- hand-crafted PDF containing an image inside a Form XObject
* - francais.pdf
- @jbarlow83
- a page containing French accents (diacritics)
@@ -88,12 +91,12 @@ under the terms of the license in LICENSE.rst.
* - overlay.pdf
- @maxandersen
- PDF file generated by PDFPen pro that triggered content stream parse errors
* - negzero.pdf
- @jbarlow83
- copy of formxobject.pdf with token that qpdf doesn't like
* - no_contents.pdf
- @jbarlow83
- synthetic PDF with a blank page that has no /Contents entry
* - crom.png
- @jbarlow83
- test for non-dictionary words
Assemblies
Binary file not shown.
+10 -2
View File
@@ -10,7 +10,7 @@ import PyPDF2 as pypdf
from ocrmypdf.exceptions import ExitCode
from ocrmypdf import leptonica
from ocrmypdf.pdfa import file_claims_pdfa
from ocrmypdf.exec import ghostscript, tesseract
from ocrmypdf.exec import ghostscript, tesseract, qpdf
import logging
from math import isclose
@@ -1016,4 +1016,12 @@ def test_bad_locale():
)
assert out == '', "stdout not clean"
assert p.returncode != 0
assert 'configured to use ASCII as encoding' in err, "should whine"
assert 'configured to use ASCII as encoding' in err, "should whine"
def test_qpdf_negative_zero(resources, outpdf):
negzero = resources / 'negzero.pdf'
hugemono = resources / 'hugemono.pdf'
qpdf.merge([str(negzero), str(hugemono)], outpdf) # raises exception on err