R. David Murray | eb059b8 | 2009-05-23 01:42:42 +0000 | [diff] [blame^] | 1 | #!/usr/bin/env python |
| 2 | |
| 3 | import unittest |
| 4 | from test import test_support |
| 5 | import smtplib |
| 6 | |
| 7 | test_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 | test_support.run_unittest(SmtpSSLTest) |
| 24 | |
| 25 | if __name__ == "__main__": |
| 26 | test_main() |