mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 11:14:04 +00:00
test(test_streaming.py): fix test to handle none chunk
This commit is contained in:
parent
554f1a090d
commit
e948b39e3a
1 changed files with 7 additions and 3 deletions
|
@ -847,9 +847,13 @@ def test_sagemaker_weird_response():
|
||||||
logging_obj=logging_obj,
|
logging_obj=logging_obj,
|
||||||
)
|
)
|
||||||
complete_response = ""
|
complete_response = ""
|
||||||
for chunk in response:
|
for idx, chunk in enumerate(response):
|
||||||
print(chunk)
|
# print
|
||||||
complete_response += chunk["choices"][0]["delta"]["content"]
|
chunk, finished = streaming_format_tests(idx, chunk)
|
||||||
|
has_finish_reason = finished
|
||||||
|
complete_response += chunk
|
||||||
|
if finished:
|
||||||
|
break
|
||||||
assert len(complete_response) > 0
|
assert len(complete_response) > 0
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
pytest.fail(f"An exception occurred - {str(e)}")
|
pytest.fail(f"An exception occurred - {str(e)}")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue