Beispiel #1
0
    def test_slice_sparce(self):
        arr = Array(data)
        expecteddata = data + ([0]*6) + [100]

        assert arr[:10] == data + ([0]*6)

        arr[10:11] = [100]
        assert arr.sparle == expected + [(1, 10, 100)]
        assert arr.get_values() == expecteddata
        assert arr[:] == expecteddata

        del arr[0]
        assert len(arr) == len(expecteddata)
        assert arr.get_values() == [0] + expecteddata[1:]
        assert arr[:] == [0] + expecteddata[1:]
Beispiel #2
0
    def test_set_value_default(self):
        arr = Array(data)

        arr[0] = 0
        assert arr.rle_values() == expected[1:]
Beispiel #3
0
    def test_get_values(self):
        arr = Array(data)

        assert arr.get_values() == expected