mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-21 00:21:49 +00:00
fix: correct falsy id test assertions per Greptile review
When response_object has a falsy id (None or ""), convert_to_model_response_object replaces it with a new uuid.uuid4() — not the original chatcmpl- prefixed id. Updated assertions to match actual behavior.
This commit is contained in:
parent
7a2e413201
commit
c44f05bda5
1 changed files with 5 additions and 2 deletions
|
|
@ -1497,5 +1497,8 @@ def test_convert_to_model_response_object_falsy_id_preserves_auto_generated(fals
|
|||
start_time=datetime.now(),
|
||||
end_time=datetime.now(),
|
||||
)
|
||||
assert result.id == original_id
|
||||
assert result.id.startswith("chatcmpl-")
|
||||
# When response_object has a falsy id, convert_to_model_response_object
|
||||
# replaces it with a new uuid.uuid4() (without "chatcmpl-" prefix),
|
||||
# so the original auto-generated id is NOT preserved.
|
||||
assert result.id != falsy_id
|
||||
assert result.id != ""
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue