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

Method test_invalid_authentication

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

Source from the content-addressed store, hash-verified

424 client.authenticate('METHOD', lambda: 1)
425
426 def test_invalid_authentication(self):
427 class MyServer(SimpleIMAPHandler):
428 def cmd_AUTHENTICATE(self, tag, args):
429 self._send_textline('+')
430 self.response = yield
431 self._send_tagged(tag, 'NO', '[AUTHENTICATIONFAILED] invalid')
432 client, _ = self._setup(MyServer)
433 with self.assertRaisesRegex(imaplib.IMAP4.error,
434 r'\[AUTHENTICATIONFAILED\] invalid'):
435 client.authenticate('MYAUTH', lambda x: b'fake')
436
437 def test_valid_authentication_bytes(self):
438 class MyServer(SimpleIMAPHandler):

Callers

nothing calls this directly

Calls 3

_setupMethod · 0.95
assertRaisesRegexMethod · 0.80
authenticateMethod · 0.80

Tested by

no test coverage detected