Beispiel #1
0
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
Beispiel #2
0
    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
Beispiel #3
0
    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
Beispiel #4
0
    def setup_method(self, method):
        """Creates empty CellAttributes"""

        self.cell_attr = CellAttributes()
        undo_stack().clear()
Beispiel #5
0
    def setup_method(self, method):
        """Creates empty CellAttributes"""

        self.cell_attr = CellAttributes()
        undo_stack().clear()
Beispiel #6
0
 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