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

Method testSendNullSender

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

Source from the content-addressed store, hash-verified

473 self.assertNotIn("X-INJECTED-2", debugout)
474
475 def testSendNullSender(self):
476 m = 'A test message'
477 smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost',
478 timeout=support.LOOPBACK_TIMEOUT)
479 self.addCleanup(smtp.close)
480 smtp.sendmail('<>', 'Sally', m)
481 # XXX (see comment in testSend)
482 time.sleep(0.01)
483 smtp.quit()
484
485 self.client_evt.set()
486 self.serv_evt.wait()
487 self.output.flush()
488 mexpect = '%s%s\n%s' % (MSG_BEGIN, m, MSG_END)
489 self.assertEqual(self.output.getvalue(), mexpect)
490 debugout = smtpd.DEBUGSTREAM.getvalue()
491 sender = re.compile("^sender: <>$", re.MULTILINE)
492 self.assertRegex(debugout, sender)
493
494 def testSendMessage(self):
495 m = email.mime.text.MIMEText('A test message')

Callers

nothing calls this directly

Calls 11

sendmailMethod · 0.95
quitMethod · 0.95
addCleanupMethod · 0.80
assertRegexMethod · 0.80
sleepMethod · 0.45
setMethod · 0.45
waitMethod · 0.45
flushMethod · 0.45
assertEqualMethod · 0.45
getvalueMethod · 0.45
compileMethod · 0.45

Tested by

no test coverage detected