예제 #1
0
    def test_partial_function_on_return(self):
        def lt(x, y):
            return x < y

        f = functools.partial(lt, y=5)
        demo = RetryDemo()
        assert_that(retry(demo.call, on_return=f)(), equal_to(5))
예제 #2
0
 def decorator(self, url, **kwargs):
     wrapped = retry(on_error=self._http_authentication_error,
                     on_retry=self._update_csrf_token)(func)
     return wrapped(self, url, **kwargs)
예제 #3
0
파일: connector.py 프로젝트: crook/storops
 def decorator(self, url, **kwargs):
     wrapped = retry(on_error=self._http_authentication_error,
                     on_retry=self._update_csrf_token)(func)
     return wrapped(self, url, **kwargs)
예제 #4
0
 def test_functional_on_return(self):
     demo = RetryDemo()
     assert_that(retry(demo.call, on_return=lambda x: x < 5)(), equal_to(5))
예제 #5
0
 def test_functional_limit(self):
     demo = RetryDemo()
     assert_that(retry(demo.call, limit=3)(), equal_to(3))