]> granicus.if.org Git - python/commitdiff
Issue #15095: Use better assertions in test_imaplib
authorNick Coghlan <ncoghlan@gmail.com>
Sun, 17 Jun 2012 11:10:21 +0000 (21:10 +1000)
committerNick Coghlan <ncoghlan@gmail.com>
Sun, 17 Jun 2012 11:10:21 +0000 (21:10 +1000)
Lib/test/test_imaplib.py

index 7e9329cc4cc1e8d1192b007b53cc48171f483e00..5c99a58570ea5507b4d32c29fddfdafc00ffa481 100644 (file)
@@ -233,8 +233,8 @@ class RemoteIMAPTest(unittest.TestCase):
         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)
+            self.assertIn('LOGINDISABLED', self.server.capabilities)
+            self.assertIn('AUTH=ANONYMOUS', self.server.capabilities)
             rs = self.server.login(self.username, self.password)
             self.assertEqual(rs[0], 'OK')
 
@@ -257,7 +257,7 @@ class RemoteIMAP_STARTTLSTest(RemoteIMAPTest):
     def test_logincapa(self):
         for cap in self.server.capabilities:
             self.assertIsInstance(cap, str)
-        self.assertFalse('LOGINDISABLED' in self.server.capabilities)
+        self.assertNotIn('LOGINDISABLED', self.server.capabilities)
 
 
 @unittest.skipUnless(ssl, "SSL not available")
@@ -268,8 +268,8 @@ class RemoteIMAP_SSLTest(RemoteIMAPTest):
     def test_logincapa(self):
         for cap in self.server.capabilities:
             self.assertIsInstance(cap, str)
-        self.assertFalse('LOGINDISABLED' in self.server.capabilities)
-        self.assertTrue('AUTH=PLAIN' in self.server.capabilities)
+        self.assertNotIn('LOGINDISABLED', self.server.capabilities)
+        self.assertIn('AUTH=PLAIN', self.server.capabilities)
 
 
 def test_main():