summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlymanZerga11 <lymanZerga11@users.noreply.github.com>2017-01-30 14:58:45 +0800
committerHynek Schlawack <hs@ox.cx>2017-01-30 07:58:45 +0100
commit7f3914b478e8b4fcd6ed0e68a272649bbb1c627d (patch)
tree69949778587ec1d4ca2384c9f8e91749b81af787
parent9e2a993637c5b3f384123056eab12217501dd56b (diff)
downloadpyopenssl-7f3914b478e8b4fcd6ed0e68a272649bbb1c627d.tar.gz
Patch up easy TypeError-based coverage gaps (#598)
-rw-r--r--tests/test_rand.py20
1 files changed, 16 insertions, 4 deletions
diff --git a/tests/test_rand.py b/tests/test_rand.py
index 7574412..ac3965b 100644
--- a/tests/test_rand.py
+++ b/tests/test_rand.py
@@ -19,8 +19,8 @@ from .util import NON_ASCII
class TestRand(object):
@pytest.mark.parametrize('args', [
- (None),
- (b"foo"),
+ (None,),
+ (b"foo",),
])
def test_bytes_wrong_args(self, args):
"""
@@ -73,8 +73,8 @@ class TestRand(object):
rand.add(b'hamburger', 3)
@pytest.mark.parametrize('args', [
- (None),
- (42),
+ (None,),
+ (42,),
])
def test_seed_wrong_args(self, args):
"""
@@ -110,6 +110,18 @@ class TestRand(object):
"""
pytest.deprecated_call(rand.egd, *args)
+ @pytest.mark.parametrize('args', [
+ (None, 255),
+ (b"foo", None),
+ ])
+ def test_egd_wrong_args(self, args):
+ """
+ `OpenSSL.rand.egd` raises `TypeError` if called with a non-`int`
+ or non-`str` argument.
+ """
+ with pytest.raises(TypeError):
+ rand.egd(*args)
+
def test_cleanup(self):
"""
`OpenSSL.rand.cleanup` releases the memory used by the PRNG and