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

Method testRecvmsgIntoScatter

Lib/test/test_socket.py:3952–3965  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

3950 self.sendToServer(MSG)
3951
3952 def testRecvmsgIntoScatter(self):
3953 # Receive into multiple buffers (scatter write).
3954 b1 = bytearray(b"----")
3955 b2 = bytearray(b"0123456789")
3956 b3 = bytearray(b"--------------")
3957 nbytes, ancdata, flags, addr = self.serv_sock.recvmsg_into(
3958 [b1, memoryview(b2)[2:9], b3])
3959 self.assertEqual(nbytes, len(b"Mary had a little lamb"))
3960 self.assertEqual(b1, bytearray(b"Mary"))
3961 self.assertEqual(b2, bytearray(b"01 had a 9"))
3962 self.assertEqual(b3, bytearray(b"little lamb---"))
3963 self.checkRecvmsgAddress(addr, self.cli_addr)
3964 self.assertEqual(ancdata, [])
3965 self.checkFlags(flags, eor=True)
3966
3967 def _testRecvmsgIntoScatter(self):
3968 self.sendToServer(b"Mary had a little lamb")

Callers

nothing calls this directly

Calls 4

recvmsg_intoMethod · 0.80
checkFlagsMethod · 0.80
assertEqualMethod · 0.45
checkRecvmsgAddressMethod · 0.45

Tested by

no test coverage detected