test_utils: adapt to make_file_id changes
@@ -272,7 +272,8 @@ class TestUtils(TestCase):
mets.add_file('BAR', ID="BAR_%04d" % (i), mimetype="image/tiff")
self.assertEqual(make_file_id(mets.find_all_files(ID='BAR_0007')[0], 'FOO'), 'FOO_0007')
f = mets.add_file('ABC', ID="BAR_7", mimetype="image/tiff")
- self.assertEqual(make_file_id(f, 'FOO'), 'FOO_0010')
+ #self.assertEqual(make_file_id(f, 'FOO'), 'FOO_0010')
+ self.assertEqual(make_file_id(f, 'FOO'), 'FOO_0001')
mets.remove_file(fileGrp='FOO')
self.assertEqual(make_file_id(f, 'FOO'), 'FOO_0001')
mets.add_file('FOO', ID="FOO_0001", mimetype="image/tiff")
@@ -284,14 +285,15 @@ class TestUtils(TestCase):
mets = OcrdMets.empty_mets()
f = mets.add_file('GRP', ID='FOO_0001', pageId='phys0001')
mets.add_file('GRP', ID='GRP2_0001', pageId='phys0002')
- self.assertEqual(make_file_id(f, 'GRP2'), 'GRP2_0002')
+ #self.assertEqual(make_file_id(f, 'GRP2'), 'GRP2_0002')
+ self.assertEqual(make_file_id(f, 'GRP2'), 'GRP2_phys0001')
def test_make_file_id_605(self):
"""https://github.com/OCR-D/core/pull/605"""
mets = OcrdMets.empty_mets()
f = mets.add_file('GRP1', ID='FOO_0001', pageId='phys0001')
f = mets.add_file('GRP2', ID='FOO_0002', pageId='phys0002')
- self.assertEqual(make_file_id(f, 'GRP2'), 'GRP2_0001')
+ self.assertEqual(make_file_id(f, 'GRP2'), 'GRP2_phys0002')
def test_make_file_id_744(self):
"""
@@ -301,7 +303,7 @@ class TestUtils(TestCase):
mets = OcrdMets.empty_mets()
f = mets.add_file('GRP2', ID='img1796-97_00000024_img', pageId='phys0024')
f = mets.add_file('GRP2', ID='img1796-97_00000025_img', pageId='phys0025')
- self.assertEqual(make_file_id(f, 'GRP2'), 'GRP2_0002')
+ self.assertEqual(make_file_id(f, 'GRP2'), 'GRP2_phys0025')
def test_generate_range(self):
assert generate_range('PHYS_0001', 'PHYS_0005') == ['PHYS_0001', 'PHYS_0002', 'PHYS_0003', 'PHYS_0004', 'PHYS_0005']
