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_egd_wrong_args(self): """ :meth:`OpenSSL.rand.egd` raises :exc:`TypeError` when called with the wrong number of arguments or with arguments not of type :obj:`str` and :obj:`int`. """ for args in [(), (None, ), ("foo", None), (None, 3), ("foo", 3, None)]: with pytest.raises(TypeError): rand.egd(*args)
def test_egd_wrong_args(self): """ :meth:`OpenSSL.rand.egd` raises :exc:`TypeError` when called with the wrong number of arguments or with arguments not of type :obj:`str` and :obj:`int`. """ for args in [(), (None,), ("foo", None), (None, 3), ("foo", 3, None)]: with pytest.raises(TypeError): rand.egd(*args)
def test_egd_missing(self): """ :py:obj:`OpenSSL.rand.egd` returns :py:obj:`0` or :py:obj:`-1` if the EGD socket passed to it does not exist. """ result = rand.egd(self.mktemp()) expected = (-1, 0) self.assertTrue(result in expected, "%r not in %r" % (result, expected))
def test_egd_missing(self): """ L{OpenSSL.rand.egd} returns C{0} or C{-1} if the EGD socket passed to it does not exist. """ result = rand.egd(self.mktemp()) expected = (-1, 0) self.assertTrue(result in expected, "%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_egd_missing(self): """ L{OpenSSL.rand.egd} returns C{0} or C{-1} if the EGD socket passed to it does not exist. """ result = rand.egd(self.mktemp()) expected = (-1, 0) self.assertTrue( result in expected, "%r not in %r" % (result, expected))
def test_egd_missing(self): """ :py:obj:`OpenSSL.rand.egd` returns :py:obj:`0` or :py:obj:`-1` if the EGD socket passed to it does not exist. """ result = rand.egd(self.mktemp()) expected = (-1, 0) self.assertTrue( result in expected, "%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))