MCPcopy Create free account
hub / github.com/PyMySQL/PyMySQL / test_caching_sha2_password

Function test_caching_sha2_password

tests/test_auth.py:54–86  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

52
53
54def test_caching_sha2_password():
55 con = pymysql.connect(
56 user="user_caching_sha2",
57 password=pass_caching_sha2,
58 host=host,
59 port=port,
60 ssl=None,
61 )
62 con.close()
63
64 # Fast path of caching sha2
65 con = pymysql.connect(
66 user="user_caching_sha2",
67 password=pass_caching_sha2,
68 host=host,
69 port=port,
70 ssl=None,
71 )
72 con.query("FLUSH PRIVILEGES")
73 con.close()
74
75 # Fast path after auth_switch_request
76 pymysql.connections._DEFAULT_AUTH_PLUGIN = "mysql_native_password"
77 con = pymysql.connect(
78 user="user_caching_sha2",
79 password=pass_caching_sha2,
80 host=host,
81 port=port,
82 ssl=ssl,
83 )
84 con.query("FLUSH PRIVILEGES")
85 con.close()
86 pymysql.connections._DEFAULT_AUTH_PLUGIN = None
87
88
89def test_caching_sha2_password_ssl():

Callers

nothing calls this directly

Calls 3

queryMethod · 0.80
connectMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected