litellm/tests/proxy_behavior/management
Yuneng Jiang f7b881aecb
test(proxy_behavior): pin /key/generate authz matrix (18 scenarios)
Slice 7 of the management-endpoints behavior-pinning effort. Parametrized
matrix across two axes: actor (8 seeded) × target scope (self, team_alpha
in org_a, team_beta in org_b). 18 scenarios after dropping non-applicable
combos. Whole-suite wall-time stays at ~4.7s (well under the 10-min G2
budget for the eventual CI job).

While pinning, the test surfaced one seed gap: ``_get_user_in_team`` reads
``members_with_roles`` (a JSON list of ``{user_id, role}``), not the plain
``members`` String[]. Both columns are now populated in the seed to match
what the real ``/team/new`` handler would produce.

Expected status codes are intentionally heterogeneous (200, 400, 401)
because the current handler emits different statuses depending on which
check fails first (role gate, team-member-perm gate, "not assigned"
check). Pinning the *observed* codes — not what they "should" be — is
exactly the regression signal we want.

Plan: https://www.notion.so/36643b8acdab8128a581ced0f6a4744d
2026-05-19 21:40:45 -07:00
..
__init__.py test(proxy_behavior): scaffold session-scoped async ASGI client + liveness smoke 2026-05-19 21:21:00 -07:00
actors.py test(proxy_behavior): pin /key/generate authz matrix (18 scenarios) 2026-05-19 21:40:45 -07:00
conftest.py test(proxy_behavior): per-test scratch namespace + targeted delete_many teardown 2026-05-19 21:35:05 -07:00
test_key_generate.py test(proxy_behavior): pin /key/generate authz matrix (18 scenarios) 2026-05-19 21:40:45 -07:00
test_no_management_imports.py style(proxy_behavior): apply black to G3 grep test 2026-05-19 21:36:15 -07:00
test_scratch_teardown.py test(proxy_behavior): per-test scratch namespace + targeted delete_many teardown 2026-05-19 21:35:05 -07:00
test_smoke.py test(proxy_behavior): per-test scratch namespace + targeted delete_many teardown 2026-05-19 21:35:05 -07:00
test_world_seed.py test(proxy_behavior): seed 8-actor read-world for the authz matrix 2026-05-19 21:31:38 -07:00