@@ -270,13 +270,13 @@ def test_purge_orchestrations_by_time_range():
270270def test_get_all_entities ():
271271 counter_value = 0
272272
273- def counter_entity (ctx : entities .EntityContext , _ ):
273+ def counter_entity (ctx : entities .EntityContext , input ):
274274 nonlocal counter_value
275275 if ctx .operation == "add" :
276- counter_value += ctx . get_input ( int )
276+ counter_value += input
277277 ctx .set_state (counter_value )
278278 elif ctx .operation == "get" :
279- ctx .set_result ( counter_value )
279+ return ctx .get_state ( int , 0 )
280280
281281 with DurableTaskSchedulerWorker (host_address = endpoint , secure_channel = True ,
282282 taskhub = taskhub_name , token_credential = None ) as w :
@@ -295,7 +295,7 @@ def counter_entity(ctx: entities.EntityContext, _):
295295 all_entities = c .get_all_entities (include_state = False )
296296 assert len ([e for e in all_entities if e .id == entity_id ]) == 1
297297 entity_without_state = [e for e in all_entities if e .id == entity_id ][0 ]
298- assert entity_without_state .serialized_state is None
298+ assert entity_without_state .get_state ( int ) is None
299299
300300 # Get all entities with state
301301 all_entities_with_state = c .get_all_entities (include_state = True )
@@ -305,9 +305,9 @@ def counter_entity(ctx: entities.EntityContext, _):
305305
306306
307307def test_get_entities_by_instance_id_prefix ():
308- def counter_entity (ctx : entities .EntityContext , _ ):
308+ def counter_entity (ctx : entities .EntityContext , input ):
309309 if ctx .operation == "set" :
310- ctx .set_state (ctx . get_input ( int ) )
310+ ctx .set_state (input )
311311
312312 with DurableTaskSchedulerWorker (host_address = endpoint , secure_channel = True ,
313313 taskhub = taskhub_name , token_credential = None ) as w :
@@ -344,9 +344,9 @@ def counter_entity(ctx: entities.EntityContext, _):
344344
345345
346346def test_get_entities_by_time_range ():
347- def simple_entity (ctx : entities .EntityContext , _ ):
347+ def simple_entity (ctx : entities .EntityContext , input ):
348348 if ctx .operation == "set" :
349- ctx .set_state (ctx . get_input ( str ) )
349+ ctx .set_state (input )
350350
351351 with DurableTaskSchedulerWorker (host_address = endpoint , secure_channel = True ,
352352 taskhub = taskhub_name , token_credential = None ) as w :
0 commit comments