mirror of
https://github.com/tiennm99/litellm.git
synced 2026-08-06 04:23:40 +00:00
test: update tag-merge tests for default-deny client tag policy
Two pre-existing tests codified the pre-fix behavior where any caller- supplied metadata.tags would flow through to spend logs and routing: - test_add_key_or_team_level_spend_logs_metadata_to_request exercised the request/key/team tag merge. Set allow_client_tags=True on the key metadata so the merge path is still tested under the new regime. - test_create_file_with_nested_litellm_metadata asserted that litellm_metadata[tags] form-data propagated to the handler. Drop the tag field; the test still proves nested form-parser correctness via spend_logs_metadata and environment.
This commit is contained in:
@@ -162,9 +162,13 @@ async def test_add_key_or_team_level_spend_logs_metadata_to_request(
|
||||
|
||||
print(f"team_sl_metadata: {team_sl_metadata}")
|
||||
mock_request.url.path = "/chat/completions"
|
||||
# Opt the key into client-supplied tags so request_tags are preserved
|
||||
# and merged with admin-configured key/team tags. Without this flag,
|
||||
# request_tags would be stripped by add_litellm_data_to_request.
|
||||
key_metadata = {
|
||||
"tags": key_tags,
|
||||
"spend_logs_metadata": key_sl_metadata,
|
||||
"allow_client_tags": True,
|
||||
}
|
||||
team_metadata = {
|
||||
"tags": team_tags,
|
||||
|
||||
Reference in New Issue
Block a user