Пример #1
0
    def test_get_value(self):
        data = [['', '', ''], ['not', 'empty', 'row']]
        dt = CustomDataTable(data)

        assert dt.GetValue(0, 0) == ''
        assert dt.GetValue(0, 1) == ''
        assert dt.GetValue(0, 2) == ''

        assert dt.GetValue(1, 0) == 'not'
        assert dt.GetValue(1, 1) == 'empty'
        assert dt.GetValue(1, 2) == 'row'

        # Address beyond the range of the data
        assert dt.GetValue(2, 0) == ''
        assert dt.GetValue(0, 3) == ''
Пример #2
0
    def test_set_value(self):
        data = [['', '', ''], ['not', 'empty', 'row']]
        dt = CustomDataTable(data)
        value = 'value'

        # Set an in-range value
        dt.SetValue(1, 0, value)

        assert dt.GetValue(1, 0) == value

        # Set an out-of-range value
        dt.SetValue(2, 0, value)