Exemplo n.º 1
0
 def test_add_wrong_args(self):
     """
     When called with the wrong number of arguments, or with arguments not of
     type C{str} and C{int}, L{OpenSSL.rand.add} raises L{TypeError}.
     """
     self.assertRaises(TypeError, rand.add)
     self.assertRaises(TypeError, rand.add, b("foo"), None)
     self.assertRaises(TypeError, rand.add, None, 3)
     self.assertRaises(TypeError, rand.add, b("foo"), 3, None)
Exemplo n.º 2
0
 def test_add_wrong_args(self):
     """
     When called with the wrong number of arguments, or with arguments not of
     type :py:obj:`str` and :py:obj:`int`, :py:obj:`OpenSSL.rand.add` raises :py:obj:`TypeError`.
     """
     self.assertRaises(TypeError, rand.add)
     self.assertRaises(TypeError, rand.add, b("foo"), None)
     self.assertRaises(TypeError, rand.add, None, 3)
     self.assertRaises(TypeError, rand.add, b("foo"), 3, None)
Exemplo n.º 3
0
 def test_add_wrong_args(self):
     """
     When called with the wrong number of arguments, or with arguments not of
     type :py:obj:`str` and :py:obj:`int`, :py:obj:`OpenSSL.rand.add` raises :py:obj:`TypeError`.
     """
     self.assertRaises(TypeError, rand.add)
     self.assertRaises(TypeError, rand.add, b("foo"), None)
     self.assertRaises(TypeError, rand.add, None, 3)
     self.assertRaises(TypeError, rand.add, b("foo"), 3, None)
Exemplo n.º 4
0
 def test_seed_wrong_args(self):
     """
     When called with the wrong number of arguments, or with a non-:py:obj:`str`
     argument, :py:obj:`OpenSSL.rand.seed` raises :py:obj:`TypeError`.
     """
     self.assertRaises(TypeError, rand.seed)
     self.assertRaises(TypeError, rand.seed, None)
     self.assertRaises(TypeError, rand.seed, b("foo"), None)
Exemplo n.º 5
0
 def test_seed_wrong_args(self):
     """
     When called with the wrong number of arguments, or with a non-C{str}
     argument, L{OpenSSL.rand.seed} raises L{TypeError}.
     """
     self.assertRaises(TypeError, rand.seed)
     self.assertRaises(TypeError, rand.seed, None)
     self.assertRaises(TypeError, rand.seed, b("foo"), None)
Exemplo n.º 6
0
 def test_seed_wrong_args(self):
     """
     When called with the wrong number of arguments, or with a non-:py:obj:`str`
     argument, :py:obj:`OpenSSL.rand.seed` raises :py:obj:`TypeError`.
     """
     self.assertRaises(TypeError, rand.seed)
     self.assertRaises(TypeError, rand.seed, None)
     self.assertRaises(TypeError, rand.seed, b("foo"), None)
Exemplo n.º 7
0
 def test_seed(self):
     """
     :py:obj:`OpenSSL.rand.seed` adds entropy to the PRNG.
     """
     rand.seed(b('milk shake'))
Exemplo n.º 8
0
 def test_add(self):
     """
     :py:obj:`OpenSSL.rand.add` adds entropy to the PRNG.
     """
     rand.add(b('hamburger'), 3)
Exemplo n.º 9
0
 def test_seed(self):
     """
     L{OpenSSL.rand.seed} adds entropy to the PRNG.
     """
     rand.seed(b('milk shake'))
Exemplo n.º 10
0
 def test_add(self):
     """
     L{OpenSSL.rand.add} adds entropy to the PRNG.
     """
     rand.add(b('hamburger'), 3)
Exemplo n.º 11
0
 def test_seed(self):
     """
     :py:obj:`OpenSSL.rand.seed` adds entropy to the PRNG.
     """
     rand.seed(b('milk shake'))
Exemplo n.º 12
0
 def test_add(self):
     """
     :py:obj:`OpenSSL.rand.add` adds entropy to the PRNG.
     """
     rand.add(b('hamburger'), 3)