From c36360dc7dd47776cd170d954c0a183623e7de39 Mon Sep 17 00:00:00 2001 From: Konstantin Baierer Date: Wed, 17 Jan 2024 13:26:35 +0100 Subject: [PATCH] fix tests --- tests/cli/test_workspace.py | 2 ++ tests/model/test_ocrd_mets.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/cli/test_workspace.py b/tests/cli/test_workspace.py index b155811ac8..4632fe1f55 100644 --- a/tests/cli/test_workspace.py +++ b/tests/cli/test_workspace.py @@ -564,6 +564,8 @@ def _call(args): assert _call(['-f', 'comma-separated', '-R', '5..5']) == 'PHYS_0005' assert _call(['-f', 'comma-separated', '-R', '6..8']) == 'PHYS_0006,PHYS_0008,PHYS_0009' assert _call(['-f', 'comma-separated', '-r', '1..5']) == 'PHYS_0001,PHYS_0002,PHYS_0003,PHYS_0004,PHYS_0005' + assert _call(['-f', 'comma-separated', '-r', '2..3']) == 'PHYS_0002,PHYS_0003' + assert _call(['-f', 'comma-separated', '-r', 'page 2..page 3']) == 'PHYS_0002,PHYS_0003' assert _call(['-f', 'comma-separated', '-r', 'PHYS_0006..PHYS_0009']) == 'PHYS_0006,PHYS_0008,PHYS_0009' assert _call(['-f', 'comma-separated', '-r', 'PHYS_0001..PHYS_0010', '-D', '3']) == 'PHYS_0001,PHYS_0002,PHYS_0003\nPHYS_0004,PHYS_0005,PHYS_0006\nPHYS_0008,PHYS_0009,PHYS_0010' assert _call(['-f', 'comma-separated', '-r', 'PHYS_0001..PHYS_0010', '-D', '3', '-C', '2']) == 'PHYS_0008,PHYS_0009,PHYS_0010' diff --git a/tests/model/test_ocrd_mets.py b/tests/model/test_ocrd_mets.py index 631f61d0d5..f33cf23960 100644 --- a/tests/model/test_ocrd_mets.py +++ b/tests/model/test_ocrd_mets.py @@ -92,7 +92,8 @@ def test_find_all_files(sbb_sample_01): assert len(sbb_sample_01.find_all_files(pageId='//PHYS_0005,PHYS_0001..PHYS_0002')) == 35, '35 files in //PHYS_0005,PHYS_0001..PHYS_0002' assert len(sbb_sample_01.find_all_files(pageId='//PHYS_0005,PHYS_0001..PHYS_0002')) == 35, '35 files in //PHYS_0005,PHYS_0001..PHYS_0002' assert len(sbb_sample_01.find_all_files(pageId='1..10')) == 35, '35 files in @ORDER range 1..10' - assert len(sbb_sample_01.find_all_files(pageId='1..PHYS_0002')) == 35, '35 files in @ORDER range 1..10' + with raises(ValueError, match='differ in their non-numeric part'): + len(sbb_sample_01.find_all_files(pageId='1..PHYS_0002')) def test_find_all_files_local_only(sbb_sample_01): assert len(sbb_sample_01.find_all_files(pageId='PHYS_0001',