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

Method test_transport_eof

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

Source from the content-addressed store, hash-verified

2424 self.ssl_io_loop(sock, incoming, outgoing, sslobj.unwrap)
2425
2426 def test_transport_eof(self):
2427 client_context, server_context, hostname = testing_context()
2428 with socket.socket(socket.AF_INET) as sock:
2429 sock.connect(self.server_addr)
2430 incoming = ssl.MemoryBIO()
2431 outgoing = ssl.MemoryBIO()
2432 sslobj = client_context.wrap_bio(incoming, outgoing,
2433 server_hostname=hostname)
2434 self.ssl_io_loop(sock, incoming, outgoing, sslobj.do_handshake)
2435
2436 # Simulate EOF from the transport.
2437 incoming.write_eof()
2438 self.assertRaises(ssl.SSLEOFError, sslobj.read)
2439
2440
2441@unittest.skipUnless(has_tls_version('TLSv1_3'), "TLS 1.3 is not available")

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