def test_HTTPSDistributor_getBridges_ipv6(self):
    'A request for IPv6 bridges should return IPv6 bridges.'
    dist = distributor.HTTPSDistributor(3, self.key)
    [dist.insert(bridge) for bridge in self.bridges[:250]]
    for i in xrange(500):
        bridgeRequest = self.randomClientRequest()
        bridgeRequest.withIPv6()
        bridgeRequest.generateFilters()
        bridges = dist.getBridges(bridgeRequest, 'faketimestamp')
        self.assertTrue((type(bridges) is list))
        self.assertGreater(len(bridges), 0)
        bridge = random.choice(bridges)
        bridgeLine = bridge.getBridgeLine(bridgeRequest)
        (addrport, fingerprint) = bridgeLine.split()
        (address, port) = addrport.rsplit(':', 1)
        address = address.strip('[]')
        self.assertIsInstance(ipaddr.IPAddress(address), ipaddr.IPv6Address)
        self.assertIsNotNone(byIPv6(random.choice(bridges)))
A request for IPv6 bridges should return IPv6 bridges.
def test_HTTPSDistributor_getBridges_ipv6(self):
    
    dist = distributor.HTTPSDistributor(3, self.key)
    [dist.insert(bridge) for bridge in self.bridges[:250]]
    for i in xrange(500):
        bridgeRequest = self.randomClientRequest()
        bridgeRequest.withIPv6()
        bridgeRequest.generateFilters()
        bridges = dist.getBridges(bridgeRequest, 'faketimestamp')
        self.assertTrue((type(bridges) is list))
        self.assertGreater(len(bridges), 0)
        bridge = random.choice(bridges)
        bridgeLine = bridge.getBridgeLine(bridgeRequest)
        (addrport, fingerprint) = bridgeLine.split()
        (address, port) = addrport.rsplit(':', 1)
        address = address.strip('[]')
        self.assertIsInstance(ipaddr.IPAddress(address), ipaddr.IPv6Address)
        self.assertIsNotNone(byIPv6(random.choice(bridges)))