[Python-checkins] cpython: asyncio: Slight rearrangement of tests for server_hostname=...

guido.van.rossum python-checkins at python.org
Fri Nov 1 22:25:57 CET 2013


http://hg.python.org/cpython/rev/123804a72a8f
changeset:   86833:123804a72a8f
user:        Guido van Rossum <guido at dropbox.com>
date:        Fri Nov 01 14:24:28 2013 -0700
summary:
  asyncio: Slight rearrangement of tests for server_hostname=...

files:
  Lib/test/test_asyncio/test_base_events.py |  7 ++++---
  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
--- a/Lib/test/test_asyncio/test_base_events.py
+++ b/Lib/test/test_asyncio/test_base_events.py
@@ -444,7 +444,7 @@
         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 @@
                                                          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 @@
                                            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)

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list