bpo-37027: Return a proxy socket object from transp.get_extra_info('socket') (GH-13530)

Return a safe to use proxy socket object from `transport.get_extra_info('socket')`




https://bugs.python.org/issue37027
This commit is contained in:
Yury Selivanov 2019-05-27 15:57:20 +02:00 committed by Miss Islington (bot)
parent 674ee12600
commit 8cd5165ba0
7 changed files with 220 additions and 9 deletions

View file

@ -1118,7 +1118,7 @@ class EventLoopTestsMixin:
f = self.loop.create_server(TestMyProto, sock=sock_ob)
server = self.loop.run_until_complete(f)
sock = server.sockets[0]
self.assertIs(sock, sock_ob)
self.assertEqual(sock.fileno(), sock_ob.fileno())
host, port = sock.getsockname()
self.assertEqual(host, '0.0.0.0')