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

Method __init__

test/__init__.py:99–132  ·  view source on GitHub ↗

Create a client and grab essential information from the server.

(self)

Source from the content-addressed store, hash-verified

97 MULTI_MONGOS_LB_URI = MULTI_MONGOS_LB_URI
98
99 def __init__(self):
100 """Create a client and grab essential information from the server."""
101 self.connection_attempts = []
102 self.connected = False
103 self.w = None
104 self.nodes = set()
105 self.replica_set_name = None
106 self.cmd_line = None
107 self.server_status = None
108 self.version = Version(-1) # Needs to be comparable with Version
109 self.auth_enabled = False
110 self.test_commands_enabled = False
111 self.server_parameters = {}
112 self._hello = None
113 self.is_mongos = False
114 self.mongoses = []
115 self.is_rs = False
116 self.has_ipv6 = False
117 self.tls = False
118 self.tlsCertificateKeyFile = False
119 self.server_is_resolvable = is_server_resolvable()
120 self.default_client_options: Dict = {}
121 self.sessions_enabled = False
122 self.client = None # type: ignore
123 self.conn_lock = threading.Lock()
124 self.load_balancer = TEST_LOADBALANCER
125 self._fips_enabled = None
126 if self.load_balancer:
127 self.default_client_options["loadBalanced"] = True
128 if COMPRESSORS:
129 self.default_client_options["compressors"] = COMPRESSORS
130 if MONGODB_API_VERSION:
131 server_api = ServerApi(MONGODB_API_VERSION)
132 self.default_client_options["server_api"] = server_api
133
134 @property
135 def client_options(self):

Callers

nothing calls this directly

Calls 3

VersionClass · 0.90
is_server_resolvableFunction · 0.90
ServerApiClass · 0.90

Tested by

no test coverage detected