summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_asyncio/test_sslproto.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2017-10-19 18:12:44 (GMT)
committerYury Selivanov <yury@magic.io>2017-10-19 18:12:44 (GMT)
commit9c23b173b823b5e6da01d85c570c7ae2ab07b38b (patch)
tree26b428d9ac292c58b08c653f9c5888b06ad66d33 /Lib/test/test_asyncio/test_sslproto.py
parent4d9a8f22999de489ede9216ff983d4359d837760 (diff)
downloadcpython-9c23b173b823b5e6da01d85c570c7ae2ab07b38b.zip
cpython-9c23b173b823b5e6da01d85c570c7ae2ab07b38b.tar.gz
cpython-9c23b173b823b5e6da01d85c570c7ae2ab07b38b.tar.bz2
bpo-31632: fix set_protocol() in _SSLProtocolTransport (GH-3817) (GH-3817) (#4052)
(cherry picked from commit ea2ef5d0ca869d4550820ed53bdf56013dbb9546)
Diffstat (limited to 'Lib/test/test_asyncio/test_sslproto.py')
-rw-r--r--Lib/test/test_asyncio/test_sslproto.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Lib/test/test_asyncio/test_sslproto.py b/Lib/test/test_asyncio/test_sslproto.py
index bcd236e..f573ae8 100644
--- a/Lib/test/test_asyncio/test_sslproto.py
+++ b/Lib/test/test_asyncio/test_sslproto.py
@@ -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()