def test_resolveNameDelivers(self):
        """
        The resolution receiver begins, and resolved hostnames are
        delivered before it completes.
        """
        port = 80
        ipv4Host = '1.2.3.4'
        ipv6Host = '1::2::3::4'

        receiver = self.resolver.resolveHostName(self.receiver, "example.com")

        self.assertIs(receiver, self.receiver)

        self.fakeResolverReturns.callback([
            (AF_INET, SOCK_STREAM, IPPROTO_TCP, '', (ipv4Host, port)),
            (AF_INET6, SOCK_STREAM, IPPROTO_TCP, '', (ipv6Host, port)),
        ])

        self.assertEqual(1, len(self.resolutionBeganCalls))
        self.assertEqual(self.resolutionBeganCalls[0].name, "example.com")
        self.assertEqual(self.addressResolvedCalls, [
            IPv4Address("TCP", ipv4Host, port),
            IPv6Address("TCP", ipv6Host, port)
        ])
        self.assertEqual(self.resolutionCompleteCallCount, 1)

        The resolution receiver begins, and resolved hostnames are
        delivered before it completes.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/internet/test/test_endpoints.py