@@ -332,7 +332,7 @@ def test_auth_plain_initial_response(self):
332332
333333 def test_auth_plain_challenge_response (self ):
334334 secret = b"user\x00 adminuser\x00 password"
335- def authobject (challenge ):
335+ def authobject ():
336336 return secret
337337 resp = self .client .auth ("PLAIN" , authobject = authobject )
338338 self .assertStartsWith (resp , b"+OK" )
@@ -342,10 +342,8 @@ def test_auth_unsupported_mechanism(self):
342342 self .client .auth ("FOO" , authobject = lambda : b"" )
343343
344344 def test_auth_cancel (self ):
345- def authobject (_challenge ):
346- return b"*"
347345 with self .assertRaises (poplib .error_proto ):
348- self .client .auth ("PLAIN" , authobject = authobject )
346+ self .client .auth ("PLAIN" , authobject = lambda chal : b"*" , initial_response_ok = False )
349347
350348 def test_auth_mechanism_case_insensitive (self ):
351349 secret = b"user\x00 adminuser\x00 password"
@@ -359,7 +357,7 @@ def test_auth_initial_response_str(self):
359357 self .assertStartsWith (resp , b"+OK" )
360358
361359 def test_auth_authobject_returns_str (self ):
362- def authobject (challenge ):
360+ def authobject ():
363361 return "user\x00 adminuser\x00 password"
364362 resp = self .client .auth ("PLAIN" , authobject = authobject )
365363 self .assertStartsWith (resp , b"+OK" )
0 commit comments