Skip to content

Commit 952f73e

Browse files
chuenchen309claude
andcommitted
test: narrow optional tool call before accessing arguments
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent e13dde8 commit 952f73e

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

test/dataclasses/test_chat_message.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -985,6 +985,7 @@ def test_from_openai_dict_format_tool_call_with_missing_arguments(self):
985985
"tool_calls": [{"id": "call_1", "function": {"name": "now"}}],
986986
}
987987
message = ChatMessage.from_openai_dict_format(openai_msg)
988+
assert message.tool_call is not None
988989
assert message.tool_call.arguments == {}
989990

990991
def test_from_openai_dict_format_tool_message(self):

0 commit comments

Comments
 (0)