Improve error checking for tesseract -psm 0 (orientation) errors

This commit is contained in:
James R. Barlow
2016-02-19 03:58:39 -08:00
parent f3b0434a87
commit ab0e5fa425
2 changed files with 16 additions and 10 deletions
+9
View File
@@ -460,3 +460,12 @@ def test_tesseract_crash(renderer, spoof_tesseract_crash):
assert sh.returncode == ExitCode.child_process_error
assert not os.path.exists(_outfile('wontwork.pdf'))
assert "ERROR" in err
def test_tesseract_crash_autorotate(spoof_tesseract_crash):
sh, out, err = run_ocrmypdf_env(
'ccitt.pdf', 'wontwork.pdf',
'-r', env=spoof_tesseract_crash)
assert sh.returncode == ExitCode.child_process_error
assert not os.path.exists(_outfile('wontwork.pdf'))
assert "ERROR" in err