@@ -142,7 +142,7 @@ def realtestSocketAuth(self):
142
142
with TempUser (
143
143
self .connect ().cursor (),
144
144
TestAuthentication .osuser + "@localhost" ,
145
- self .databases [0 ]["db " ],
145
+ self .databases [0 ]["database " ],
146
146
self .socket_plugin_name ,
147
147
) as u :
148
148
c = pymysql .connect (user = TestAuthentication .osuser , ** self .db )
@@ -216,7 +216,7 @@ def realTestDialogAuthTwoQuestions(self):
216
216
with TempUser (
217
217
self .connect ().cursor (),
218
218
"pymysql_2q@localhost" ,
219
- self .databases [0 ]["db " ],
219
+ self .databases [0 ]["database " ],
220
220
"two_questions" ,
221
221
"notverysecret" ,
222
222
) as u :
@@ -258,7 +258,7 @@ def realTestDialogAuthThreeAttempts(self):
258
258
with TempUser (
259
259
self .connect ().cursor (),
260
260
"pymysql_3a@localhost" ,
261
- self .databases [0 ]["db " ],
261
+ self .databases [0 ]["database " ],
262
262
"three_attempts" ,
263
263
"stillnotverysecret" ,
264
264
) as u :
@@ -353,7 +353,7 @@ def realTestPamAuth(self):
353
353
with TempUser (
354
354
cur ,
355
355
TestAuthentication .osuser + "@localhost" ,
356
- self .databases [0 ]["db " ],
356
+ self .databases [0 ]["database " ],
357
357
"pam" ,
358
358
os .environ .get ("PAMSERVICE" ),
359
359
) as u :
@@ -392,7 +392,10 @@ def testAuthSHA256(self):
392
392
conn = self .connect ()
393
393
c = conn .cursor ()
394
394
with TempUser (
395
- c , "pymysql_sha256@localhost" , self .databases [0 ]["db" ], "sha256_password"
395
+ c ,
396
+ "pymysql_sha256@localhost" ,
397
+ self .databases [0 ]["database" ],
398
+ "sha256_password" ,
396
399
) as u :
397
400
if self .mysql_server_is (conn , (5 , 7 , 0 )):
398
401
c .execute ("SET PASSWORD FOR 'pymysql_sha256'@'localhost' ='Sh@256Pa33'" )
@@ -442,8 +445,8 @@ def test_autocommit(self):
442
445
443
446
def test_select_db (self ):
444
447
con = self .connect ()
445
- current_db = self .databases [0 ]["db " ]
446
- other_db = self .databases [1 ]["db " ]
448
+ current_db = self .databases [0 ]["database " ]
449
+ other_db = self .databases [1 ]["database " ]
447
450
448
451
cur = con .cursor ()
449
452
cur .execute ("SELECT database()" )
@@ -754,7 +757,7 @@ def test_escape_fallback_encoder(self):
754
757
class Custom (str ):
755
758
pass
756
759
757
- mapping = {str : pymysql .escape_string }
760
+ mapping = {str : pymysql .converters . escape_string }
758
761
self .assertEqual (con .escape (Custom ("foobar" ), mapping ), "'foobar'" )
759
762
760
763
def test_escape_no_default (self ):
0 commit comments