summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_asyncio/test_base_events.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@dropbox.com>2013-11-01 21:24:28 (GMT)
committerGuido van Rossum <guido@dropbox.com>2013-11-01 21:24:28 (GMT)
commit05c511f1cad2c423c5341bca768d2cd12161edbd (patch)
tree303287a91832bf89069ce5e2cb4b3395a107b5ac /Lib/test/test_asyncio/test_base_events.py
parent28dff0d8238aa8f34e7858209e598f1db8bfbf70 (diff)
downloadcpython-05c511f1cad2c423c5341bca768d2cd12161edbd.zip
cpython-05c511f1cad2c423c5341bca768d2cd12161edbd.tar.gz
cpython-05c511f1cad2c423c5341bca768d2cd12161edbd.tar.bz2
asyncio: Slight rearrangement of tests for server_hostname=...
Diffstat (limited to 'Lib/test/test_asyncio/test_base_events.py')
-rw-r--r--Lib/test/test_asyncio/test_base_events.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/test/test_asyncio/test_base_events.py b/Lib/test/test_asyncio/test_base_events.py
index f093ed0..9b883c5 100644
--- a/Lib/test/test_asyncio/test_base_events.py
+++ b/Lib/test/test_asyncio/test_base_events.py
@@ -444,7 +444,7 @@ class BaseEventLoopWithSelectorTests(unittest.TestCase):
self.assertRaises(
OSError, self.loop.run_until_complete, coro)
- def test_create_connection_server_hostname_default(self):
+ def test_create_connection_ssl_server_hostname_default(self):
self.loop.getaddrinfo = unittest.mock.Mock()
def mock_getaddrinfo(*args, **kwds):
@@ -490,8 +490,8 @@ class BaseEventLoopWithSelectorTests(unittest.TestCase):
server_side=False,
server_hostname='')
- def test_create_connection_server_hostname_errors(self):
- # When not using ssl, server_hostname must be None (but '' is OK).
+ def test_create_connection_no_ssl_server_hostname_errors(self):
+ # When not using ssl, server_hostname must be None.
coro = self.loop.create_connection(MyProto, 'python.org', 80,
server_hostname='')
self.assertRaises(ValueError, self.loop.run_until_complete, coro)
@@ -499,6 +499,7 @@ class BaseEventLoopWithSelectorTests(unittest.TestCase):
server_hostname='python.org')
self.assertRaises(ValueError, self.loop.run_until_complete, coro)
+ def test_create_connection_ssl_server_hostname_errors(self):
# When using ssl, server_hostname may be None if host is non-empty.
coro = self.loop.create_connection(MyProto, '', 80, ssl=True)
self.assertRaises(ValueError, self.loop.run_until_complete, coro)