mirror of
https://github.com/EvolutionAPI/adk-python.git
synced 2025-07-14 01:41:25 -06:00
fix: fix broken tests.
PiperOrigin-RevId: 759312577
This commit is contained in:
parent
fccd17df6f
commit
a71d9ea9a1
@ -124,6 +124,20 @@ class MockApiClient:
|
||||
this.session_dict: dict[str, Any] = {}
|
||||
this.event_dict: dict[str, list[Any]] = {}
|
||||
|
||||
def request(self, http_method: str, path: str, request_dict: dict[str, Any]):
|
||||
"""Mocks the API Client request method."""
|
||||
if http_method == 'GET':
|
||||
if re.match(SESSIONS_REGEX, path):
|
||||
match = re.match(SESSIONS_REGEX, path)
|
||||
return {
|
||||
'sessions': [
|
||||
session
|
||||
for session in self.session_dict.values()
|
||||
if session['userId'] == match.group(2)
|
||||
],
|
||||
}
|
||||
raise ValueError(f'Unsupported sync path: {path}')
|
||||
|
||||
async def async_request(
|
||||
self, http_method: str, path: str, request_dict: dict[str, Any]
|
||||
):
|
||||
|
Loading…
Reference in New Issue
Block a user