Exemplo n.º 1
0
 def test_entropy(self):
     e1 = entropy.random_entropy()
     e2 = entropy.random_entropy()
     assert_((e1 != e2))
     e1 = entropy.random_entropy(10)
     e2 = entropy.random_entropy(10)
     assert_((e1 != e2).all())
     e1 = entropy.random_entropy(10, source='system')
     e2 = entropy.random_entropy(10, source='system')
     assert_((e1 != e2).all())
Exemplo n.º 2
0
 def test_fallback(self):
     e1 = entropy.random_entropy(source='fallback')
     time.sleep(0.1)
     e2 = entropy.random_entropy(source='fallback')
     assert_((e1 != e2))