From 1a982da442a91bea8a50b0d67b4de60820be1b9e Mon Sep 17 00:00:00 2001 From: "James R. Barlow" Date: Sun, 24 Jan 2021 01:53:36 -0800 Subject: [PATCH] tests: confirm that we produce pdf when optimization is off --- tests/test_optimize.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/test_optimize.py b/tests/test_optimize.py index d5ffc5fd..e49e4878 100644 --- a/tests/test_optimize.py +++ b/tests/test_optimize.py @@ -173,3 +173,15 @@ def test_multiple_pngs(resources, outdir): inim = next(iter(inpdf.pages[n].images.values())) outim = next(iter(outpdf.pages[n].images.values())) assert len(outim.read_raw_bytes()) < len(inim.read_raw_bytes()), n + + +def test_optimize_off(resources, outpdf): + check_ocrmypdf( + resources / 'trivial.pdf', + outpdf, + '--optimize=0', + '--output-type', + 'pdf', + '--plugin', + 'tests/plugins/tesseract_noop.py', + )