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 | |
| 7 | support.requires( |
| 8 | "network", |
| 9 | "use of network resource is not enabled and " |
| 10 | "test requires Internet access for communication with smtp.gmail.com:465", |
| 11 | ) |
| 12 | |
| 13 | class SmtpSSLTest(unittest.TestCase): |
| 14 | testServer = 'smtp.gmail.com' |
| 15 | remotePort = 465 |
| 16 | |
| 17 | def test_connect(self): |
| 18 | server = smtplib.SMTP_SSL(self.testServer, self.remotePort) |
| 19 | server.ehlo() |
| 20 | server.quit() |
| 21 | |
| 22 | def test_main(): |
| 23 | support.run_unittest(SmtpSSLTest) |
| 24 | |
| 25 | if __name__ == "__main__": |
| 26 | test_main() |