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

Method test_transport_eof

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

Source from the content-addressed store, hash-verified

2207 self.ssl_io_loop(sock, incoming, outgoing, sslobj.unwrap)
2208
2209 def test_transport_eof(self):
2210 client_context, server_context, hostname = testing_context()
2211 with socket.socket(socket.AF_INET) as sock:
2212 sock.connect(self.server_addr)
2213 incoming = ssl.MemoryBIO()
2214 outgoing = ssl.MemoryBIO()
2215 sslobj = client_context.wrap_bio(incoming, outgoing,
2216 server_hostname=hostname)
2217 self.ssl_io_loop(sock, incoming, outgoing, sslobj.do_handshake)
2218
2219 # Simulate EOF from the transport.
2220 incoming.write_eof()
2221 self.assertRaises(ssl.SSLEOFError, sslobj.read)
2222
2223
2224@support.requires_resource('network')

Callers

nothing calls this directly

Calls 7

ssl_io_loopMethod · 0.95
testing_contextFunction · 0.85
socketMethod · 0.80
wrap_bioMethod · 0.80
connectMethod · 0.45
write_eofMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected