Exemple #1
0
 def test_normal(self):
     wti = retries.ExponentialBackoff(0.3, 6.8, 90.1)._wait_time_iter
     self.assertAlmostEqual(wti.next(), 0.3)
     self.assertAlmostEqual(wti.next(), 0.3 * 6.8)
     self.assertAlmostEqual(wti.next(), 0.3 * 6.8**2)
     self.assertAlmostEqual(wti.next(), 90.1)
     self.assertRaises(StopIteration, wti.next)
Exemple #2
0
 def test_high_scale(self):
     wti = retries.ExponentialBackoff(2.0, 6.8, 3.0)._wait_time_iter
     self.assertAlmostEqual(wti.next(), 2.0)
     self.assertAlmostEqual(wti.next(), 3.0)
     self.assertRaises(StopIteration, wti.next)
Exemple #3
0
 def test_low_limit(self):
     wti = retries.ExponentialBackoff(0.3, 6.8, 0.0)._wait_time_iter
     self.assertAlmostEqual(wti.next(), 0.0)
     self.assertRaises(StopIteration, wti.next)