(self)
| 492 | self.assertRegex(debugout, sender) |
| 493 | |
| 494 | def testSendMessage(self): |
| 495 | m = email.mime.text.MIMEText('A test message') |
| 496 | smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', |
| 497 | timeout=support.LOOPBACK_TIMEOUT) |
| 498 | self.addCleanup(smtp.close) |
| 499 | smtp.send_message(m, from_addr='John', to_addrs='Sally') |
| 500 | # XXX (see comment in testSend) |
| 501 | time.sleep(0.01) |
| 502 | smtp.quit() |
| 503 | |
| 504 | self.client_evt.set() |
| 505 | self.serv_evt.wait() |
| 506 | self.output.flush() |
| 507 | # Remove the X-Peer header that DebuggingServer adds as figuring out |
| 508 | # exactly what IP address format is put there is not easy (and |
| 509 | # irrelevant to our test). Typically 127.0.0.1 or ::1, but it is |
| 510 | # not always the same as socket.gethostbyname(HOST). :( |
| 511 | test_output = self.get_output_without_xpeer() |
| 512 | del m['X-Peer'] |
| 513 | mexpect = '%s%s\n%s' % (MSG_BEGIN, m.as_string(), MSG_END) |
| 514 | self.assertEqual(test_output, mexpect) |
| 515 | |
| 516 | def testSendMessageWithAddresses(self): |
| 517 | m = email.mime.text.MIMEText('A test message') |
nothing calls this directly
no test coverage detected