def test_fallbackNameResolution(self):
        """
        L{_fallbackNameResolution} returns a L{Deferred} that fires
        with the resoution of the the host and request port.
        """
        from twisted.internet import reactor
        ep = endpoints.HostnameEndpoint(reactor,
                                        host='ignored',
                                        port=0)

        host, port = ("1.2.3.4", 1)

        resolutionDeferred = ep._fallbackNameResolution(host, port)

        def assertHostPortFamilySockType(result):
            self.assertEqual(len(result), 1)
            [(family, socktype, _, _, sockaddr)] = result
            self.assertEqual(family, AF_INET)
            self.assertEqual(socktype, SOCK_STREAM)
            self.assertEqual(sockaddr, (host, port))

        return resolutionDeferred.addCallback(assertHostPortFamilySockType)

        L{_fallbackNameResolution} returns a L{Deferred} that fires
        with the resoution of the the host and request port.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/internet/test/test_endpoints.py