def createClientEndpoint(self, reactor, clientFactory, **connectArgs):
        """
        Creates a L{HostnameEndpoint} instance where the hostname is resolved
        into a single IPv4 address.
        """
        expectedAddress = '1.2.3.4'
        address = HostnameAddress(b"example.com", 80)
        endpoint = endpoints.HostnameEndpoint(
            deterministicResolvingReactor(reactor, [expectedAddress]),
            b"example.com", address.port, **connectArgs
        )

        return (endpoint, (expectedAddress, address.port, clientFactory,
                connectArgs.get('timeout', 30),
                connectArgs.get('bindAddress', None)),
                address)

        Creates a L{HostnameEndpoint} instance where the hostname is resolved
        into a single IPv4 address.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/internet/test/test_endpoints.py