File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,20 @@ def get_image():
3131    }
3232
3333
34+ def  test_tool_runner_invalid_call ():
35+     runner  =  ToolRunner (tools = [ros2_topic ], logger = logging .getLogger (__name__ ))
36+     tool_call  =  ToolCall (name = "bad_fn" , args = {"command" : "list" }, id = "12345" )
37+     state  =  {"messages" : [AIMessage (content = "" , tool_calls = [tool_call ])]}
38+     output  =  runner .invoke (state )
39+     assert  isinstance (
40+         output ["messages" ][0 ], AIMessage 
41+     ), "First message is not an AIMessage" 
42+     assert  isinstance (
43+         output ["messages" ][1 ], ToolMessage 
44+     ), "Tool output is not a tool message" 
45+     assert  output ["messages" ][1 ].status  ==  "error" 
46+ 
47+ 
3448def  test_tool_runner ():
3549    runner  =  ToolRunner (tools = [ros2_topic ], logger = logging .getLogger (__name__ ))
3650
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments