R. David Murray | 87e2074 | 2009-05-23 01:30:26 +0000 | [diff] [blame] | 1 | #!/usr/bin/env python |
| 2 | |
| 3 | import unittest |
| 4 | from test import support |
| 5 | import smtplib |
| 6 | |
R. David Murray | eccb2ce | 2009-05-23 02:36:15 +0000 | [diff] [blame^] | 7 | support.requires("network") |
R. David Murray | 87e2074 | 2009-05-23 01:30:26 +0000 | [diff] [blame] | 8 | |
| 9 | class SmtpSSLTest(unittest.TestCase): |
| 10 | testServer = 'smtp.gmail.com' |
| 11 | remotePort = 465 |
| 12 | |
| 13 | def test_connect(self): |
R. David Murray | eccb2ce | 2009-05-23 02:36:15 +0000 | [diff] [blame^] | 14 | support.get_attribute(smtplib, 'SMTP_SSL') |
R. David Murray | 87e2074 | 2009-05-23 01:30:26 +0000 | [diff] [blame] | 15 | server = smtplib.SMTP_SSL(self.testServer, self.remotePort) |
| 16 | server.ehlo() |
| 17 | server.quit() |
| 18 | |
| 19 | def test_main(): |
| 20 | support.run_unittest(SmtpSSLTest) |
| 21 | |
| 22 | if __name__ == "__main__": |
| 23 | test_main() |