예제 #1
0
    def test_undo(self):
        """Tests undo action"""

        restore_basic_grid(self.grid)
        self.grid.actions.clear()

        self.grid.code_array[(0, 0, 0)] = "Test"

        self.grid.actions.undo()

        assert self.grid.code_array((0, 0, 0)) is None
예제 #2
0
    def test_undo(self):
        """Tests undo action"""

        restore_basic_grid(self.grid)
        self.grid.actions.clear()

        self.grid.code_array[(0, 0, 0)] = "Test"

        self.grid.actions.undo()

        assert self.grid.code_array((0, 0, 0)) is None
예제 #3
0
    def test_cut(self, selection, result):
        """Test cut, i. e. copy and deletion"""

        restore_basic_grid(self.grid)

        assert self.main_window.actions.cut(selection) == result

        (top, left), (bottom, right) = selection.get_bbox()

        for row in xrange(top, bottom + 1):
            for col in xrange(left, right + 1):
                if (row, col) in selection:
                    key = row, col, 0
                    assert self.code_array[key] is None
                    self.code_array[key] = grid_values[key]
    def test_cut(self, selection, result):
        """Test cut, i. e. copy and deletion"""

        restore_basic_grid(self.grid)

        assert self.main_window.actions.cut(selection) == result

        (top, left), (bottom, right) = selection.get_bbox()

        for row in xrange(top, bottom + 1):
            for col in xrange(left, right + 1):
                if (row, col) in selection:
                    key = row, col, 0
                    assert self.code_array[key] is None
                    self.code_array[key] = grid_values[key]
예제 #5
0
    def test_copy_result(self, selection, result):
        """Test copy results of single values, lists and matrices"""

        restore_basic_grid(self.grid)

        assert self.main_window.actions.copy_result(selection) == result
    def test_copy_result(self, selection, result):
        """Test copy results of single values, lists and matrices"""

        restore_basic_grid(self.grid)

        assert self.main_window.actions.copy_result(selection) == result