diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2011-03-23 02:10:14 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2011-03-23 02:10:14 (GMT) |
commit | 924cbea46730a937c082e10512e7583a493e70af (patch) | |
tree | b2050b853df6dfab6ccc34fd02caea2bab9961ef /Lib/test/test_imaplib.py | |
parent | b1aef23316b093e042bc6afa7e52cd9d7c95802c (diff) | |
download | cpython-924cbea46730a937c082e10512e7583a493e70af.zip cpython-924cbea46730a937c082e10512e7583a493e70af.tar.gz cpython-924cbea46730a937c082e10512e7583a493e70af.tar.bz2 |
Use transient_internet() consistently in test_imaplib
Diffstat (limited to 'Lib/test/test_imaplib.py')
-rw-r--r-- | Lib/test/test_imaplib.py | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/Lib/test/test_imaplib.py b/Lib/test/test_imaplib.py index 4ece1bf..8034000 100644 --- a/Lib/test/test_imaplib.py +++ b/Lib/test/test_imaplib.py @@ -219,20 +219,23 @@ class RemoteIMAPTest(unittest.TestCase): def tearDown(self): if self.server is not None: - self.server.logout() + with transient_internet(self.host): + self.server.logout() def test_logincapa(self): - for cap in self.server.capabilities: - self.assertIsInstance(cap, str) - self.assertTrue('LOGINDISABLED' in self.server.capabilities) - self.assertTrue('AUTH=ANONYMOUS' in self.server.capabilities) - rs = self.server.login(self.username, self.password) - self.assertEqual(rs[0], 'OK') + with transient_internet(self.host): + for cap in self.server.capabilities: + self.assertIsInstance(cap, str) + self.assertTrue('LOGINDISABLED' in self.server.capabilities) + self.assertTrue('AUTH=ANONYMOUS' in self.server.capabilities) + rs = self.server.login(self.username, self.password) + self.assertEqual(rs[0], 'OK') def test_logout(self): - rs = self.server.logout() - self.server = None - self.assertEqual(rs[0], 'BYE') + with transient_internet(self.host): + rs = self.server.logout() + self.server = None + self.assertEqual(rs[0], 'BYE') @unittest.skipUnless(ssl, "SSL not available") @@ -240,8 +243,9 @@ class RemoteIMAP_STARTTLSTest(RemoteIMAPTest): def setUp(self): super().setUp() - rs = self.server.starttls() - self.assertEqual(rs[0], 'OK') + with transient_internet(self.host): + rs = self.server.starttls() + self.assertEqual(rs[0], 'OK') def test_logincapa(self): for cap in self.server.capabilities: |