MCPcopy Index your code
hub / github.com/mongodb/mongo-python-driver / test_system_certs_config_error

Method test_system_certs_config_error

test/test_ssl.py:475–492  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

473 )
474
475 def test_system_certs_config_error(self):
476 ctx = get_ssl_context(None, None, None, None, True, True, False, _IS_SYNC)
477 if (sys.platform != "win32" and hasattr(ctx, "set_default_verify_paths")) or hasattr(
478 ctx, "load_default_certs"
479 ):
480 raise SkipTest("Can't test when system CA certificates are loadable.")
481
482 have_certifi = ssl_support.HAVE_CERTIFI
483 have_wincertstore = ssl_support.HAVE_WINCERTSTORE
484 # Force the test regardless of environment.
485 ssl_support.HAVE_CERTIFI = False
486 ssl_support.HAVE_WINCERTSTORE = False
487 try:
488 with self.assertRaises(ConfigurationError):
489 self.simple_client("mongodb://localhost/?ssl=true")
490 finally:
491 ssl_support.HAVE_CERTIFI = have_certifi
492 ssl_support.HAVE_WINCERTSTORE = have_wincertstore
493
494 def test_certifi_support(self):
495 if hasattr(ssl, "SSLContext"):

Callers

nothing calls this directly

Calls 2

get_ssl_contextFunction · 0.90
simple_clientMethod · 0.45

Tested by

no test coverage detected