From 918cf8a4e31e3ce497c687359485c5f9fc85ccce Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Barth Date: Sat, 24 Oct 2015 05:10:01 +0200 Subject: [PATCH] Fix decision parameters: attributes are in foo*Decision*Attributes --- moto/swf/models/workflow_execution.py | 2 +- tests/test_swf/test_decision_tasks.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/moto/swf/models/workflow_execution.py b/moto/swf/models/workflow_execution.py index f53c1028..c22d3e02 100644 --- a/moto/swf/models/workflow_execution.py +++ b/moto/swf/models/workflow_execution.py @@ -286,7 +286,7 @@ class WorkflowExecution(object): # handle each decision separately, in order for decision in decisions: decision_type = decision["decisionType"] - attributes_key = "{}EventAttributes".format(decapitalize(decision_type)) + attributes_key = "{}DecisionAttributes".format(decapitalize(decision_type)) attributes = decision.get(attributes_key, {}) if decision_type == "CompleteWorkflowExecution": self.complete(event_id, attributes.get("result")) diff --git a/tests/test_swf/test_decision_tasks.py b/tests/test_swf/test_decision_tasks.py index 6ccd0780..a07eecbf 100644 --- a/tests/test_swf/test_decision_tasks.py +++ b/tests/test_swf/test_decision_tasks.py @@ -144,7 +144,7 @@ def test_respond_decision_task_completed_with_complete_workflow_execution(): decisions = [{ "decisionType": "CompleteWorkflowExecution", - "completeWorkflowExecutionEventAttributes": {"result": "foo bar"} + "completeWorkflowExecutionDecisionAttributes": {"result": "foo bar"} }] resp = conn.respond_decision_task_completed(task_token, decisions=decisions) resp.should.be.none @@ -240,7 +240,7 @@ def test_respond_decision_task_completed_with_fail_workflow_execution(): decisions = [{ "decisionType": "FailWorkflowExecution", - "failWorkflowExecutionEventAttributes": {"reason": "my rules", "details": "foo"} + "failWorkflowExecutionDecisionAttributes": {"reason": "my rules", "details": "foo"} }] resp = conn.respond_decision_task_completed(task_token, decisions=decisions) resp.should.be.none