mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-05-03 16:25:53 +00:00
test(custom): cover empty choices response handling
This commit is contained in:
parent
2eb0c283e9
commit
49fc50b1e6
13
tests/test_custom_provider.py
Normal file
13
tests/test_custom_provider.py
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
from types import SimpleNamespace
|
||||||
|
|
||||||
|
from nanobot.providers.custom_provider import CustomProvider
|
||||||
|
|
||||||
|
|
||||||
|
def test_custom_provider_parse_handles_empty_choices() -> None:
|
||||||
|
provider = CustomProvider()
|
||||||
|
response = SimpleNamespace(choices=[])
|
||||||
|
|
||||||
|
result = provider._parse(response)
|
||||||
|
|
||||||
|
assert result.finish_reason == "error"
|
||||||
|
assert "empty choices" in result.content
|
||||||
Loading…
x
Reference in New Issue
Block a user