MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_buffer_protocol

Method test_buffer_protocol

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 5

openFunction · 0.90
lenFunction · 0.85
assertEqualMethod · 0.45
writeMethod · 0.45
tellMethod · 0.45

Tested by

no test coverage detected