MCPcopy
hub / github.com/PyMySQL/PyMySQL / test_caching_sha2_password

Function test_caching_sha2_password

tests/test_auth.py:53–85  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Used in the wild real call sites across dependent graphs

searching dependent graphs…