MCPcopy Create free account
hub / github.com/mongodb/mongo-python-driver / test_scram_sha1

Method test_scram_sha1

test/test_auth.py:412–429  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

410
411 @client_context.require_no_fips
412 def test_scram_sha1(self):
413 host, port = client_context.host, client_context.port
414
415 client = self.rs_or_single_client_noauth(
416 "mongodb://user:pass@%s:%d/pymongo_test?authMechanism=SCRAM-SHA-1" % (host, port)
417 )
418 client.pymongo_test.command("dbstats")
419
420 if client_context.is_rs:
421 uri = (
422 "mongodb://user:pass"
423 "@%s:%d/pymongo_test?authMechanism=SCRAM-SHA-1"
424 "&replicaSet=%s" % (host, port, client_context.replica_set_name)
425 )
426 client = self.single_client_noauth(uri)
427 client.pymongo_test.command("dbstats")
428 db = client.get_database("pymongo_test", read_preference=ReadPreference.SECONDARY)
429 db.command("dbstats")
430
431
432# https://github.com/mongodb/specifications/blob/master/source/auth/auth.md#scram-sha-256-and-mechanism-negotiation

Callers

nothing calls this directly

Calls 4

single_client_noauthMethod · 0.80
commandMethod · 0.45
get_databaseMethod · 0.45

Tested by

no test coverage detected