MCPcopy Index your code
hub / github.com/python/cpython / test_aborted_authentication

Method test_aborted_authentication

Lib/test/test_imaplib.py:1014–1029  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1012
1013 @threading_helper.reap_threads
1014 def test_aborted_authentication(self):
1015
1016 class MyServer(SimpleIMAPHandler):
1017
1018 def cmd_AUTHENTICATE(self, tag, args):
1019 self._send_textline('+')
1020 self.response = yield
1021
1022 if self.response == b'*\r\n':
1023 self._send_tagged(tag, 'NO', '[AUTHENTICATIONFAILED] aborted')
1024 else:
1025 self._send_tagged(tag, 'OK', 'MYAUTH successful')
1026
1027 with self.reaped_pair(MyServer) as (server, client):
1028 with self.assertRaises(imaplib.IMAP4.error):
1029 code, data = client.authenticate('MYAUTH', lambda x: None)
1030
1031
1032 def test_linetoolong(self):

Callers

nothing calls this directly

Calls 3

reaped_pairMethod · 0.95
authenticateMethod · 0.80
assertRaisesMethod · 0.45

Tested by

no test coverage detected