Commit e51e25a3 authored by Nick Coghlan's avatar Nick Coghlan

Merge from 3.2 (Issue #15095: Use better assertions in test_imaplib)

parents 9aff2a7c e6ef4622
...@@ -233,8 +233,8 @@ class RemoteIMAPTest(unittest.TestCase): ...@@ -233,8 +233,8 @@ class RemoteIMAPTest(unittest.TestCase):
with transient_internet(self.host): with transient_internet(self.host):
for cap in self.server.capabilities: for cap in self.server.capabilities:
self.assertIsInstance(cap, str) self.assertIsInstance(cap, str)
self.assertTrue('LOGINDISABLED' in self.server.capabilities) self.assertIn('LOGINDISABLED', self.server.capabilities)
self.assertTrue('AUTH=ANONYMOUS' in self.server.capabilities) self.assertIn('AUTH=ANONYMOUS', self.server.capabilities)
rs = self.server.login(self.username, self.password) rs = self.server.login(self.username, self.password)
self.assertEqual(rs[0], 'OK') self.assertEqual(rs[0], 'OK')
...@@ -257,7 +257,7 @@ class RemoteIMAP_STARTTLSTest(RemoteIMAPTest): ...@@ -257,7 +257,7 @@ class RemoteIMAP_STARTTLSTest(RemoteIMAPTest):
def test_logincapa(self): def test_logincapa(self):
for cap in self.server.capabilities: for cap in self.server.capabilities:
self.assertIsInstance(cap, str) self.assertIsInstance(cap, str)
self.assertFalse('LOGINDISABLED' in self.server.capabilities) self.assertNotIn('LOGINDISABLED', self.server.capabilities)
@unittest.skipUnless(ssl, "SSL not available") @unittest.skipUnless(ssl, "SSL not available")
...@@ -280,8 +280,8 @@ class RemoteIMAP_SSLTest(RemoteIMAPTest): ...@@ -280,8 +280,8 @@ class RemoteIMAP_SSLTest(RemoteIMAPTest):
try: try:
for cap in server.capabilities: for cap in server.capabilities:
self.assertIsInstance(cap, str) self.assertIsInstance(cap, str)
self.assertFalse('LOGINDISABLED' in server.capabilities) self.assertNotIn('LOGINDISABLED', server.capabilities)
self.assertTrue('AUTH=PLAIN' in server.capabilities) self.assertIn('AUTH=PLAIN', server.capabilities)
rs = server.login(self.username, self.password) rs = server.login(self.username, self.password)
self.assertEqual(rs[0], 'OK') self.assertEqual(rs[0], 'OK')
finally: finally:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment