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])
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])
def test_no_retries(self): strategy = _exponential_backoff(retries=0) result = list(strategy()) self.assertEqual(result, [], 'list should be empty')