✔ Fix tests to use the new filenames

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-python-3.11
Mike Gerber 2 years ago
parent 1dcec06c2b
commit 2c54a265a6

@ -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) }

Loading…
Cancel
Save