From 2c54a265a6bd7e5c0dc509fa023509a0780eb265 Mon Sep 17 00:00:00 2001 From: Mike Gerber Date: Mon, 13 Mar 2023 17:14:29 +0100 Subject: [PATCH] =?UTF-8?q?=E2=9C=94=20Fix=20tests=20to=20use=20the=20new?= =?UTF-8?q?=20filenames?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit OCR-D seems to create the files in the output file group with a new naming scheme (based on file group name and page id); Adjust the tests accordingly. It's probably not the best approach to expect certain filenames, and it would be better to use METS/the OCR-D API to ask for a certain page and it's file, but for now we use this. --- test/test_recognize.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/test_recognize.py b/test/test_recognize.py index dbb0d1f..8b33029 100644 --- a/test/test_recognize.py +++ b/test/test_recognize.py @@ -97,7 +97,7 @@ def test_recognize(workspace): ).process() workspace.save_mets() - page1 = os.path.join(workspace.directory, "OCR-D-OCR-CALAMARI/OCR-D-OCR-CALAMARI_0001.xml") + page1 = os.path.join(workspace.directory, "OCR-D-OCR-CALAMARI/OCR-D-OCR-CALAMARI_phys_0001.xml") assert os.path.exists(page1) assertFileContains(page1, "verſchuldeten") @@ -127,7 +127,7 @@ def test_word_segmentation(workspace): ).process() workspace.save_mets() - page1 = os.path.join(workspace.directory, "OCR-D-OCR-CALAMARI/OCR-D-OCR-CALAMARI_0001.xml") + page1 = os.path.join(workspace.directory, "OCR-D-OCR-CALAMARI/OCR-D-OCR-CALAMARI_phys_0001.xml") assert os.path.exists(page1) tree = etree.parse(page1) nsmap = { "pc": page_namespace(tree) } @@ -160,7 +160,7 @@ def test_glyphs(workspace): ).process() workspace.save_mets() - page1 = os.path.join(workspace.directory, "OCR-D-OCR-CALAMARI/OCR-D-OCR-CALAMARI_0001.xml") + page1 = os.path.join(workspace.directory, "OCR-D-OCR-CALAMARI/OCR-D-OCR-CALAMARI_phys_0001.xml") assert os.path.exists(page1) tree = etree.parse(page1) nsmap = { "pc": page_namespace(tree) }