Beispiel #1
0
    def test_lazy_slice(self):
        data = Data([1, 2, 3, 4])

        assert list(data) == [1, 2, 3, 4]
        assert data.index == range(0, 4)
        assert list(data.lazy_slice([3, 2, 1])) == [4, 3, 2]
        assert data.index == range(0, 4)
Beispiel #2
0
 def test_lazy_slice_works_on_array(self):
     data = Data([[1, 2, 3], [2, 3, 4]], index=[0, 1, 2])
     assert list(data.lazy_slice([0])) == [[1, 2, 3]]
     assert data[1] == [2, 3, 4]