'FortunaAccumulator.FortunaAccumulator'

def test_accumulator(self):

    fa = FortunaAccumulator.FortunaAccumulator()
    self.assertRaises(AssertionError, fa.random_data, 1)
    for p in range(32):
        fa.add_random_event(42, p, (b('X') * 32))
        self.assertEqual((32 + 2), fa.pools[p].length)
    self.assertRaises(AssertionError, fa.random_data, 1)
    for p in range(32):
        fa.add_random_event(42, p, (b('X') * 32))
        self.assertEqual(((32 + 2) * 2), fa.pools[p].length)
    self.assertEqual('aef42a5dcbddab67e8efa118e1b47fde5d697f89beb971b99e6e8e5e89fbf064', fa.pools[0].hexdigest())
    self.assertEqual(None, fa.generator.key)
    self.assertEqual(0, fa.generator.counter.next_value())
    result = fa.random_data(32)
    self.assertEqual(b('b7b86bd9a27d96d7bb4add1b6b10d1572350b1c61253db2f8da233be726dc15f'), b2a_hex(result))
    self.assertEqual(b('f23ad749f33066ff53d307914fbf5b21da9667c7e86ba247655c9490e9d94a7c'), b2a_hex(fa.generator.key))
    self.assertEqual(5, fa.generator.counter.next_value())
