summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_asyncio/test_base_events.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_asyncio/test_base_events.py')
-rw-r--r--Lib/test/test_asyncio/test_base_events.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/Lib/test/test_asyncio/test_base_events.py b/Lib/test/test_asyncio/test_base_events.py
index 488257b..1fc7473 100644
--- a/Lib/test/test_asyncio/test_base_events.py
+++ b/Lib/test/test_asyncio/test_base_events.py
@@ -1053,6 +1053,14 @@ class BaseEventLoopWithSelectorTests(test_utils.TestCase):
'A Stream Socket was expected'):
self.loop.run_until_complete(coro)
+ def test_create_server_ssl_timeout_for_plain_socket(self):
+ coro = self.loop.create_server(
+ MyProto, 'example.com', 80, ssl_handshake_timeout=1)
+ with self.assertRaisesRegex(
+ ValueError,
+ 'ssl_handshake_timeout is only meaningful with ssl'):
+ self.loop.run_until_complete(coro)
+
@unittest.skipUnless(hasattr(socket, 'SOCK_NONBLOCK'),
'no socket.SOCK_NONBLOCK (linux only)')
def test_create_server_stream_bittype(self):
@@ -1362,6 +1370,14 @@ class BaseEventLoopWithSelectorTests(test_utils.TestCase):
self.addCleanup(sock.close)
self.assertRaises(ValueError, self.loop.run_until_complete, coro)
+ def test_create_connection_ssl_timeout_for_plain_socket(self):
+ coro = self.loop.create_connection(
+ MyProto, 'example.com', 80, ssl_handshake_timeout=1)
+ with self.assertRaisesRegex(
+ ValueError,
+ 'ssl_handshake_timeout is only meaningful with ssl'):
+ self.loop.run_until_complete(coro)
+
def test_create_server_empty_host(self):
# if host is empty string use None instead
host = object()