(self)
| 1298 | |
| 1299 | # Issue 5713: make sure close, not rset, is called if we get a 421 error |
| 1300 | def test_421_from_mail_cmd(self): |
| 1301 | smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', |
| 1302 | timeout=support.LOOPBACK_TIMEOUT) |
| 1303 | smtp.noop() |
| 1304 | self.serv._SMTPchannel.mail_response = '421 closing connection' |
| 1305 | with self.assertRaises(smtplib.SMTPSenderRefused): |
| 1306 | smtp.sendmail('John', 'Sally', 'test message') |
| 1307 | self.assertIsNone(smtp.sock) |
| 1308 | self.assertEqual(self.serv._SMTPchannel.rset_count, 0) |
| 1309 | |
| 1310 | def test_421_from_rcpt_cmd(self): |
| 1311 | smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', |
nothing calls this directly
no test coverage detected