Пример #1
0
 def test_remove_file_ocrdfile(self):
     with copy_of_directory(assets.path_to('SBB0000F29300010000/data')) as tempdir:
         mets = OcrdMets(filename=join(tempdir, 'mets.xml'))
         self.assertEqual(mets.physical_pages, ['PHYS_0001', 'PHYS_0002', 'PHYS_0005'])
         ocrd_file = mets.find_all_files(ID='FILE_0005_IMAGE')[0]
         mets.remove_one_file(ocrd_file)
         self.assertEqual(mets.physical_pages, ['PHYS_0001', 'PHYS_0002'])
Пример #2
0
 def test_remove_page_after_remove_file(self):
     with copy_of_directory(
             assets.path_to('SBB0000F29300010000/data')) as tempdir:
         mets = OcrdMets(filename=join(tempdir, 'mets.xml'))
         self.assertEqual(mets.physical_pages,
                          ['PHYS_0001', 'PHYS_0002', 'PHYS_0005'])
         mets.remove_one_file('FILE_0005_IMAGE')
         self.assertEqual(mets.physical_pages, ['PHYS_0001', 'PHYS_0002'])