Exemplo n.º 1
0
    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())
Exemplo n.º 2
0
    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())
Exemplo n.º 3
0
 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()
Exemplo n.º 4
0
 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()