Fix test.test_crypt.test_methods() to pass on OS X.

This commit is contained in:
Brett Cannon 2011-02-22 20:17:14 +00:00
parent b94767ff44
commit 292ee5dc43
1 changed files with 4 additions and 1 deletions

View File

@ -25,7 +25,10 @@ class CryptTestCase(unittest.TestCase):
self.assertEqual(len(pw), method.total_size)
def test_methods(self):
self.assertTrue(len(crypt.methods()) > 1)
# Gurantee that METHOD_CRYPT is the last method in crypt.methods().
methods = crypt.methods()
self.assertTrue(len(methods) >= 1)
self.assertEqual(crypt.METHOD_CRYPT, methods[-1])
def test_main():
support.run_unittest(CryptTestCase)