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

Method test__rest_from_mail_cmd

Lib/test/test_smtplib.py:1289–1297  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1287
1288 # Issue 17498: make sure _rset does not raise SMTPServerDisconnected exception
1289 def test__rest_from_mail_cmd(self):
1290 smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost',
1291 timeout=support.LOOPBACK_TIMEOUT)
1292 smtp.noop()
1293 self.serv._SMTPchannel.mail_response = '451 Requested action aborted'
1294 self.serv._SMTPchannel.disconnect = True
1295 with self.assertRaises(smtplib.SMTPSenderRefused):
1296 smtp.sendmail('John', 'Sally', 'test message')
1297 self.assertIsNone(smtp.sock)
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):

Callers

nothing calls this directly

Calls 4

noopMethod · 0.95
sendmailMethod · 0.95
assertIsNoneMethod · 0.80
assertRaisesMethod · 0.45

Tested by

no test coverage detected