def test_redirect_resets_timeout(self): prober = RedirectAwareProberFactory('http://foo.bar') prober.timeoutCall = FakeTimeOutCall() prober.connect = lambda: None self.failIf(prober.timeoutCall.resetCalled) prober.redirect('http://bar.foo') self.failUnless(prober.timeoutCall.resetCalled)
def _createFactoryAndStubConnectAndTimeoutCall(self, url=None): if url is None: url = 'http://foo.bar' prober = RedirectAwareProberFactory(url) prober.timeoutCall = FakeTimeOutCall() prober.connectCalled = False def connect(): prober.connectCalled = True prober.connect = connect return prober