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

Method test_421_from_rcpt_cmd

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

Source from the content-addressed store, hash-verified

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',
1312 timeout=support.LOOPBACK_TIMEOUT)
1313 smtp.noop()
1314 self.serv._SMTPchannel.rcpt_response = ['250 accepted', '421 closing']
1315 with self.assertRaises(smtplib.SMTPRecipientsRefused) as r:
1316 smtp.sendmail('John', ['Sally', 'Frank', 'George'], 'test message')
1317 self.assertIsNone(smtp.sock)
1318 self.assertEqual(self.serv._SMTPchannel.rset_count, 0)
1319 self.assertDictEqual(r.exception.args[0], {'Frank': (421, b'closing')})
1320
1321 def test_421_from_data_cmd(self):
1322 class MySimSMTPChannel(SimSMTPChannel):

Callers

nothing calls this directly

Calls 6

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

Tested by

no test coverage detected