MCPcopy Create free account
hub / github.com/Open-Bee/DataStudio / FailingAPI

Class FailingAPI

tests/models/test_base_api.py:271–280  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

269 from datastudio.models.base import BaseAPI
270
271 class FailingAPI(BaseAPI):
272 def __init__(self):
273 super().__init__(retry=2, wait=0.01)
274 self.call_count = 0
275
276 def generate_inner(self, inputs, **kwargs):
277 self.call_count += 1
278 if self.call_count < 2:
279 return 1, None, None # Failure
280 return 0, "success", None
281
282 api = FailingAPI()
283 result = api.process_single_message("test", {})

Callers 1

test_retry_on_failureMethod · 0.85

Calls

no outgoing calls

Tested by 1

test_retry_on_failureMethod · 0.68