add a test for another branch of rand.egd
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 @@
"%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