def test_connectHTTP(self):
        """
        L{Agent._getEndpoint} return a C{HostnameEndpoint} when passed a scheme
        of C{'http'}.
        """
        expectedHost = b'example.com'
        expectedPort = 1234
        endpoint = self.agent._getEndpoint(URI.fromBytes(
            b'http://' + expectedHost + b":" + intToBytes(expectedPort)))
        self.assertEqual(endpoint._hostStr, "example.com")
        self.assertEqual(endpoint._port, expectedPort)
        self.assertIsInstance(endpoint, HostnameEndpoint)

        L{Agent._getEndpoint} return a C{HostnameEndpoint} when passed a scheme
        of C{'http'}.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/web/test/test_agent.py