(self)
| 1319 | self.assertDictEqual(r.exception.args[0], {'Frank': (421, b'closing')}) |
| 1320 | |
| 1321 | def test_421_from_data_cmd(self): |
| 1322 | class MySimSMTPChannel(SimSMTPChannel): |
| 1323 | def found_terminator(self): |
| 1324 | if self.smtp_state == self.DATA: |
| 1325 | self.push('421 closing') |
| 1326 | else: |
| 1327 | super().found_terminator() |
| 1328 | self.serv.channel_class = MySimSMTPChannel |
| 1329 | smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', |
| 1330 | timeout=support.LOOPBACK_TIMEOUT) |
| 1331 | smtp.noop() |
| 1332 | with self.assertRaises(smtplib.SMTPDataError): |
| 1333 | smtp.sendmail('John@foo.org', ['Sally@foo.org'], 'test message') |
| 1334 | self.assertIsNone(smtp.sock) |
| 1335 | self.assertEqual(self.serv._SMTPchannel.rcpt_count, 0) |
| 1336 | |
| 1337 | def test_smtputf8_NotSupportedError_if_no_server_support(self): |
| 1338 | smtp = smtplib.SMTP( |
nothing calls this directly
no test coverage detected