MCPcopy Create free account
hub / github.com/rthalley/dnspython / test_pool

Method test_pool

tests/test_entropy.py:11–18  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

9
10class EntropyTestCase(unittest.TestCase):
11 def test_pool(self):
12 pool = dns.entropy.EntropyPool(b"seed-value")
13 self.assertEqual(pool.random_8(), 94)
14 self.assertEqual(pool.random_16(), 61532)
15 self.assertEqual(pool.random_32(), 4226376065)
16 self.assertEqual(pool.random_between(10, 50), 29)
17 # stir in some not-really-entropy to exercise the stir API
18 pool.stir(b"not-really-entropy")
19
20 def test_pool_random(self):
21 pool = dns.entropy.EntropyPool()

Callers

nothing calls this directly

Calls 5

random_8Method · 0.95
random_16Method · 0.95
random_32Method · 0.95
random_betweenMethod · 0.95
stirMethod · 0.95

Tested by

no test coverage detected