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:
Darien Kindlund 2026-04-17 10:52:27 -04:00
parent 8d803ec667
commit a275711bb5

View file

@ -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"