Remove last vestiges of command line usage of qpdf - change to check_pdf

This commit is contained in:
James R. Barlow
2020-04-26 05:33:26 -07:00
parent 168fc60774
commit 8f5c95f0f4
13 changed files with 63 additions and 95 deletions
@@ -17,9 +17,9 @@
import pytest
import ocrmypdf.exec.qpdf as qpdf
from ocrmypdf.helpers import check_pdf
def test_qpdf_error(resources):
assert qpdf.check(resources / 'blank.pdf')
assert not qpdf.check(__file__)
def test_pdf_error(resources):
assert check_pdf(resources / 'blank.pdf')
assert not check_pdf(__file__)
+2 -2
View File
@@ -21,8 +21,8 @@ import pytest
from PIL import Image
from ocrmypdf import hocrtransform
from ocrmypdf.exec import qpdf
from ocrmypdf.exec.tesseract import HOCR_TEMPLATE
from ocrmypdf.helpers import check_pdf
# pylint: disable=redefined-outer-name
@@ -43,4 +43,4 @@ def test_mono_image(blank_hocr, outdir):
hocr = hocrtransform.HocrTransform(str(blank_hocr), 300)
hocr.to_pdf(str(outdir / 'mono.pdf'), image_filename=str(outdir / 'mono.tif'))
qpdf.check(str(outdir / 'mono.pdf'))
check_pdf(str(outdir / 'mono.pdf'))
+4 -3
View File
@@ -29,7 +29,8 @@ from PIL import Image
import ocrmypdf
from ocrmypdf.exceptions import ExitCode, MissingDependencyError
from ocrmypdf.exec import ghostscript, qpdf, tesseract
from ocrmypdf.exec import ghostscript, tesseract
from ocrmypdf.helpers import check_pdf
from ocrmypdf.pdfa import file_claims_pdfa
from ocrmypdf.pdfinfo import Colorspace, Encoding, PdfInfo
@@ -529,8 +530,8 @@ def test_skip_big_with_no_images(spoof_tesseract_noop, resources, outpdf):
@pytest.mark.skipif(
'8.0.0' <= qpdf.version() <= '8.0.1',
reason="qpdf regression on pages with no contents",
'8.0.0' <= pikepdf.__libqpdf_version__ <= '8.0.1',
reason="libqpdf regression on pages with no contents",
)
def test_no_contents(spoof_tesseract_noop, resources, outpdf):
check_ocrmypdf(
+2 -2
View File
@@ -23,7 +23,7 @@ from subprocess import DEVNULL, PIPE, CalledProcessError, Popen, run
import pytest
from ocrmypdf.exceptions import ExitCode
from ocrmypdf.exec import qpdf
from ocrmypdf.helpers import check_pdf
# pytest.helpers is dynamic
# pylint: disable=no-member,redefined-outer-name
@@ -74,7 +74,7 @@ def test_stdout(spoof_tesseract_noop, ocrmypdf_exec, resources, outpdf):
)
assert p.returncode == ExitCode.ok
assert qpdf.check(output_file)
assert check_pdf(output_file)
@pytest.mark.skipif(
+1 -1
View File
@@ -39,7 +39,7 @@ def test_userunit_ghostscript_fails(poster, no_outpdf, caplog):
assert 'not supported by Ghostscript' in caplog.text
def test_userunit_qpdf_passes(spoof_tesseract_cache, poster, outpdf):
def test_userunit_pdf_passes(spoof_tesseract_cache, poster, outpdf):
before = PdfInfo(poster)
check_ocrmypdf(poster, outpdf, '--output-type=pdf', env=spoof_tesseract_cache)