'If the random byte generator passed to L{_generateX} produces bytes
which would result in C{(2 ** bits) - 1} being returned, these bytes
are discarded and another attempt is made to produce a smaller
value.'

def test_excludesLarge(self):

    results = [chr(255), chr(64)]
    def random(data):
        return (results.pop(0) * data)
    self.assertEqual(transport._generateX(random, 8), 64)
