def test_move_resource_saving_for_folders(self): myfolder = self.project.root.create_folder('myfolder') newfolder = self.project.get_folder('newfolder') change = rope.base.change.MoveResource(myfolder, 'newfolder') self.history.do(change) data = self.to_data(change) change = self.to_change(data) change.undo() self.assertTrue(myfolder.exists()) self.assertFalse(newfolder.exists())
def test_move_resource_saving_for_folders(self): myfolder = self.project.root.create_folder("myfolder") newfolder = self.project.get_folder("newfolder") change = rope.base.change.MoveResource(myfolder, "newfolder") self.history.do(change) data = self.to_data(change) change = self.to_change(data) change.undo() self.assertTrue(myfolder.exists()) self.assertFalse(newfolder.exists())
def test_undoing_a_not_yet_performed_change(self): change = rope.base.change.ChangeContents(self.file1, '1') str(change) with self.assertRaises(exceptions.HistoryError): change.undo()
def test_undoing_a_not_yet_performed_change(self): change = rope.base.change.ChangeContents(self.file1, "1") str(change) with self.assertRaises(exceptions.HistoryError): change.undo()