@@ -31,7 +31,7 @@ def setUp(self):
3131 self .agent ._client = MagicMock ()
3232
3333 def test_multiply_numbers (self ):
34- self .assertEqual (multiply_numbers (2 , 3 ), {"result" : 5 })
34+ self .assertEqual (multiply_numbers (2 , 3 ), {"result" : 6 })
3535
3636 def test_handle_action_open_web_browser (self ):
3737 action = types .FunctionCall (name = "open_web_browser" , args = {})
@@ -86,8 +86,8 @@ def test_run_one_iteration_no_function_calls(self, mock_get_model_response):
8686 self .assertEqual (self .agent ._contents [1 ], mock_candidate .content )
8787
8888 @patch ('agent.BrowserAgent.get_model_response' )
89- @patch ('agent.BrowserAgent._execute_function_call ' )
90- def test_run_one_iteration_with_function_call (self , mock_execute_function_call , mock_get_model_response ):
89+ @patch ('agent.BrowserAgent.handle_action ' )
90+ def test_run_one_iteration_with_function_call (self , mock_handle_action , mock_get_model_response ):
9191 mock_response = MagicMock ()
9292 mock_candidate = MagicMock ()
9393 function_call = types .FunctionCall (name = "navigate" , args = {"url" : "https://example.com" })
@@ -96,12 +96,12 @@ def test_run_one_iteration_with_function_call(self, mock_execute_function_call,
9696 mock_get_model_response .return_value = mock_response
9797
9898 mock_env_state = EnvState (screenshot = b"screenshot" , url = "https://example.com" )
99- mock_execute_function_call .return_value = mock_env_state
99+ mock_handle_action .return_value = mock_env_state
100100
101101 result = self .agent .run_one_iteration ()
102102
103103 self .assertEqual (result , "CONTINUE" )
104- mock_execute_function_call .assert_called_once_with (function_call )
104+ mock_handle_action .assert_called_once_with (function_call )
105105 self .assertEqual (len (self .agent ._contents ), 3 )
106106
107107
0 commit comments