(self)
| 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.") |
nothing calls this directly
no test coverage detected