@@ -21,7 +21,7 @@ def mock_app():
2121 app = MagicMock ()
2222 app .ui_state = MagicMock ()
2323 app .actions = MagicMock ()
24- app .actions .handle_app_event = AsyncMock ()
24+ app .actions .post_app_event = AsyncMock ()
2525 app .actions .post_system_message = AsyncMock ()
2626 return app
2727
@@ -156,8 +156,8 @@ async def test_handles_text_delta_stream_event(self, mock_app, mock_config):
156156
157157 await agent_loop ._handle_message (message )
158158
159- mock_app .actions .handle_app_event .assert_called_once ()
160- call_arg = mock_app .actions .handle_app_event .call_args [0 ][0 ]
159+ mock_app .actions .post_app_event .assert_called_once ()
160+ call_arg = mock_app .actions .post_app_event .call_args [0 ][0 ]
161161 assert call_arg .type == AppEventType .STREAM_EVENT
162162 assert call_arg .data == {"text" : "Hello world" }
163163
@@ -178,7 +178,7 @@ async def test_ignores_empty_text_delta(self, mock_app, mock_config):
178178
179179 await agent_loop ._handle_message (message )
180180
181- mock_app .actions .handle_app_event .assert_not_called ()
181+ mock_app .actions .post_app_event .assert_not_called ()
182182
183183
184184class TestHandleMessageAssistantMessage :
@@ -193,8 +193,8 @@ async def test_handles_text_block(self, mock_app, mock_config):
193193
194194 await agent_loop ._handle_message (message )
195195
196- mock_app .actions .handle_app_event .assert_called_once ()
197- call_arg = mock_app .actions .handle_app_event .call_args [0 ][0 ]
196+ mock_app .actions .post_app_event .assert_called_once ()
197+ call_arg = mock_app .actions .post_app_event .call_args [0 ][0 ]
198198 assert call_arg .type == AppEventType .ASSISTANT
199199 assert call_arg .data ["content" ][0 ]["type" ] == ContentType .TEXT .value
200200 assert call_arg .data ["content" ][0 ]["text" ] == "Assistant response"
@@ -212,8 +212,8 @@ async def test_handles_tool_use_block(self, mock_app, mock_config):
212212
213213 await agent_loop ._handle_message (message )
214214
215- mock_app .actions .handle_app_event .assert_called_once ()
216- call_arg = mock_app .actions .handle_app_event .call_args [0 ][0 ]
215+ mock_app .actions .post_app_event .assert_called_once ()
216+ call_arg = mock_app .actions .post_app_event .call_args [0 ][0 ]
217217 assert call_arg .type == AppEventType .ASSISTANT
218218 assert call_arg .data ["content" ][0 ]["type" ] == ContentType .TOOL_USE .value
219219 assert call_arg .data ["content" ][0 ]["name" ] == "read_file"
@@ -287,7 +287,7 @@ async def test_posts_permission_request_message(self, mock_app, mock_config):
287287 _context = MagicMock (),
288288 )
289289
290- mock_app .actions .handle_app_event .assert_called_once ()
291- call_arg = mock_app .actions .handle_app_event .call_args [0 ][0 ]
290+ mock_app .actions .post_app_event .assert_called_once ()
291+ call_arg = mock_app .actions .post_app_event .call_args [0 ][0 ]
292292 assert call_arg .type == AppEventType .TOOL_PERMISSION_REQUEST
293293 assert call_arg .data ["tool_name" ] == "write_file"
0 commit comments