MCPcopy Index your code
hub / github.com/python/cpython / test_buffer_protocol

Method test_buffer_protocol

Lib/test/test_zstd.py:2659–2666  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

2657 self.assertEqual(dat, SAMPLES[0])
2658
2659 def test_buffer_protocol(self):
2660 # don't use len() for buffer protocol objects
2661 arr = array.array("i", range(1000))
2662 LENGTH = len(arr) * arr.itemsize
2663
2664 with open(io.BytesIO(), "wb") as f:
2665 self.assertEqual(f.write(arr), LENGTH)
2666 self.assertEqual(f.tell(), LENGTH)
2667
2668class FreeThreadingMethodTests(unittest.TestCase):
2669

Callers

nothing calls this directly

Calls 4

openFunction · 0.90
assertEqualMethod · 0.45
writeMethod · 0.45
tellMethod · 0.45

Tested by

no test coverage detected