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

Method test_connect_with_ca_bundle

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

Source from the content-addressed store, hash-verified

648 @client_context.require_no_api_version
649 @ignore_deprecations
650 def test_connect_with_ca_bundle(self):
651 def remove(path):
652 try:
653 os.remove(path)
654 except OSError:
655 pass
656
657 temp_ca_bundle = os.path.join(CERT_PATH, "trusted-ca-bundle.pem")
658 self.addCleanup(remove, temp_ca_bundle)
659 # Add the CA cert file to the bundle.
660 cat_files(temp_ca_bundle, CA_BUNDLE_PEM, CA_PEM)
661 with self.simple_client(
662 "localhost", tls=True, tlsCertificateKeyFile=CLIENT_PEM, tlsCAFile=temp_ca_bundle
663 ) as client:
664 self.assertTrue(client.admin.command("ping"))
665
666 @client_context.require_async
667 @unittest.skipUnless(_HAVE_PYOPENSSL, "PyOpenSSL is not available.")

Callers

nothing calls this directly

Calls 5

cat_filesFunction · 0.90
addCleanupMethod · 0.80
joinMethod · 0.45
simple_clientMethod · 0.45
commandMethod · 0.45

Tested by

no test coverage detected