(self)
| 479 | client.login_cram_md5("tim", b"tanstaaftanstaaf") |
| 480 | |
| 481 | def test_aborted_authentication(self): |
| 482 | class MyServer(SimpleIMAPHandler): |
| 483 | def cmd_AUTHENTICATE(self, tag, args): |
| 484 | self._send_textline('+') |
| 485 | self.response = yield |
| 486 | if self.response == b'*\r\n': |
| 487 | self._send_tagged( |
| 488 | tag, |
| 489 | 'NO', |
| 490 | '[AUTHENTICATIONFAILED] aborted') |
| 491 | else: |
| 492 | self._send_tagged(tag, 'OK', 'MYAUTH successful') |
| 493 | client, _ = self._setup(MyServer) |
| 494 | with self.assertRaisesRegex(imaplib.IMAP4.error, |
| 495 | r'\[AUTHENTICATIONFAILED\] aborted'): |
| 496 | client.authenticate('MYAUTH', lambda x: None) |
| 497 | |
| 498 | @mock.patch('imaplib._MAXLINE', 10) |
| 499 | def test_linetoolong(self): |
nothing calls this directly
no test coverage detected