'While resolving hostnames, _nameResolution calls
_deferToThread with _getaddrinfo.'

def test_nameResolution(self):

    calls = []
    def fakeDeferToThread(f, *args, **kwargs):
        calls.append((f, args, kwargs))
        return defer.Deferred()
    endpoint = endpoints.TCP6ClientEndpoint(reactor, 'ipv6.example.com', 1234)
    fakegetaddrinfo = object()
    endpoint._getaddrinfo = fakegetaddrinfo
    endpoint._deferToThread = fakeDeferToThread
    endpoint.connect(TestFactory())
    self.assertEqual([(fakegetaddrinfo, ('ipv6.example.com', 0, AF_INET6), {})], calls)
