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

Method test_send_buffer

Lib/test/test__interpchannels.py:816–829  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

814 # send_buffer
815
816 def test_send_buffer(self):
817 buf = bytearray(b'spamspamspam')
818 cid = _channels.create(REPLACE)
819 _channels.send_buffer(cid, buf, blocking=False)
820 obj = recv_nowait(cid)
821
822 self.assertIsNot(obj, buf)
823 self.assertIsInstance(obj, memoryview)
824 self.assertEqual(obj, buf)
825
826 buf[4:8] = b'eggs'
827 self.assertEqual(obj, buf)
828 obj[4:8] = b'ham.'
829 self.assertEqual(obj, buf)
830
831 #-------------------
832 # send with waiting

Callers

nothing calls this directly

Calls 6

recv_nowaitFunction · 0.85
send_bufferMethod · 0.80
assertIsNotMethod · 0.80
assertIsInstanceMethod · 0.80
createMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected