def test_redo_redoes_changes(self): rename(self.proj, self.task_state, 'Llama', 'basic/foo.py', 8) with self.assertRaises(ValueError): common.compare_projects( 'basic', 'main', 'basic') history.undo(self.proj) common.compare_projects( 'basic', 'main', 'basic') history.redo(self.proj) with self.assertRaises(ValueError): common.compare_projects( 'basic', 'main', 'basic')
def test_undo_adds_history(self): self.assertEqual(len(self.proj.proj.history.undo_list), 0) rename(self.proj, self.task_state, 'Llama', 'basic/foo.py', 8) self.assertEqual(len(self.proj.proj.history.undo_list), 1)
def test_undo_info(self): rename(self.proj, self.task_state, 'Llama', 'basic/foo.py', 8) i = history.undo_info(self.proj, 0) for k in ['description', 'time', 'full_change', 'changes']: self.assertIn(k, i)
def test_redo_history(self): self.assertEqual( len(history.redo_history(self.proj)), 0) rename(self.proj, self.task_state, 'Llama', 'basic/foo.py', 8) history.undo(self.proj) self.assertEqual( len(history.redo_history(self.proj)), 1)
def test_undo_info_exceptions(self): with self.assertRaises(IndexError): history.undo_info(self.proj, 0) rename(self.proj, self.task_state, 'Llama', 'basic/foo.py', 8) history.undo_info(self.proj, 0) with self.assertRaises(IndexError): history.undo_info(self.proj, 1)
def test_simple(self): rename(self.proj, self.task_state, 'Llama', 'basic/foo.py', 8) common.compare_projects( 'basic_rename_llama', 'main', 'basic')
def test_simple(self): state = State() state.create(1) task_state = state.get_task_state(1) rename(self.proj, task_state, 'Llama', 'basic/foo.py', 8)