mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-21 00:21:49 +00:00
test(sap): cover the non-dict final_result branch
The isinstance guard added in the previous commit left one line uncovered, so patch coverage reported a miss on the new branch. A final_result that is not a dict is treated as an unknown event and skipped instead of reaching model_validate, and this pins that behavior.
This commit is contained in:
parent
a215b78d99
commit
e4febc228d
1 changed files with 7 additions and 0 deletions
|
|
@ -315,3 +315,10 @@ def test_to_openai_chunk_from_orchestration_result():
|
|||
assert chunk is not None
|
||||
assert chunk.choices[0].delta.content == "Hello "
|
||||
assert chunk.choices[0].logprobs is None
|
||||
|
||||
|
||||
def test_to_openai_chunk_ignores_non_dict_final_result():
|
||||
from litellm.llms.sap.chat.handler import _StreamParser
|
||||
|
||||
assert _StreamParser.to_openai_chunk({"final_result": None}) is None
|
||||
assert _StreamParser.to_openai_chunk({"final_result": "not-a-chunk"}) is None
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue