mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-05 02:41:56 +00:00
test(spend_tracking): cover acreate_file branch in get_spend_logs_id
The hash-based id path triggers for both `aretrieve_batch` and `acreate_file`, but only the former was tested. Add a parallel test asserting that `acreate_file` also returns a hash (not the client-supplied call id) even when `litellm_call_id_from_client` is true. Addresses Greptile P2 review feedback on PR #25952. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
8d803ec667
commit
a275711bb5
1 changed files with 14 additions and 0 deletions
|
|
@ -1548,3 +1548,17 @@ class TestGetSpendLogsId:
|
|||
# Hash-based id, not the client uuid
|
||||
assert result is not None
|
||||
assert result != "client-uuid"
|
||||
|
||||
def test_acreate_file_unchanged(self):
|
||||
"""The acreate_file hash path is also independent of the flag."""
|
||||
result = self.fn(
|
||||
call_type="acreate_file",
|
||||
response_obj={"id": "file-id", "data": "y"},
|
||||
kwargs={
|
||||
"litellm_call_id": "client-uuid",
|
||||
"litellm_call_id_from_client": True,
|
||||
},
|
||||
)
|
||||
# Hash-based id, not the client uuid
|
||||
assert result is not None
|
||||
assert result != "client-uuid"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue