Commit cc9ca223 authored by Antoine Pitrou's avatar Antoine Pitrou

Also protect ehlo() and quit() with the transient_internet() context manager

parent e0650206
......@@ -18,8 +18,8 @@ class SmtpTest(unittest.TestCase):
with support.transient_internet(self.testServer):
server = smtplib.SMTP(self.testServer, self.remotePort)
server.starttls(context=self.context)
server.ehlo()
server.quit()
server.ehlo()
server.quit()
class SmtpSSLTest(unittest.TestCase):
......@@ -31,22 +31,22 @@ class SmtpSSLTest(unittest.TestCase):
support.get_attribute(smtplib, 'SMTP_SSL')
with support.transient_internet(self.testServer):
server = smtplib.SMTP_SSL(self.testServer, self.remotePort)
server.ehlo()
server.quit()
server.ehlo()
server.quit()
def test_connect_default_port(self):
support.get_attribute(smtplib, 'SMTP_SSL')
with support.transient_internet(self.testServer):
server = smtplib.SMTP_SSL(self.testServer)
server.ehlo()
server.quit()
server.ehlo()
server.quit()
def test_connect_using_sslcontext(self):
support.get_attribute(smtplib, 'SMTP_SSL')
with support.transient_internet(self.testServer):
server = smtplib.SMTP_SSL(self.testServer, self.remotePort, context=self.context)
server.ehlo()
server.quit()
server.ehlo()
server.quit()
def test_main():
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment