def test_providing_retry_override_argument_success(self): api = self.factory.build(MockApi) with self.assertRaises(ApiException) as ex: api.execute_failing_retryable("Portfolio", name="Portfolio", lusid_retries=10) self.assertEqual(ex.exception.status, 404) self.assertEqual(api.invocations, 10)
def test_providing_retry_override_argument_not_int_uses_default(self): api = self.factory.build(MockApi) with self.assertRaises(ApiException) as ex: api.execute_failing_retryable("Portfolio", name="Portfolio", lusid_retries="ThisWontWork") self.assertEqual(ex.exception.status, 404) self.assertEqual(api.invocations, 3)
def test_retry_after_max_attempts_fails(self): api = self.factory.build(MockApi) with self.assertRaises(ApiException) as ex: api.execute_failing_retryable() self.assertEqual(ex.exception.status, 404) self.assertEqual(api.invocations, 3)