From 49fc50b1e623ee3a03a6e86b2dd6e90d956aaae2 Mon Sep 17 00:00:00 2001 From: Xubin Ren Date: Tue, 17 Mar 2026 06:20:19 +0000 Subject: [PATCH] test(custom): cover empty choices response handling --- tests/test_custom_provider.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 tests/test_custom_provider.py diff --git a/tests/test_custom_provider.py b/tests/test_custom_provider.py new file mode 100644 index 0000000..463affe --- /dev/null +++ b/tests/test_custom_provider.py @@ -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