1
0
Fork 0
mirror of https://github.com/qurator-spk/dinglehopper.git synced 2025-06-09 03:40:12 +02:00

💩 dinglehopper: Fix OCR-D CLI test by working around ocrd_cli_wrap_processor() check for arguments

This commit is contained in:
Gerber, Mike 2020-09-25 14:53:19 +02:00
parent 96b55f1806
commit 5bee55c896

View file

@ -1,6 +1,7 @@
import os
import shutil
import json
import sys
from pathlib import Path
from click.testing import CliRunner
@ -23,11 +24,13 @@ def test_ocrd_cli(tmp_path):
# Run through the OCR-D interface
with working_directory(str(test_workspace_dir)):
runner = CliRunner()
result = runner.invoke(ocrd_dinglehopper, [
args = [
'-m', 'mets.xml',
'-I', 'OCR-D-GT-PAGE,OCR-D-OCR-CALAMARI',
'-O', 'OCR-D-OCR-CALAMARI-EVAL'
])
]
sys.argv[1:] = args # XXX Hack to satisfy ocrd_cli_wrap_processor() check for arguments
result = runner.invoke(ocrd_dinglehopper, args)
assert result.exit_code == 0
result_json = list((test_workspace_dir / 'OCR-D-OCR-CALAMARI-EVAL').glob('*.json'))
assert json.load(open(str(result_json[0])))['cer'] < 0.03