예제 #1
0
    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)
예제 #2
0
    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)
예제 #3
0
    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)