'A L{HostnameEndpoint} is constructed from parameters passed to
L{clientFromString}.'

def test_hostnameEndpointConstruction(self):

    reactor = object()
    endpoint = endpoints.clientFromString(reactor, nativeString('tls:example.com:443:timeout=10:bindAddress=127.0.0.1'))
    hostnameEndpoint = endpoint._wrappedEndpoint
    self.assertIs(hostnameEndpoint._reactor, reactor)
    self.assertEqual(hostnameEndpoint._hostBytes, 'example.com')
    self.assertEqual(hostnameEndpoint._port, 443)
    self.assertEqual(hostnameEndpoint._timeout, 10)
    self.assertEqual(hostnameEndpoint._bindAddress, nativeString('127.0.0.1'))
