'When L{client.RedirectAgent} encounters a relative redirect I{URI}, it
is resolved against the request I{URI} before following the redirect.
@param uri: Request URI.
@param location: I{Location} header redirect URI.
@param finalURI: Expected final URI.'

def _testRedirectURI(self, uri, location, finalURI):

    self.agent.request('GET', uri)
    (req, res) = self.protocol.requests.pop()
    headers = http_headers.Headers({'location': [location]})
    response = Response(('HTTP', 1, 1), 302, 'OK', headers, None)
    res.callback(response)
    (req2, res2) = self.protocol.requests.pop()
    self.assertEqual('GET', req2.method)
    self.assertEqual(finalURI, req2.absoluteURI)
