(self)
| 286 | smtp.quit() |
| 287 | |
| 288 | def testSourceAddress(self): |
| 289 | # connect |
| 290 | src_port = socket_helper.find_unused_port() |
| 291 | try: |
| 292 | smtp = smtplib.SMTP(self.host, self.port, local_hostname='localhost', |
| 293 | timeout=support.LOOPBACK_TIMEOUT, |
| 294 | source_address=(self.host, src_port)) |
| 295 | self.addCleanup(smtp.close) |
| 296 | self.assertEqual(smtp.source_address, (self.host, src_port)) |
| 297 | self.assertEqual(smtp.local_hostname, 'localhost') |
| 298 | smtp.quit() |
| 299 | except OSError as e: |
| 300 | if e.errno == errno.EADDRINUSE: |
| 301 | self.skipTest("couldn't bind to source port %d" % src_port) |
| 302 | raise |
| 303 | |
| 304 | def testNOOP(self): |
| 305 | smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', |
nothing calls this directly
no test coverage detected