@@ -467,22 +467,17 @@ def test_edge_case_error_handling(agent):
467467
468468def  test_direct_tool_call ():
469469    """Test direct call to the calculator tool function.""" 
470-     tool_use  =  {
471-         "toolUseId" : "test-id" ,
472-         "input" : {"expression" : "2+2" , "mode" : "evaluate" },
473-     }
474470
475471    # Test basic calculation 
476472    with  mock .patch ("src.strands_tools.calculator.Console" ):
477-         result  =  calculator_func (tool_use )
473+         result  =  calculator_func (expression = "2+2" ,  mode = "evaluate" )
478474        assert  result ["status" ] ==  "success" 
479475        assert  "Result: 4"  in  result ["content" ][0 ]["text" ]
480476
481477    # Test with error - division by zero may not raise an error in SymPy 
482-     tool_use ["input" ]["expression" ] =  "x +* 2"   # Invalid syntax 
483478    with  mock .patch ("src.strands_tools.calculator.Console" ):
484479        with  mock .patch ("src.strands_tools.calculator.create_error_panel" ):
485-             result  =  calculator_func (tool_use )
480+             result  =  calculator_func (expression = "x +* 2" ,  mode = "evaluate" )
486481            assert  result ["status" ] ==  "error" 
487482            assert  "Error"  in  result ["content" ][0 ]["text" ]
488483
@@ -611,14 +606,6 @@ def test_calculator_tool_with_system_of_equations():
611606    # Create a tool use with a system of equations 
612607    from  src .strands_tools .calculator  import  calculator  as  calc_function 
613608
614-     tool_use  =  {
615-         "toolUseId" : "test_id" ,
616-         "input" : {
617-             "expression" : "['x + y - 10', 'x - y - 2']" ,  # System of equations 
618-             "mode" : "solve" ,
619-         },
620-     }
621- 
622609    # Mock parse_expression to return a list of expressions 
623610    with  mock .patch (
624611        "src.strands_tools.calculator.parse_expression" ,
@@ -629,7 +616,7 @@ def test_calculator_tool_with_system_of_equations():
629616        ),
630617    ):
631618        # This should trigger the system of equations path in calculator function 
632-         result  =  calc_function (tool_use )
619+         result  =  calc_function (expression = "['x + y - 10', 'x - y - 2']" ,  mode = "solve" )
633620
634621        # Check for success status 
635622        assert  result ["status" ] ==  "success" 
0 commit comments