diff --git a/tests/spoof/gs_raster_failure.py b/tests/spoof/gs_raster_failure.py index 067f8a6f..7619aae2 100755 --- a/tests/spoof/gs_raster_failure.py +++ b/tests/spoof/gs_raster_failure.py @@ -35,13 +35,13 @@ def main(): print('SPOOFED: ' + os.path.basename(__file__)) sys.exit(0) - # For any rendering calls (device == pdfwrite) call real ghostscript - if '-sDEVICE=pdfwrite' in sys.argv: + # For non-image rastering calls, use real ghostscript + if '-sDEVICE=pdfwrite' in sys.argv or '-sDEVICE=txtwrite' in sys.argv: real_ghostscript(sys.argv) return # Fail - print("ERROR: Ghost story archive not found") + print("ERROR: Ghost story archive not found", file=sys.stderr) sys.exit(1) diff --git a/tests/spoof/gs_render_failure.py b/tests/spoof/gs_render_failure.py index 65509f5d..d0c1d60d 100755 --- a/tests/spoof/gs_render_failure.py +++ b/tests/spoof/gs_render_failure.py @@ -40,7 +40,7 @@ def main(): return # Fail - print("ERROR: Casper is not a friendly ghost") + print("ERROR: Casper is not a friendly ghost", file=sys.stderr) sys.exit(1) diff --git a/tests/test_ghostscript.py b/tests/test_ghostscript.py index c74b4952..45020402 100644 --- a/tests/test_ghostscript.py +++ b/tests/test_ghostscript.py @@ -119,7 +119,7 @@ def test_gs_render_failure(spoof_no_tess_gs_render_fail, resources, outpdf): p, out, err = run_ocrmypdf( resources / 'blank.pdf', outpdf, env=spoof_no_tess_gs_render_fail ) - print(err) + assert 'Casper is not a friendly ghost' in err assert p.returncode == ExitCode.child_process_error @@ -127,7 +127,7 @@ def test_gs_raster_failure(spoof_no_tess_gs_raster_fail, resources, outpdf): p, out, err = run_ocrmypdf( resources / 'ccitt.pdf', outpdf, env=spoof_no_tess_gs_raster_fail ) - print(err) + assert 'Ghost story archive not found' in err assert p.returncode == ExitCode.child_process_error