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

Method create_client

test/test_auth_oidc.py:162–174  ·  view source on GitHub ↗
(self, *args, **kwargs)

Source from the content-addressed store, hash-verified

160 return Inner()
161
162 def create_client(self, *args, **kwargs):
163 username = kwargs.get("username", "test_user1")
164 if kwargs.get("username") in ["test_user1", "test_user2"]:
165 kwargs["username"] = f"{username}@{DOMAIN}"
166 request_cb = kwargs.pop("request_cb", self.create_request_cb(username=username))
167 props = kwargs.pop("authmechanismproperties", {"OIDC_HUMAN_CALLBACK": request_cb})
168 kwargs["retryReads"] = False
169 if not len(args):
170 args = [self.uri_single]
171
172 client = self.simple_client(*args, authmechanismproperties=props, **kwargs)
173
174 return client
175
176 def test_1_1_single_principal_implicit_username(self):
177 # Create default OIDC client with authMechanism=MONGODB-OIDC.

Calls 4

create_request_cbMethod · 0.95
getMethod · 0.45
popMethod · 0.45
simple_clientMethod · 0.45

Tested by

no test coverage detected