From 5bee55c8965612c8ddf04393c206cb8d4554c843 Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Fri, 25 Sep 2020 14:53:19 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=92=A9=20dinglehopper:=20Fix=20OCR-D=20CL?= =?UTF-8?q?I=20test=20by=20working=20around=20ocrd=5Fcli=5Fwrap=5Fprocesso?= =?UTF-8?q?r()=20check=20for=20arguments?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- qurator/dinglehopper/tests/test_integ_ocrd_cli.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/qurator/dinglehopper/tests/test_integ_ocrd_cli.py b/qurator/dinglehopper/tests/test_integ_ocrd_cli.py index 75bb816..5e535b5 100644 --- a/qurator/dinglehopper/tests/test_integ_ocrd_cli.py +++ b/qurator/dinglehopper/tests/test_integ_ocrd_cli.py @@ -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