'When more than C{redirectLimit} HTTP redirects are encountered, the
page request fails with L{InfiniteRedirection}.'

def test_infiniteRedirection(self):

    def checkRedirectCount(*a):
        self.assertEqual(f._redirectCount, 13)
        self.assertEqual(self.infiniteRedirectResource.count, 13)
    f = client._makeGetterFactory(self.getURL('infiniteRedirect'), client.HTTPClientFactory, redirectLimit=13)
    d = self.assertFailure(f.deferred, error.InfiniteRedirection)
    d.addCallback(checkRedirectCount)
    return d
