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

Method test_invalid_authentication

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

Source from the content-addressed store, hash-verified

947
948 @threading_helper.reap_threads
949 def test_invalid_authentication(self):
950
951 class MyServer(SimpleIMAPHandler):
952
953 def cmd_AUTHENTICATE(self, tag, args):
954 self._send_textline('+')
955 self.response = yield
956 self._send_tagged(tag, 'NO', '[AUTHENTICATIONFAILED] invalid')
957
958 with self.reaped_pair(MyServer) as (server, client):
959 with self.assertRaises(imaplib.IMAP4.error):
960 code, data = client.authenticate('MYAUTH', lambda x: b'fake')
961
962 @threading_helper.reap_threads
963 def test_valid_authentication(self):

Callers

nothing calls this directly

Calls 3

reaped_pairMethod · 0.95
authenticateMethod · 0.80
assertRaisesMethod · 0.45

Tested by

no test coverage detected