diff options
Diffstat (limited to 'tests/test_rand.py')
-rw-r--r-- | tests/test_rand.py | 20 |
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 |