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

Method testSendBinary

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

Source from the content-addressed store, hash-verified

395 self.assertEqual(self.output.getvalue(), mexpect)
396
397 def testSendBinary(self):
398 m = b'A test message'
399 smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost',
400 timeout=support.LOOPBACK_TIMEOUT)
401 self.addCleanup(smtp.close)
402 smtp.sendmail('John', 'Sally', m)
403 # XXX (see comment in testSend)
404 time.sleep(0.01)
405 smtp.quit()
406
407 self.client_evt.set()
408 self.serv_evt.wait()
409 self.output.flush()
410 mexpect = '%s%s\n%s' % (MSG_BEGIN, m.decode('ascii'), MSG_END)
411 self.assertEqual(self.output.getvalue(), mexpect)
412
413 def testSendNeedingDotQuote(self):
414 # Issue 12283

Callers

nothing calls this directly

Calls 10

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

Tested by

no test coverage detected