99from copilot .generated .session_events import (
1010 AutoModeSwitchCompletedData ,
1111 AutoModeSwitchRequestedData ,
12+ AutoModeSwitchResponse ,
13+ ExitPlanModeAction ,
1214 ExitPlanModeCompletedData ,
1315 ExitPlanModeRequestedData ,
1416 SessionIdleData ,
@@ -104,7 +106,7 @@ async def on_exit_plan_mode(request, invocation):
104106 lambda event : (
105107 isinstance (event .data , ExitPlanModeCompletedData )
106108 and event .data .approved is True
107- and event .data .selected_action == "interactive"
109+ and event .data .selected_action == ExitPlanModeAction . INTERACTIVE
108110 ),
109111 )
110112 )
@@ -126,7 +128,7 @@ async def on_exit_plan_mode(request, invocation):
126128
127129 completed = await completed_event
128130 assert completed .data .approved is True
129- assert completed .data .selected_action == "interactive"
131+ assert completed .data .selected_action == ExitPlanModeAction . INTERACTIVE
130132 assert completed .data .feedback == "Approved by the Python E2E test"
131133 assert response is not None
132134 finally :
@@ -164,7 +166,7 @@ async def on_auto_mode_switch(request, invocation):
164166 session ,
165167 lambda event : (
166168 isinstance (event .data , AutoModeSwitchCompletedData )
167- and event .data .response == "yes"
169+ and event .data .response == AutoModeSwitchResponse . YES
168170 ),
169171 )
170172 )
@@ -192,7 +194,7 @@ async def on_auto_mode_switch(request, invocation):
192194 assert requested .data .retry_after_seconds == 1
193195
194196 completed = await completed_event
195- assert completed .data .response == "yes"
197+ assert completed .data .response == AutoModeSwitchResponse . YES
196198
197199 model_change = await model_change_event
198200 assert model_change .data .cause == "rate_limit_auto_switch"
0 commit comments