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):
70
70
if event .content .parts and event .content .parts [0 ].text :
71
71
print (f'** { event .author } : { event .content .parts [0 ].text } ' )
72
72
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
+
73
81
start_time = time .time ()
74
82
print ('Start time:' , start_time )
75
83
print ('------------------------------------' )
76
84
await run_prompt (session_11 , 'Hi' )
77
85
await run_prompt (session_11 , 'Roll a die with 100 sides' )
86
+ await check_rolls_in_state (1 )
78
87
await run_prompt (session_11 , 'Roll a die again with 100 sides.' )
88
+ await check_rolls_in_state (2 )
79
89
await run_prompt (session_11 , 'What numbers did I got?' )
80
90
await run_prompt_bytes (session_11 , 'Hi bytes' )
81
91
print (
You can’t perform that action at this time.
0 commit comments