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

Function _connect

test/ocsp/test_ocsp.py:43–51  ·  view source on GitHub ↗
(options)

Source from the content-addressed store, hash-verified

41
42
43def _connect(options):
44 assert CA_FILE is not None
45 uri = f"mongodb://localhost:27017/?serverSelectionTimeoutMS=10000&tlsCAFile={Path(CA_FILE).as_posix()}&{options}"
46 print(uri)
47 try:
48 client = pymongo.MongoClient(uri)
49 client.admin.command("ping")
50 finally:
51 client.close()
52
53
54class TestOCSP(unittest.TestCase):

Callers 3

test_tls_insecureMethod · 0.85
test_tlsMethod · 0.85

Calls 3

closeMethod · 0.95
MongoClientMethod · 0.45
commandMethod · 0.45

Tested by

no test coverage detected