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

Method test_credentials_hashing

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

Source from the content-addressed store, hash-verified

104 cls.mech_properties = mech_properties
105
106 def test_credentials_hashing(self):
107 # GSSAPI credentials are properly hashed.
108 creds0 = _build_credentials_tuple("GSSAPI", None, "user", "pass", {}, None)
109
110 creds1 = _build_credentials_tuple(
111 "GSSAPI", None, "user", "pass", {"authmechanismproperties": {"SERVICE_NAME": "A"}}, None
112 )
113
114 creds2 = _build_credentials_tuple(
115 "GSSAPI", None, "user", "pass", {"authmechanismproperties": {"SERVICE_NAME": "A"}}, None
116 )
117
118 creds3 = _build_credentials_tuple(
119 "GSSAPI", None, "user", "pass", {"authmechanismproperties": {"SERVICE_NAME": "B"}}, None
120 )
121
122 self.assertEqual(1, len({creds1, creds2}))
123 self.assertEqual(3, len({creds0, creds1, creds2, creds3}))
124
125 @ignore_deprecations
126 def test_gssapi_simple(self):

Callers

nothing calls this directly

Calls 1

_build_credentials_tupleFunction · 0.90

Tested by

no test coverage detected