pdf_to_hocr: improve plugin handling

This commit is contained in:
James R. Barlow
2023-10-24 00:52:31 -07:00
parent 0443e87345
commit 68bb38d0ad
6 changed files with 43 additions and 5 deletions
+6 -2
View File
@@ -27,9 +27,13 @@ def test_stream_api(resources: Path):
assert b'%PDF' in out.read(1024)
def test_hocr_api(outdir):
def test_hocr_api(resources: Path, outdir: Path):
ocrmypdf.pdf_to_hocr(
'tests/resources/multipage.pdf', outdir, language='eng', skip_text=True
resources / 'multipage.pdf',
outdir,
language='eng',
skip_text=True,
plugins=['tests/plugins/tesseract_cache.py'],
)
assert (outdir / '000001_ocr_hocr.hocr').exists()
assert (outdir / '000006_ocr_hocr.hocr').exists()