def undo_test(grid): """Tests if the model is identical after an undo and a redo""" code_array = deepcopy(grid.code_array) undo_stack().undo() undo_stack().redo() assert code_array.dict_grid == grid.code_array.dict_grid assert code_array == grid.code_array
def test_append(self): """Test append""" selection = Selection([], [], [], [], [(23, 12)]) table = 0 attr = {"angle": 0.2} self.cell_attr.append((selection, table, attr)) # Check if 1 item - the actual action has been added assert undo_stack().undocount() == 1 assert not self.cell_attr._attr_cache
def setup_method(self, method): """Creates empty CellAttributes""" self.cell_attr = CellAttributes() undo_stack().clear()
def wrapper(self, *args, **kwargs): function(self, *args, **kwargs) code_array = deepcopy(self.data_array) undo_stack().undo() undo_stack().redo() assert code_array == self.data_array