Skip to content

Commit 4753925

Browse files
committed
adapt tests to aded resources
1 parent 7c467cd commit 4753925

11 files changed

+18
-17
lines changed

tests/cli_tests/test_binarization.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
def test_run_eynollah_binarization_filename(
1111
tmp_path,
1212
run_eynollah_ok_and_check_logs,
13-
tests_dir,
13+
resources_dir,
1414
options,
1515
):
16-
infile = tests_dir.joinpath('resources/kant_aufklaerung_1784_0020.tif')
17-
outfile = tmp_path.joinpath('kant_aufklaerung_1784_0020.png')
16+
infile = resources_dir / '2files/kant_aufklaerung_1784_0020.tif'
17+
outfile = tmp_path / 'kant_aufklaerung_1784_0020.png'
1818
run_eynollah_ok_and_check_logs(
1919
'binarization',
2020
[
@@ -42,7 +42,7 @@ def test_run_eynollah_binarization_directory(
4242
run_eynollah_ok_and_check_logs(
4343
'binarization',
4444
[
45-
'-di', str(resources_dir),
45+
'-di', str(resources_dir / '2files'),
4646
'-o', str(outdir),
4747
],
4848
[

tests/cli_tests/test_enhance.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ def test_run_eynollah_enhancement_filename(
1313
run_eynollah_ok_and_check_logs,
1414
options,
1515
):
16-
infile = resources_dir / 'kant_aufklaerung_1784_0020.tif'
17-
outfile = tmp_path.joinpath('kant_aufklaerung_1784_0020.png')
16+
infile = resources_dir / '2files/kant_aufklaerung_1784_0020.tif'
17+
outfile = tmp_path / 'kant_aufklaerung_1784_0020.png'
1818
run_eynollah_ok_and_check_logs(
1919
'enhancement',
2020
[
@@ -41,7 +41,7 @@ def test_run_eynollah_enhancement_directory(
4141
run_eynollah_ok_and_check_logs(
4242
'enhancement',
4343
[
44-
'-di', str(resources_dir),
44+
'-di', str(resources_dir / '2files'),
4545
'-o', str(outdir),
4646
],
4747
[

tests/cli_tests/test_layout.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def test_run_eynollah_layout_filename(
2727
resources_dir,
2828
options,
2929
):
30-
infile = resources_dir / 'kant_aufklaerung_1784_0020.tif'
30+
infile = resources_dir / '2files/kant_aufklaerung_1784_0020.tif'
3131
outfile = tmp_path / 'kant_aufklaerung_1784_0020.xml'
3232
run_eynollah_ok_and_check_logs(
3333
'layout',
@@ -61,7 +61,7 @@ def test_run_eynollah_layout_filename2(
6161
run_eynollah_ok_and_check_logs,
6262
options,
6363
):
64-
infile = resources_dir / 'euler_rechenkunst01_1738_0025.tif'
64+
infile = resources_dir / '2files/euler_rechenkunst01_1738_0025.tif'
6565
outfile = tmp_path / 'euler_rechenkunst01_1738_0025.xml'
6666
run_eynollah_ok_and_check_logs(
6767
'layout',
@@ -94,7 +94,7 @@ def test_run_eynollah_layout_directory(
9494
run_eynollah_ok_and_check_logs(
9595
'layout',
9696
[
97-
'-di', str(resources_dir),
97+
'-di', str(resources_dir / '2files'),
9898
'-o', str(outdir),
9999
],
100100
[
@@ -104,6 +104,7 @@ def test_run_eynollah_layout_directory(
104104
)
105105
assert len(list(outdir.iterdir())) == 2
106106

107+
# TODO: renable once debugged model-zoo failures
107108
# def test_run_eynollah_layout_marginalia(
108109
# tmp_path,
109110
# resources_dir,

tests/cli_tests/test_mbreorder.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ def test_run_eynollah_mbreorder_filename(
66
resources_dir,
77
run_eynollah_ok_and_check_logs,
88
):
9-
infile = resources_dir / 'kant_aufklaerung_1784_0020.xml'
10-
outfile = tmp_path.joinpath('kant_aufklaerung_1784_0020.xml')
9+
infile = resources_dir / '2files/kant_aufklaerung_1784_0020.xml'
10+
outfile = tmp_path / 'kant_aufklaerung_1784_0020.xml'
1111
run_eynollah_ok_and_check_logs(
1212
'machine-based-reading-order',
1313
[
@@ -36,7 +36,7 @@ def test_run_eynollah_mbreorder_directory(
3636
run_eynollah_ok_and_check_logs(
3737
'machine-based-reading-order',
3838
[
39-
'-di', str(resources_dir),
39+
'-di', str(resources_dir / '2files'),
4040
'-o', str(outdir),
4141
],
4242
[

tests/cli_tests/test_ocr.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ def test_run_eynollah_ocr_filename(
1616
resources_dir,
1717
options,
1818
):
19-
infile = resources_dir / 'kant_aufklaerung_1784_0020.tif'
20-
outfile = tmp_path.joinpath('kant_aufklaerung_1784_0020.xml')
19+
infile = resources_dir / '2files/kant_aufklaerung_1784_0020.tif'
20+
outfile = tmp_path / 'kant_aufklaerung_1784_0020.xml'
2121
outrenderfile = tmp_path / 'render' / 'kant_aufklaerung_1784_0020.png'
2222
outrenderfile.parent.mkdir()
2323
if "-doit" in options:
@@ -52,8 +52,8 @@ def test_run_eynollah_ocr_directory(
5252
run_eynollah_ok_and_check_logs(
5353
'ocr',
5454
[
55-
'-di', str(resources_dir),
56-
'-dx', str(resources_dir),
55+
'-di', str(resources_dir / '2files'),
56+
'-dx', str(resources_dir / '2files'),
5757
'-o', str(outdir),
5858
],
5959
[
-6.89 MB
Binary file not shown.
-1.98 MB
Binary file not shown.

0 commit comments

Comments
 (0)