]> granicus.if.org Git - python/commitdiff
Fix test.test_crypt.test_methods() to pass on OS X.
authorBrett Cannon <bcannon@gmail.com>
Tue, 22 Feb 2011 20:17:14 +0000 (20:17 +0000)
committerBrett Cannon <bcannon@gmail.com>
Tue, 22 Feb 2011 20:17:14 +0000 (20:17 +0000)
Lib/test/test_crypt.py

index cb4234b5e59dc20cf2942bf632cf3e6e207b114a..306296fe84e45731b775a785a8cd6b0d97923832 100644 (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)