'If a port number is initially selected which cannot be bound, the
L{CannotListenError} is handled and another port number is attempted.'

def test_disallowedPort(self):

    ports = []
    class FakeReactor(object, ):
        def listenUDP(self, port, *args, **kwargs):
            ports.append(port)
            if (len(ports) == 1):
                raise CannotListenError(None, port, None)
    resolver = client.Resolver(servers=[('example.com', 53)])
    resolver._reactor = FakeReactor()
    resolver._connectedProtocol()
    self.assertEqual(len(set(ports)), 2)
