def test_remove_deleted_files(self): """Check that files are removed if they don't exist any more.""" tree = self.get_committed_tree(TestRemove.files) for f in TestRemove.rfiles: osutils.delete_any(f) self.assertPathDoesNotExist(TestRemove.files) tree.remove(TestRemove.files, keep_files=False) self.assertRemovedAndDeleted(TestRemove.files) tree._validate()
def test_remove_deleted_files(self): tree = self._make_tree_and_add(files) self.run_bzr("commit -m 'added files'") my_files = [f for f in files] my_files.sort(reverse=True) for f in my_files: osutils.delete_any(f) self.assertInWorkingTree(files) self.assertPathDoesNotExist(files) self.run_bzr('remove ' + ' '.join(files)) self.assertNotInWorkingTree(a) self.assertPathDoesNotExist(files)
def change_kind(): if osutils.file_kind(path) == "directory": osutils.rmtree(path) else: osutils.delete_any(path) make_after(path)