def test_for_loop_move_with_undo_preserves_correct_celltype(self): test = self.chief.datafiles[1].tests[0] test.execute(MoveRowsDown([0])) test.execute(MoveRowsDown([1])) self.assertEqual(test.get_cell_info(1, 1).cell_type, CellType.ASSIGN) test.execute(Undo()) test.execute(Undo()) self.assertEqual(test.get_cell_info(1, 1).cell_type, CellType.KEYWORD)
def test_delete_keyword_undo(self): new_kw_name = 'Jiihaa' self._exec(AddKeyword(new_kw_name)) self._exec(RemoveMacro(self._new_keyword)) self._new_keyword = None self._exec(Undo()) assert_equals(self._new_keyword.name, new_kw_name)
def test_create_and_remove_keyword(self): kw_name = 'Super Keyword' self.test.execute(ChangeCellValue(0, 0, kw_name)) self._verify_cell_info(0, 0, ContentType.STRING, CellType.KEYWORD) self.test.execute(AddKeyword(kw_name, '${argh}')) self._verify_cell_info(0, 0, ContentType.USER_KEYWORD, CellType.KEYWORD) self._verify_cell_info(0, 1, ContentType.EMPTY, CellType.MANDATORY) self.test.execute(Undo()) self._verify_cell_info(0, 0, ContentType.STRING, CellType.KEYWORD) self._verify_cell_info(0, 1, ContentType.EMPTY, CellType.UNKNOWN)
def test_sort_and_restore_keywords(self): resource_ctrl = self._get_ctrl_by_name( datafilereader.SIMPLE_TEST_SUITE_RESOURCE_NAME) # Capture keyword list before sorting original_keywords = resource_ctrl.get_keyword_names() list_for_undo_comparison = original_keywords[:] # Sort the list resource_ctrl.execute(SortKeywords()) sorted_keywords = resource_ctrl.get_keyword_names() original_keywords.sort() assert_equals(original_keywords, sorted_keywords) # Undo sorting resource_ctrl.execute(Undo()) restored_list = resource_ctrl.get_keyword_names() assert_equals(restored_list, list_for_undo_comparison) # Redo sorting resource_ctrl.execute(Redo()) keywords_after_redo = resource_ctrl.get_keyword_names() assert_equals(keywords_after_redo, sorted_keywords)
def test_add_keyword_undo(self): new_kw_name = 'Jiihaa' self._exec(AddKeyword(new_kw_name)) assert_equals(self._new_keyword.name, new_kw_name) self._exec(Undo()) assert_equals(self._deleted_keyword.name, new_kw_name)
def test_undo_after_renaming_to_something_that_is_already_there(self): self._rename(STEP1_KEYWORD, STEP2_ARGUMENT, TEST1_NAME, 'Steps') self.test_ctrl.execute(Undo()) assert_equals(self.test_ctrl.steps[1].args[0], STEP2_ARGUMENT)
def test_undo_rename_in_step(self): self._rename(STEP1_KEYWORD, UNUSED_KEYWORD_NAME, TEST1_NAME, 'Steps') self.test_ctrl.execute(Undo()) assert_equals(self.test_ctrl.steps[0].keyword, STEP1_KEYWORD)
def OnUndo(self, event=None): if not self.IsCellEditControlShown(): self._execute(Undo()) else: self.GetCellEditor(*self.selection.cell).Reset()
def undo(self): self._macro_execute(Undo())
def not_implemented_test_undoing_extract(self): new_kw_name = 'New Keyword' self._exec(ExtractKeyword(new_kw_name, '', (0,1))) self._exec(Undo()) self._verify_step_number_change(0)