(self)
| 376 | smtp.quit() |
| 377 | |
| 378 | def testSend(self): |
| 379 | # connect and send mail |
| 380 | m = 'A test message' |
| 381 | smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', |
| 382 | timeout=support.LOOPBACK_TIMEOUT) |
| 383 | self.addCleanup(smtp.close) |
| 384 | smtp.sendmail('John', 'Sally', m) |
| 385 | # XXX(nnorwitz): this test is flaky and dies with a bad file descriptor |
| 386 | # in asyncore. This sleep might help, but should really be fixed |
| 387 | # properly by using an Event variable. |
| 388 | time.sleep(0.01) |
| 389 | smtp.quit() |
| 390 | |
| 391 | self.client_evt.set() |
| 392 | self.serv_evt.wait() |
| 393 | self.output.flush() |
| 394 | mexpect = '%s%s\n%s' % (MSG_BEGIN, m, MSG_END) |
| 395 | self.assertEqual(self.output.getvalue(), mexpect) |
| 396 | |
| 397 | def testSendBinary(self): |
| 398 | m = b'A test message' |
nothing calls this directly
no test coverage detected