summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_poplib.py
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2013-12-15 20:44:43 (GMT)
committerChristian Heimes <christian@cheimes.de>2013-12-15 20:44:43 (GMT)
commite8a257cdb157f8ab6bc707b3bc618d5c85d36b73 (patch)
tree695fa5bd1e14827e1255cf6c394fccc1433ddef7 /Lib/test/test_poplib.py
parentcd81520e445d046b459f0eeba456ef05989a71b0 (diff)
downloadcpython-e8a257cdb157f8ab6bc707b3bc618d5c85d36b73.zip
cpython-e8a257cdb157f8ab6bc707b3bc618d5c85d36b73.tar.gz
cpython-e8a257cdb157f8ab6bc707b3bc618d5c85d36b73.tar.bz2
test_poplib: skip stls_context test when SNI is not available
Diffstat (limited to 'Lib/test/test_poplib.py')
-rw-r--r--Lib/test/test_poplib.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_poplib.py b/Lib/test/test_poplib.py
index eac77aa..aced208 100644
--- a/Lib/test/test_poplib.py
+++ b/Lib/test/test_poplib.py
@@ -21,10 +21,14 @@ PORT = 0
SUPPORTS_SSL = False
if hasattr(poplib, 'POP3_SSL'):
import ssl
+ from ssl import HAS_SNI
SUPPORTS_SSL = True
CERTFILE = os.path.join(os.path.dirname(__file__) or os.curdir, "keycert3.pem")
CAFILE = os.path.join(os.path.dirname(__file__) or os.curdir, "pycacert.pem")
+else:
+ HAS_SNI = False
+
requires_ssl = skipUnless(SUPPORTS_SSL, 'SSL not supported')
# the dummy data returned by server when LIST and RETR commands are issued
@@ -330,6 +334,7 @@ class TestPOP3Class(TestCase):
self.assertEqual(resp, expected)
@requires_ssl
+ @skipUnless(HAS_SNI, 'No SNI support in ssl module')
def test_stls_context(self):
expected = b'+OK Begin TLS negotiation'
ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1)