mirror of
https://github.com/python/cpython.git
synced 2025-10-09 08:31:26 +00:00
Issue #23779: imaplib raises TypeError if authenticator tries to abort.
Patch from Craig Holmquist.
This commit is contained in:
parent
30f1f67248
commit
5ccc18f298
4 changed files with 24 additions and 1 deletions
|
@ -325,6 +325,25 @@ class BaseThreadedNetworkedTests(unittest.TestCase):
|
|||
self.assertEqual(ret, "OK")
|
||||
|
||||
|
||||
|
||||
@reap_threads
|
||||
def test_aborted_authentication(self):
|
||||
|
||||
class MyServer(SimpleIMAPHandler):
|
||||
|
||||
def cmd_AUTHENTICATE(self, tag, args):
|
||||
self._send_textline('+')
|
||||
self.response = yield
|
||||
|
||||
if self.response == b'*\r\n':
|
||||
self._send_tagged(tag, 'NO', '[AUTHENTICATIONFAILED] aborted')
|
||||
else:
|
||||
self._send_tagged(tag, 'OK', 'MYAUTH successful')
|
||||
|
||||
with self.reaped_pair(MyServer) as (server, client):
|
||||
with self.assertRaises(imaplib.IMAP4.error):
|
||||
code, data = client.authenticate('MYAUTH', lambda x: None)
|
||||
|
||||
def test_linetoolong(self):
|
||||
class TooLongHandler(SimpleIMAPHandler):
|
||||
def handle(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue