def METHOD_NAME(self):
    reactor = Mock()
    circuit = Mock()
    socks_ep = Mock()
    proto = Mock()
    gold = object()
    proto.request = Mock(return_value=defer.succeed(gold))
    def getConnection(key, endpoint):
        target = endpoint._target_endpoint
        self.assertIsInstance(
            target._tls,
            BrowserLikePolicyForHTTPS().creatorForNetloc(b"host", 443).__class__
        )
        # This uses a Twisted private interface...
        self.assertEqual(target._tls._hostname, "custom.domain")
        self.assertEqual(target._host, 'meejah.ca')
        return defer.succeed(proto)
    pool = Mock()
    pool.getConnection = getConnection
    agent = yield tor_agent(
        reactor, socks_ep, circuit=circuit, pool=pool,
        tls_context_factory=CustomTLSContextFactory()
    )
    # apart from the getConnection asserts...
    res = yield agent.request(b'GET', b'https://meejah.ca')
    self.assertIs(res, gold)