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

Method test_wincertstore

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

Source from the content-addressed store, hash-verified

515 ssl_support.HAVE_WINCERTSTORE = have_wincertstore
516
517 def test_wincertstore(self):
518 if sys.platform != "win32":
519 raise SkipTest("Only valid on Windows.")
520 if hasattr(ssl, "SSLContext"):
521 # SSLSocket doesn't provide ca_certs attribute on pythons
522 # with SSLContext and SSLContext provides no information
523 # about ca_certs.
524 raise SkipTest("Can't test when SSLContext available.")
525 if not ssl_support.HAVE_WINCERTSTORE:
526 raise SkipTest("Need wincertstore to test wincertstore.")
527
528 ctx = get_ssl_context(None, None, CA_PEM, None, False, False, False, _IS_SYNC)
529 ssl_sock = ctx.wrap_socket(socket.socket())
530 self.assertEqual(ssl_sock.ca_certs, CA_PEM)
531
532 ctx = get_ssl_context(None, None, None, None, False, False, False, _IS_SYNC)
533 ssl_sock = ctx.wrap_socket(socket.socket())
534 self.assertEqual(ssl_sock.ca_certs, ssl_support._WINCERTS.name)
535
536 @client_context.require_auth
537 @client_context.require_tlsCertificateKeyFile

Callers

nothing calls this directly

Calls 2

get_ssl_contextFunction · 0.90
wrap_socketMethod · 0.80

Tested by

no test coverage detected