asyncio: Add set_protocol / get_protocol methods to Transports

This commit is contained in:
Yury Selivanov 2016-09-11 21:11:02 -04:00
parent 06e18a7c24
commit a05a6ef1ca
7 changed files with 45 additions and 0 deletions

View file

@ -25,6 +25,7 @@ class SslProtoHandshakeTests(test_utils.TestCase):
sslcontext = test_utils.dummy_ssl_context()
app_proto = asyncio.Protocol()
proto = sslproto.SSLProtocol(self.loop, app_proto, sslcontext, waiter)
self.assertIs(proto._app_transport.get_protocol(), app_proto)
self.addCleanup(proto._app_transport.close)
return proto