Esempio n. 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
Esempio n. 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
Esempio n. 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
Esempio n. 4
0
    def setup_method(self, method):
        """Creates empty CellAttributes"""

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

        self.cell_attr = CellAttributes()
        undo_stack().clear()
Esempio n. 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