File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
contributing/samples/hello_world Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -70,12 +70,22 @@ async def run_prompt_bytes(session: Session, new_message: str):
7070 if event .content .parts and event .content .parts [0 ].text :
7171 print (f'** { event .author } : { event .content .parts [0 ].text } ' )
7272
73+ async def check_rolls_in_state (rolls_size : int ):
74+ session = await runner .session_service .get_session (
75+ app_name = app_name , user_id = user_id_1 , session_id = session_11 .id
76+ )
77+ assert len (session .state ['rolls' ]) == rolls_size
78+ for roll in session .state ['rolls' ]:
79+ assert roll > 0 and roll <= 100
80+
7381 start_time = time .time ()
7482 print ('Start time:' , start_time )
7583 print ('------------------------------------' )
7684 await run_prompt (session_11 , 'Hi' )
7785 await run_prompt (session_11 , 'Roll a die with 100 sides' )
86+ await check_rolls_in_state (1 )
7887 await run_prompt (session_11 , 'Roll a die again with 100 sides.' )
88+ await check_rolls_in_state (2 )
7989 await run_prompt (session_11 , 'What numbers did I got?' )
8090 await run_prompt_bytes (session_11 , 'Hi bytes' )
8191 print (
You can’t perform that action at this time.
0 commit comments