litellm/tests/test_litellm
ryan-crabbe-berri 98c04159aa refactor(proxy): answer team admin checks with the set of roles a caller holds
roles_on(team, caller, orgs) in management/teams/authz.py replaces
TeamAccess.allows, strongest_role, TEAM_OR_ORG_ADMIN and TEAM_ADMIN_ONLY.
It returns the union of the admin roles the caller holds on the team, so a
route denies on an empty set and /team/update restricts only a caller whose
sole role is team admin. The org-admin lookup moves onto
OrganizationMembershipRepository.is_org_admin, which reads the membership row
directly, and management/users/service.py goes away.

The single-team gates that only read the roster now ask roles_on too, so an
org admin can delete and reset spend on keys in their org's teams, add,
update and delete team models, check auto-router availability and create
projects when the projects permission is on. The matrix flips exactly those
seven org_admin cells from 403 to 200.
2026-09-30 15:27:38 -07:00
..
integrations/clickhouse feat(tracing): store spend in ClickHouse automatically (#43928) 2026-09-30 22:17:43 +00:00
proxy refactor(proxy): answer team admin checks with the set of roles a caller holds 2026-09-30 15:27:38 -07:00
tracing feat(tracing): store spend in ClickHouse automatically (#43928) 2026-09-30 22:17:43 +00:00
__init__.py
conftest.py test: move tests/test_litellm core utils, routing, responses, caching and rust_bridge into tests/unit (#43199) 2026-09-25 17:10:13 -07:00
readme.md
test_check_unbounded_in_lists.py ci: fail on new unbounded SQL IN lists and add a Prisma chunking helper (#42629) 2026-09-26 13:40:44 -07:00
test_conftest.py

Testing for litellm/

This directory 1:1 maps the the litellm/ directory, and can only contain mocked tests.

The point of this is to:

  1. Increase test coverage of litellm/
  2. Make it easy for contributors to add tests for the litellm/ package and easily run tests without needing LLM API keys.

File name conventions

  • litellm/proxy/test_caching_routes.py maps to litellm/proxy/caching_routes.py
  • test_<filename>.py maps to litellm/<filename>.py