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

Method test_recv_zero

Lib/test/test_ssl.py:3692–3709  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

3690 s.close()
3691
3692 def test_recv_zero(self):
3693 server = ThreadedEchoServer(CERTFILE)
3694 self.enterContext(server)
3695 s = socket.create_connection((HOST, server.port))
3696 self.addCleanup(s.close)
3697 s = test_wrap_socket(s, suppress_ragged_eofs=False)
3698 self.addCleanup(s.close)
3699
3700 # recv/read(0) should return no data
3701 s.send(b"data")
3702 self.assertEqual(s.recv(0), b"")
3703 self.assertEqual(s.read(0), b"")
3704 self.assertEqual(s.read(), b"data")
3705
3706 # Should not block if the other end sends no data
3707 s.setblocking(False)
3708 self.assertEqual(s.recv(0), b"")
3709 self.assertEqual(s.recv_into(bytearray()), 0)
3710
3711 def test_recv_into_buffer_protocol_len(self):
3712 server = ThreadedEchoServer(CERTFILE)

Callers

nothing calls this directly

Calls 11

ThreadedEchoServerClass · 0.85
test_wrap_socketFunction · 0.85
enterContextMethod · 0.80
addCleanupMethod · 0.80
create_connectionMethod · 0.45
sendMethod · 0.45
assertEqualMethod · 0.45
recvMethod · 0.45
readMethod · 0.45
setblockingMethod · 0.45
recv_intoMethod · 0.45

Tested by

no test coverage detected