'L{Request.getClient} is deprecated in favor of resolving the hostname
in application code.'

def test_getClient(self):

    channel = DummyChannel()
    request = http.Request(channel, True)
    request.gotLength(123)
    request.requestReceived('GET', '/', 'HTTP/1.1')
    expected = channel.transport.getPeer().host
    self.assertEqual(expected, request.getClient())
    warnings = self.flushWarnings(offendingFunctions=[self.test_getClient])
    self.assertEqual({'category': DeprecationWarning, 'message': 'twisted.web.http.Request.getClient    was    deprecated    in    Twisted    15.0.0;    please    use    Twisted    Names    to    resolve    hostnames    instead'}, sub(['category', 'message'], warnings[0]))
