def test_HTTPSDistributor_getBridges_with_blocked_bridges(self):
    dist = distributor.HTTPSDistributor(1, self.key)
    bridges = self.bridges[:]
    for bridge in bridges:
        bridge.setBlockedIn('cn')
    [dist.insert(bridge) for bridge in bridges]
    for _ in range(5):
        clientRequest1 = self.randomClientRequestForNotBlockedIn('cn')
        b = dist.getBridges(clientRequest1, 1)
        self.assertEqual(len(b), 0)
        clientRequest2 = self.randomClientRequestForNotBlockedIn('ir')
        b = dist.getBridges(clientRequest2, 1)
        self.assertEqual(len(b), 3)
def test_HTTPSDistributor_getBridges_with_blocked_bridges(self):
    dist = distributor.HTTPSDistributor(1, self.key)
    bridges = self.bridges[:]
    for bridge in bridges:
        bridge.setBlockedIn('cn')
    [dist.insert(bridge) for bridge in bridges]
    for _ in range(5):
        clientRequest1 = self.randomClientRequestForNotBlockedIn('cn')
        b = dist.getBridges(clientRequest1, 1)
        self.assertEqual(len(b), 0)
        clientRequest2 = self.randomClientRequestForNotBlockedIn('ir')
        b = dist.getBridges(clientRequest2, 1)
        self.assertEqual(len(b), 3)