@@ -101,35 +101,71 @@ def test_batch_submit_job_step_creation():
101101
102102
103103@patch .object (boto3 .session .Session , 'region_name' , 'us-east-1' )
104- def test_ecs_run_task_step_creation ():
105- step = EcsRunTaskStep ('Ecs Job' , wait_for_completion = False )
104+ @pytest .mark .parametrize (
105+ ("task_kwargs" ,),
106+ [
107+ ({},),
108+ ({
109+ "integration_pattern" : IntegrationPattern .WaitForCompletion ,
110+ "wait_for_completion" : False ,
111+ },),
112+ ]
113+ )
114+ def test_ecs_run_task_with_wait_for_completion (task_kwargs ):
115+ step = EcsRunTaskStep ('ECS Job' , ** task_kwargs )
116+
106117 assert step .to_dict () == {
107118 'Type' : 'Task' ,
108- 'Resource' : 'arn:aws:states:::ecs:runTask' ,
119+ 'Resource' : 'arn:aws:states:::ecs:runTask.sync ' ,
109120 'End' : True
110121 }
111122
112- step = EcsRunTaskStep ('Ecs Job' ,
113- integration_pattern = IntegrationPattern .WaitForTaskToken ,
114- wait_for_completion = False )
123+
124+ @patch .object (boto3 .session .Session , 'region_name' , 'us-east-1' )
125+ @pytest .mark .parametrize (
126+ ("task_kwargs" ,),
127+ [
128+ ({
129+ "integration_pattern" : IntegrationPattern .WaitForTaskToken ,
130+ "wait_for_completion" : False ,
131+ },),
132+ ]
133+ )
134+ def test_ecs_run_task_with_wait_for_task_token (task_kwargs ):
135+ step = EcsRunTaskStep ('ECS Job' , ** task_kwargs )
136+
115137 assert step .to_dict () == {
116138 'Type' : 'Task' ,
117139 'Resource' : 'arn:aws:states:::ecs:runTask.waitForTaskToken' ,
118140 'End' : True
119141 }
120142
121- step = EcsRunTaskStep ('Ecs Job' , parameters = {
122- 'TaskDefinition' : 'Task'
123- })
143+
144+ @patch .object (boto3 .session .Session , 'region_name' , 'us-east-1' )
145+ @pytest .mark .parametrize (
146+ ("task_kwargs" ,),
147+ [
148+ ({
149+ "wait_for_completion" : False ,
150+ },),
151+ ({
152+ "integration_pattern" : IntegrationPattern .CallAndContinue ,
153+ "wait_for_completion" : False ,
154+ },)
155+ ]
156+ )
157+ def test_ecs_run_task_with_call_and_continue (task_kwargs ):
158+ step = EcsRunTaskStep ('ECS Job' , ** task_kwargs )
159+
124160 assert step .to_dict () == {
125161 'Type' : 'Task' ,
126- 'Resource' : 'arn:aws:states:::ecs:runTask.sync' ,
127- 'Parameters' : {
128- 'TaskDefinition' : 'Task'
129- },
162+ 'Resource' : 'arn:aws:states:::ecs:runTask' ,
130163 'End' : True
131164 }
132165
166+
167+ @patch .object (boto3 .session .Session , 'region_name' , 'us-east-1' )
168+ def test_ecs_run_task_with_conflicting_arguments ():
133169 with pytest .raises (ValueError ):
134170 step = EcsRunTaskStep ('Ecs Job' ,
135171 wait_for_completion = True ,
0 commit comments