Skip to content

Commit 5349164

Browse files
committed
fix test pt2
1 parent 03f4ba1 commit 5349164

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

test/asynchronous/test_ssl.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
from pymongo import AsyncMongoClient, ssl_support
4444
from pymongo.errors import ConfigurationError, ConnectionFailure, OperationFailure
4545
from pymongo.hello import HelloCompat
46-
from pymongo.ssl_support import HAVE_SSL, _pyssl, _ssl, get_ssl_context
46+
from pymongo.ssl_support import HAVE_PYSSL, HAVE_SSL, _ssl, get_ssl_context
4747
from pymongo.write_concern import WriteConcern
4848

4949
_HAVE_PYOPENSSL = False
@@ -134,7 +134,7 @@ def test_config_ssl(self):
134134

135135
@unittest.skipUnless(_HAVE_PYOPENSSL, "PyOpenSSL is not available.")
136136
def test_use_pyopenssl_when_available(self):
137-
self.assertTrue(_pyssl.IS_PYOPENSSL)
137+
self.assertTrue(HAVE_PYSSL)
138138

139139
@unittest.skipUnless(_HAVE_PYOPENSSL, "Cannot test without PyOpenSSL")
140140
def test_load_trusted_ca_certs(self):
@@ -177,7 +177,7 @@ async def test_tlsCertificateKeyFilePassword(self):
177177
#
178178
# --sslPEMKeyFile=/path/to/pymongo/test/certificates/server.pem
179179
# --sslCAFile=/path/to/pymongo/test/certificates/ca.pem
180-
if not hasattr(ssl, "SSLContext") and not _pyssl.IS_PYOPENSSL:
180+
if not hasattr(ssl, "SSLContext") and not HAVE_PYSSL:
181181
self.assertRaises(
182182
ConfigurationError,
183183
self.simple_client,
@@ -378,7 +378,7 @@ async def test_cert_ssl_validation_hostname_matching(self):
378378
@async_client_context.require_tlsCertificateKeyFile
379379
@ignore_deprecations
380380
async def test_tlsCRLFile_support(self):
381-
if not hasattr(ssl, "VERIFY_CRL_CHECK_LEAF") or _pyssl.IS_PYOPENSSL:
381+
if not hasattr(ssl, "VERIFY_CRL_CHECK_LEAF") or HAVE_PYSSL:
382382
self.assertRaises(
383383
ConfigurationError,
384384
self.simple_client,

test/test_ssl.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
from pymongo import MongoClient, ssl_support
4444
from pymongo.errors import ConfigurationError, ConnectionFailure, OperationFailure
4545
from pymongo.hello import HelloCompat
46-
from pymongo.ssl_support import HAVE_SSL, _pyssl, _ssl, get_ssl_context
46+
from pymongo.ssl_support import HAVE_PYSSL, HAVE_SSL, _ssl, get_ssl_context
4747
from pymongo.write_concern import WriteConcern
4848

4949
_HAVE_PYOPENSSL = False
@@ -134,7 +134,7 @@ def test_config_ssl(self):
134134

135135
@unittest.skipUnless(_HAVE_PYOPENSSL, "PyOpenSSL is not available.")
136136
def test_use_pyopenssl_when_available(self):
137-
self.assertTrue(_pyssl.IS_PYOPENSSL)
137+
self.assertTrue(HAVE_PYSSL)
138138

139139
@unittest.skipUnless(_HAVE_PYOPENSSL, "Cannot test without PyOpenSSL")
140140
def test_load_trusted_ca_certs(self):
@@ -177,7 +177,7 @@ def test_tlsCertificateKeyFilePassword(self):
177177
#
178178
# --sslPEMKeyFile=/path/to/pymongo/test/certificates/server.pem
179179
# --sslCAFile=/path/to/pymongo/test/certificates/ca.pem
180-
if not hasattr(ssl, "SSLContext") and not _pyssl.IS_PYOPENSSL:
180+
if not hasattr(ssl, "SSLContext") and not HAVE_PYSSL:
181181
self.assertRaises(
182182
ConfigurationError,
183183
self.simple_client,
@@ -378,7 +378,7 @@ def test_cert_ssl_validation_hostname_matching(self):
378378
@client_context.require_tlsCertificateKeyFile
379379
@ignore_deprecations
380380
def test_tlsCRLFile_support(self):
381-
if not hasattr(ssl, "VERIFY_CRL_CHECK_LEAF") or _pyssl.IS_PYOPENSSL:
381+
if not hasattr(ssl, "VERIFY_CRL_CHECK_LEAF") or HAVE_PYSSL:
382382
self.assertRaises(
383383
ConfigurationError,
384384
self.simple_client,

0 commit comments

Comments
 (0)