Exemplo n.º 1
0
 def test_max_delay_none(self):
     strategy = _exponential_backoff(retries=7,
                                     delay=1,
                                     backoff=2,
                                     max_delay=None)
     result = list(strategy())
     self.assertEqual(result, [1, 2, 4, 8, 16, 32, 64])
Exemplo n.º 2
0
 def test_exponential_backoff(self):
     strategy = _exponential_backoff(retries=5, delay=1, backoff=2)
     result = list(strategy())
     self.assertEqual(result, [1, 2, 4, 8, 16])
Exemplo n.º 3
0
 def test_no_retries(self):
     strategy = _exponential_backoff(retries=0)
     result = list(strategy())
     self.assertEqual(result, [], 'list should be empty')