mirror of
https://github.com/ocrmypdf/OCRmyPDF.git
synced 2026-01-05 19:51:07 +00:00
Reactivate user-words test that was always skipped
This commit is contained in:
parent
fdefcd8af2
commit
638eb556ef
@ -652,26 +652,11 @@ THIS FILE IS INVALID
|
||||
assert p.returncode == ExitCode.invalid_config
|
||||
|
||||
|
||||
@pytest.mark.skipif(tesseract.v4(), reason='arg has no effect in 4.0-beta1')
|
||||
def test_user_words(resources, outdir):
|
||||
@pytest.mark.skipif(not tesseract.has_user_words(), reason='not functional until 4.1.0')
|
||||
def test_user_words_ocr(resources, outdir):
|
||||
# Does not actually test if --user-words causes output to differ
|
||||
word_list = outdir / 'wordlist.txt'
|
||||
sidecar_before = outdir / 'sidecar_before.txt'
|
||||
sidecar_after = outdir / 'sidecar_after.txt'
|
||||
|
||||
# Don't know how to make this test pass on various versions and platforms
|
||||
# so weaken to merely testing that the argument is accepted
|
||||
consistent = False
|
||||
|
||||
if consistent:
|
||||
check_ocrmypdf(
|
||||
resources / 'crom.png',
|
||||
outdir / 'out.pdf',
|
||||
'--image-dpi',
|
||||
150,
|
||||
'--sidecar',
|
||||
sidecar_before,
|
||||
)
|
||||
assert 'cromulent' not in sidecar_before.open().read()
|
||||
sidecar_after = outdir / 'sidecar.txt'
|
||||
|
||||
with word_list.open('w') as f:
|
||||
f.write('cromulent\n') # a perfectly cromulent word
|
||||
@ -687,9 +672,6 @@ def test_user_words(resources, outdir):
|
||||
word_list,
|
||||
)
|
||||
|
||||
if consistent:
|
||||
assert 'cromulent' in sidecar_after.open().read()
|
||||
|
||||
|
||||
def test_form_xobject(spoof_tesseract_noop, resources, outpdf):
|
||||
check_ocrmypdf(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user