diff --git a/.gitignore b/.gitignore index fd64f0b..49835a7 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ output.html *.tif *.sw? TAGS +uv.lock diff --git a/tests/cli_tests/test_layout.py b/tests/cli_tests/test_layout.py index cd60e36..c3076fd 100644 --- a/tests/cli_tests/test_layout.py +++ b/tests/cli_tests/test_layout.py @@ -103,3 +103,26 @@ def test_run_eynollah_layout_directory( ] ) assert len(list(outdir.iterdir())) == 2 + +def test_run_eynollah_layout_marginalia( + tmp_path, + resources_dir, + run_eynollah_ok_and_check_logs, +): + outdir = tmp_path + outfile = outdir / 'estor_rechtsgelehrsamkeit02_1758_0880_800px.xml' + run_eynollah_ok_and_check_logs( + 'layout', + [ + '-i', str(resources_dir / 'estor_rechtsgelehrsamkeit02_1758_0880_800px.jpg'), + '-o', str(outdir), + ], + [ + 'Job done in', + 'All jobs done in', + ] + ) + assert outfile.exists() + tree = page_from_file(str(outfile)).etree + regions = tree.xpath('//page:TextRegion[type="marginalia"]', namespaces=NS) + assert len(regions) == 5, "expected 5 marginalia regions" diff --git a/tests/resources/estor_rechtsgelehrsamkeit02_1758_0880_800px.jpg b/tests/resources/estor_rechtsgelehrsamkeit02_1758_0880_800px.jpg new file mode 100644 index 0000000..9270508 Binary files /dev/null and b/tests/resources/estor_rechtsgelehrsamkeit02_1758_0880_800px.jpg differ diff --git a/tests/resources/estor_rechtsgelehrsamkeit02_1758_0880_800px.xml b/tests/resources/estor_rechtsgelehrsamkeit02_1758_0880_800px.xml new file mode 100644 index 0000000..45240c4 --- /dev/null +++ b/tests/resources/estor_rechtsgelehrsamkeit02_1758_0880_800px.xml @@ -0,0 +1,235 @@ + + + + SBB_QURATOR + 2025-10-30T16:38:21.180191 + 2025-10-30T16:38:21.180191 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +