File tree Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Expand file tree Collapse file tree 2 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ def to_dict(self):
68
68
result = {}
69
69
# Common fields
70
70
for k , v in self .fields .items ():
71
- if v is not None :
71
+ if v is not None or k == 'result_path' :
72
72
k = to_pascalcase (k )
73
73
if k == to_pascalcase (Field .Parameters .value ):
74
74
result [k ] = self ._replace_placeholders (v )
Original file line number Diff line number Diff line change @@ -346,4 +346,24 @@ def test_retry_fail_for_unsupported_state():
346
346
c1 = Choice ('My Choice' )
347
347
348
348
with pytest .raises (ValueError ):
349
- c1 .add_catch (Catch (error_equals = ["States.NoChoiceMatched" ], next_step = Fail ("ChoiceFailed" )))
349
+ c1 .add_catch (Catch (error_equals = ["States.NoChoiceMatched" ], next_step = Fail ("ChoiceFailed" )))
350
+
351
+
352
+ def test_result_path_none ():
353
+ task_state = Task ('Task' , resource = 'arn:aws:lambda:us-east-1:1234567890:function:StartLambda' , result_path = None )
354
+ assert task_state .to_dict () == {
355
+ 'Type' : 'Task' ,
356
+ 'Resource' : 'arn:aws:lambda:us-east-1:1234567890:function:StartLambda' ,
357
+ 'ResultPath' : None ,
358
+ 'End' : True
359
+ }
360
+
361
+
362
+ def test_result_path_none_converted_to_null ():
363
+ task_state = Task ('Task' , resource = 'arn:aws:lambda:us-east-1:1234567890:function:StartLambda' , result_path = None )
364
+ assert '"ResultPath": null' in task_state .to_json ()
365
+
366
+
367
+ def test_default_result_path_not_converted_to_null ():
368
+ task_state = Task ('Task' , resource = 'arn:aws:lambda:us-east-1:1234567890:function:StartLambda' )
369
+ assert '"ResultPath": null' not in task_state .to_json ()
You can’t perform that action at this time.
0 commit comments