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

Method testRecvmsgIntoScatter

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

Source from the content-addressed store, hash-verified

3847 self.sendToServer(MSG)
3848
3849 def testRecvmsgIntoScatter(self):
3850 # Receive into multiple buffers (scatter write).
3851 b1 = bytearray(b"----")
3852 b2 = bytearray(b"0123456789")
3853 b3 = bytearray(b"--------------")
3854 nbytes, ancdata, flags, addr = self.serv_sock.recvmsg_into(
3855 [b1, memoryview(b2)[2:9], b3])
3856 self.assertEqual(nbytes, len(b"Mary had a little lamb"))
3857 self.assertEqual(b1, bytearray(b"Mary"))
3858 self.assertEqual(b2, bytearray(b"01 had a 9"))
3859 self.assertEqual(b3, bytearray(b"little lamb---"))
3860 self.checkRecvmsgAddress(addr, self.cli_addr)
3861 self.assertEqual(ancdata, [])
3862 self.checkFlags(flags, eor=True)
3863
3864 def _testRecvmsgIntoScatter(self):
3865 self.sendToServer(b"Mary had a little lamb")

Callers

nothing calls this directly

Calls 5

lenFunction · 0.85
recvmsg_intoMethod · 0.80
checkFlagsMethod · 0.80
assertEqualMethod · 0.45
checkRecvmsgAddressMethod · 0.45

Tested by

no test coverage detected