mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-06 08:16:43 +00:00
fix alias test arg ordering: test both team and project scopes
This commit is contained in:
parent
cf4dcc0c5a
commit
e4aac594fb
1 changed files with 18 additions and 2 deletions
|
|
@ -2247,12 +2247,21 @@ def test_resolve_pre_alias_model_name_fallback():
|
|||
team_config = {
|
||||
"gpt-4": {"azure": {"litellm_credentials": "team-gpt4"}},
|
||||
}
|
||||
# Post-alias name doesn't match, but pre-alias does
|
||||
# Post-alias name doesn't match, but pre-alias does (team scope)
|
||||
result = _resolve_credential_from_model_config(
|
||||
"azure/gpt-4-0613", team_config, None, pre_alias_model_name="gpt-4"
|
||||
"azure/gpt-4-0613", None, team_config, pre_alias_model_name="gpt-4"
|
||||
)
|
||||
assert result == "team-gpt4"
|
||||
|
||||
# Same test for project scope
|
||||
project_config = {
|
||||
"gpt-4": {"azure": {"litellm_credentials": "proj-gpt4"}},
|
||||
}
|
||||
result = _resolve_credential_from_model_config(
|
||||
"azure/gpt-4-0613", project_config, None, pre_alias_model_name="gpt-4"
|
||||
)
|
||||
assert result == "proj-gpt4"
|
||||
|
||||
|
||||
def test_resolve_post_alias_name_takes_priority():
|
||||
"""Post-alias (resolved) name should be tried before pre-alias name."""
|
||||
|
|
@ -2260,6 +2269,13 @@ def test_resolve_post_alias_name_takes_priority():
|
|||
"gpt-4": {"azure": {"litellm_credentials": "pre-alias-cred"}},
|
||||
"gpt-4o-team-1": {"azure": {"litellm_credentials": "post-alias-cred"}},
|
||||
}
|
||||
# Team scope
|
||||
result = _resolve_credential_from_model_config(
|
||||
"gpt-4o-team-1", None, team_config, pre_alias_model_name="gpt-4"
|
||||
)
|
||||
assert result == "post-alias-cred"
|
||||
|
||||
# Project scope
|
||||
result = _resolve_credential_from_model_config(
|
||||
"gpt-4o-team-1", team_config, None, pre_alias_model_name="gpt-4"
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue