diff options
author | Jean-Paul Calderone <exarkun@twistedmatrix.com> | 2013-12-29 10:29:48 -0500 |
---|---|---|
committer | Jean-Paul Calderone <exarkun@twistedmatrix.com> | 2013-12-29 10:29:48 -0500 |
commit | 7cf3bf51be9cfa1a85907689b14b37727bd88d98 (patch) | |
tree | 87f529e53fba1d27eaf3e7924f7fda888b92513d | |
parent | c86bb7dc4e81179451088de07bb9c743ae85fb85 (diff) | |
download | pyopenssl-7cf3bf51be9cfa1a85907689b14b37727bd88d98.tar.gz |
add a test for another branch of rand.egd
-rw-r--r-- | OpenSSL/test/test_rand.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/OpenSSL/test/test_rand.py b/OpenSSL/test/test_rand.py index ffbb731..b5a992d 100644 --- a/OpenSSL/test/test_rand.py +++ b/OpenSSL/test/test_rand.py @@ -126,6 +126,19 @@ class RandTests(TestCase): "%r not in %r" % (result, expected)) + def test_egd_missing_and_bytes(self): + """ + :py:obj:`OpenSSL.rand.egd` returns :py:obj:`0` or :py:obj:`-1` if the + EGD socket passed to it does not exist even if a size argument is + explicitly passed. + """ + result = rand.egd(self.mktemp(), 1024) + expected = (-1, 0) + self.assertTrue( + result in expected, + "%r not in %r" % (result, expected)) + + def test_cleanup_wrong_args(self): """ :py:obj:`OpenSSL.rand.cleanup` raises :py:obj:`TypeError` when called with any |