mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-17 09:34:48 +00:00
test(proxy): expect object_permission include in fuzzy user lookups
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
90263e93c5
commit
20146213ce
1 changed files with 6 additions and 4 deletions
|
|
@ -845,7 +845,8 @@ async def test_get_fuzzy_user_object():
|
|||
)
|
||||
assert result == test_user
|
||||
mock_prisma.db.litellm_usertable.find_unique.assert_called_with(
|
||||
where={"sso_user_id": "sso_123"}, include={"organization_memberships": True}
|
||||
where={"sso_user_id": "sso_123"},
|
||||
include={"organization_memberships": True, "object_permission": True},
|
||||
)
|
||||
|
||||
# Test 2: SSO ID not found, find by email
|
||||
|
|
@ -861,7 +862,7 @@ async def test_get_fuzzy_user_object():
|
|||
assert result == test_user
|
||||
mock_prisma.db.litellm_usertable.find_first.assert_called_with(
|
||||
where={"user_email": {"equals": "test@example.com", "mode": "insensitive"}},
|
||||
include={"organization_memberships": True},
|
||||
include={"organization_memberships": True, "object_permission": True},
|
||||
)
|
||||
|
||||
# Test 3: Verify background SSO update task when user found by email
|
||||
|
|
@ -889,7 +890,7 @@ async def test_get_fuzzy_user_object():
|
|||
assert result == test_user
|
||||
mock_prisma.db.litellm_usertable.find_first.assert_called_with(
|
||||
where={"user_email": {"equals": "test@example.com", "mode": "insensitive"}},
|
||||
include={"organization_memberships": True},
|
||||
include={"organization_memberships": True, "object_permission": True},
|
||||
)
|
||||
|
||||
# Test 6: Only SSO ID provided (no email)
|
||||
|
|
@ -899,7 +900,8 @@ async def test_get_fuzzy_user_object():
|
|||
)
|
||||
assert result == test_user
|
||||
mock_prisma.db.litellm_usertable.find_unique.assert_called_with(
|
||||
where={"sso_user_id": "sso_123"}, include={"organization_memberships": True}
|
||||
where={"sso_user_id": "sso_123"},
|
||||
include={"organization_memberships": True, "object_permission": True},
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue