Esempio 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)
Esempio 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)
Esempio 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)
Esempio 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)
Esempio 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)
Esempio 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)
Esempio n. 7
0
 def test_seed(self):
     """
     :py:obj:`OpenSSL.rand.seed` adds entropy to the PRNG.
     """
     rand.seed(b('milk shake'))
Esempio n. 8
0
 def test_add(self):
     """
     :py:obj:`OpenSSL.rand.add` adds entropy to the PRNG.
     """
     rand.add(b('hamburger'), 3)
Esempio n. 9
0
 def test_seed(self):
     """
     L{OpenSSL.rand.seed} adds entropy to the PRNG.
     """
     rand.seed(b('milk shake'))
Esempio n. 10
0
 def test_add(self):
     """
     L{OpenSSL.rand.add} adds entropy to the PRNG.
     """
     rand.add(b('hamburger'), 3)
Esempio n. 11
0
 def test_seed(self):
     """
     :py:obj:`OpenSSL.rand.seed` adds entropy to the PRNG.
     """
     rand.seed(b('milk shake'))
Esempio n. 12
0
 def test_add(self):
     """
     :py:obj:`OpenSSL.rand.add` adds entropy to the PRNG.
     """
     rand.add(b('hamburger'), 3)