test(custom): cover empty choices response handling

This commit is contained in:
Xubin Ren
2026-03-17 06:20:19 +00:00
committed by Xubin Ren
parent 2eb0c283e9
commit 49fc50b1e6

View 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