MCPcopy
hub / github.com/PyMySQL/PyMySQL / testAuthSHA256

Method testAuthSHA256

pymysql/tests/test_connection.py:392–408  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

390 reason="no sha256 password authentication plugin found",
391 )
392 def testAuthSHA256(self):
393 conn = self.connect()
394 c = conn.cursor()
395 with TempUser(
396 c,
397 "pymysql_sha256@localhost",
398 self.databases[0]["database"],
399 "sha256_password",
400 ):
401 c.execute("SET PASSWORD FOR 'pymysql_sha256'@'localhost' ='Sh@256Pa33'")
402 c.execute("FLUSH PRIVILEGES")
403 db = self.db.copy()
404 db["password"] = "Sh@256Pa33"
405 # Although SHA256 is supported, need the configuration of public key of
406 # the mysql server. Currently will get error by this test.
407 with self.assertRaises(pymysql.err.OperationalError):
408 pymysql.connect(user="pymysql_sha256", **db)
409
410 @pytest.mark.skipif(not ed25519_found, reason="no ed25519 authention plugin")
411 def testAuthEd25519(self):

Callers

nothing calls this directly

Calls 4

TempUserClass · 0.85
cursorMethod · 0.80
executeMethod · 0.80
connectMethod · 0.45

Tested by

no test coverage detected