mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
bpo-31632: fix set_protocol() in _SSLProtocolTransport (GH-3817) (GH-3817) (#4052)
(cherry picked from commit ea2ef5d0ca
)
This commit is contained in:
parent
4d9a8f2299
commit
9c23b173b8
4 changed files with 15 additions and 6 deletions
|
@ -121,6 +121,14 @@ class SslProtoHandshakeTests(test_utils.TestCase):
|
|||
ssl_proto.connection_lost(None)
|
||||
self.assertIsNone(ssl_proto._get_extra_info('socket'))
|
||||
|
||||
def test_set_new_app_protocol(self):
|
||||
waiter = asyncio.Future(loop=self.loop)
|
||||
ssl_proto = self.ssl_protocol(waiter)
|
||||
new_app_proto = asyncio.Protocol()
|
||||
ssl_proto._app_transport.set_protocol(new_app_proto)
|
||||
self.assertIs(ssl_proto._app_transport.get_protocol(), new_app_proto)
|
||||
self.assertIs(ssl_proto._app_protocol, new_app_proto)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue