def test_remove_file_group_force(self): with copy_of_directory(assets.path_to('SBB0000F29300010000/data')) as tempdir: workspace = Workspace(self.resolver, directory=tempdir) with self.assertRaisesRegex(Exception, "No such fileGrp"): # should fail workspace.remove_file_group('I DO NOT EXIST') # should succeed workspace.remove_file_group('I DO NOT EXIST', force=True) # should also succeed workspace.overwrite_mode = True workspace.remove_file_group('I DO NOT EXIST', force=False)
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) # should also succeed workspace.overwrite_mode = True workspace.remove_file('non-existing-id', force=False)