]> granicus.if.org Git - python/commitdiff
Issue #12049: test_ssl now checks also that RAND_bytes() raises an error if
authorVictor Stinner <victor.stinner@haypocalc.com>
Wed, 25 May 2011 09:15:16 +0000 (11:15 +0200)
committerVictor Stinner <victor.stinner@haypocalc.com>
Wed, 25 May 2011 09:15:16 +0000 (11:15 +0200)
there is not enough entropy.

Lib/test/test_ssl.py

index 8c219756e1f0e96b2adddeba98264bf03057f125..5193c150375c31eac12ebc35a046e0920898126c 100644 (file)
@@ -109,6 +109,8 @@ class BasicSocketTests(unittest.TestCase):
         if v:
             data = ssl.RAND_bytes(16)
             self.assertEqual(len(data), 16)
+        else:
+            self.assertRaises(ssl.SSLError, ssl.RAND_bytes, 16)
 
         try:
             ssl.RAND_egd(1)