MCPcopy Create free account
hub / github.com/apache/arrow / test_buffer_getitem

Function test_buffer_getitem

python/pyarrow/tests/test_io.py:564–576  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

562
563
564def test_buffer_getitem():
565 data = bytearray(b'some data!')
566 buf = pa.py_buffer(data)
567
568 n = len(data)
569 for ix in range(-n, n - 1):
570 assert buf[ix] == data[ix]
571
572 with pytest.raises(IndexError):
573 buf[n]
574
575 with pytest.raises(IndexError):
576 buf[-n - 1]
577
578
579def test_buffer_slicing():

Callers

nothing calls this directly

Calls 1

lenFunction · 0.85

Tested by

no test coverage detected