fix(test_key_generate_prisma.py): pass user_api_key_dict to test call

This commit is contained in:
Krrish Dholakia 2024-07-17 07:58:26 -07:00
parent 606466d5fc
commit e7f8ee2aba
2 changed files with 19 additions and 6 deletions

View file

@ -1,6 +1,7 @@
import asyncio import asyncio
import copy import copy
import json import json
import traceback
import uuid import uuid
from datetime import datetime, timedelta, timezone from datetime import datetime, timedelta, timezone
from typing import List, Optional from typing import List, Optional
@ -795,6 +796,11 @@ async def team_info(
return {"team_id": team_id, "team_info": team_info, "keys": keys} return {"team_id": team_id, "team_info": team_info, "keys": keys}
except Exception as e: except Exception as e:
verbose_proxy_logger.error(
"litellm.proxy.management_endpoints.team_endpoints.py::team_info - Exception occurred - {}\n{}".format(
e, traceback.format_exc()
)
)
if isinstance(e, HTTPException): if isinstance(e, HTTPException):
raise ProxyException( raise ProxyException(
message=getattr(e, "detail", f"Authentication Error({str(e)})"), message=getattr(e, "detail", f"Authentication Error({str(e)})"),

View file

@ -2419,12 +2419,19 @@ async def test_create_update_team(prisma_client):
) )
# now hit team_info # now hit team_info
response = await team_info( try:
team_id=_team_id, response = await team_info(
http_request=Request(scope={"type": "http"}), team_id=_team_id,
) http_request=Request(scope={"type": "http"}),
user_api_key_dict=UserAPIKeyAuth(
print("RESPONSE from team_info", response) user_role=LitellmUserRoles.PROXY_ADMIN,
api_key="sk-1234",
user_id="1234",
),
)
except Exception as e:
print(e)
pytest.fail("Receives error - {}".format(e))
_team_info = response["team_info"] _team_info = response["team_info"]
_team_info = dict(_team_info) _team_info = dict(_team_info)