コード例 #1
0
ファイル: test_workspace.py プロジェクト: cclauss/core
 def test_remove_file_page_recursive_same_group(self):
     with copy_of_directory(assets.path_to('kant_aufklaerung_1784-complex/data')) as tempdir:
         with pushd_popd(tempdir):
             ws = Workspace(self.resolver, directory=tempdir)
             before = count_files()
             ws.remove_file('OCR-D-IMG-BINPAGE-sauvola_0001', page_recursive=True, page_same_group=True, force=False)
             after = count_files()
             self.assertEqual(after, before - 1, '2 file deleted')
コード例 #2
0
ファイル: test_workspace.py プロジェクト: cclauss/core
 def test_remove_file_page_recursive(self):
     with copy_of_directory(assets.path_to('kant_aufklaerung_1784-complex/data')) as tempdir:
         with pushd_popd(tempdir):
             ws = Workspace(self.resolver, directory=tempdir)
             self.assertEqual(len(ws.mets.find_files()), 119)
             ws.remove_file('OCR-D-OCR-OCRO-fraktur-SEG-LINE-tesseract-ocropy-DEWARP_0001', page_recursive=True, page_same_group=False, keep_file=True)
             self.assertEqual(len(ws.mets.find_files()), 83)
             ws.remove_file('PAGE_0017_ALTO', page_recursive=True)
コード例 #3
0
ファイル: test_workspace.py プロジェクト: hefv57/core
 def test_remove_file_force(self):
     with copy_of_directory(
             assets.path_to('SBB0000F29300010000/data')) as tempdir:
         workspace = Workspace(self.resolver, directory=tempdir)
         with self.assertRaisesRegex(FileNotFoundError, "not found"):
             # should fail
             workspace.remove_file('non-existing-id')
         # should succeed
         workspace.remove_file('non-existing-id', force=True)