'If the random byte generator passed to L{_generateX} produces bytes
which would result in 0 or 1 being returned, these bytes are
discarded and another attempt is made to produce a larger value.'

def test_excludesSmall(self):

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