|
|
@ -30,28 +30,6 @@ def test_fac_ignoring_reading_order(file):
|
|
|
|
assert "".join(ocr_segments) == expected
|
|
|
|
assert "".join(ocr_segments) == expected
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.mark.parametrize(
|
|
|
|
|
|
|
|
"file,expected_text",
|
|
|
|
|
|
|
|
[
|
|
|
|
|
|
|
|
("table-order-0001.xml", "1\n2\n3\n4\n5\n6\n7\n8\n9"),
|
|
|
|
|
|
|
|
("table-order-0002.xml", "1\n4\n7\n2\n5\n8\n3\n6\n9"),
|
|
|
|
|
|
|
|
("table-no-reading-order.xml", "5\n6\n7\n8\n9\n1\n2\n3\n4"),
|
|
|
|
|
|
|
|
("table-unordered.xml", "5\n6\n7\n8\n9\n1\n2\n3\n4"),
|
|
|
|
|
|
|
|
],
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
@pytest.mark.integration
|
|
|
|
|
|
|
|
def test_reading_order_settings(file, expected_text):
|
|
|
|
|
|
|
|
data_dir = os.path.join(
|
|
|
|
|
|
|
|
os.path.dirname(os.path.abspath(__file__)), "data", "table-order"
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
if "table-unordered.xml" == file:
|
|
|
|
|
|
|
|
with pytest.raises(NotImplementedError):
|
|
|
|
|
|
|
|
page_text(ET.parse(os.path.join(data_dir, file)))
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
ocr = page_text(ET.parse(os.path.join(data_dir, file)))
|
|
|
|
|
|
|
|
assert ocr == expected_text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.mark.integration
|
|
|
|
@pytest.mark.integration
|
|
|
|
@pytest.mark.parametrize(
|
|
|
|
@pytest.mark.parametrize(
|
|
|
|
"gt,ocr,expected",
|
|
|
|
"gt,ocr,expected",
|
|
|
|