def test_at_limit(self, randint_mock): base_wait, wait_time = _helpers.calculate_retry_wait(50.0, 50.0) assert base_wait == 50.0 assert wait_time == 50.25 randint_mock.assert_called_once_with(0, 1000)
def test_under_limit(self, randint_mock): base_wait, wait_time = _helpers.calculate_retry_wait(16.0, 33.0) assert base_wait == 32.0 assert wait_time == 32.875 randint_mock.assert_called_once_with(0, 1000)
def test_custom_multiplier(self, randint_mock): base_wait, wait_time = _helpers.calculate_retry_wait(16.0, 64.0, 3) assert base_wait == 48.0 assert wait_time == 48.875 randint_mock.assert_called_once_with(0, 1000)