Add first version of SWF endpoint RespondDecisionTaskCompleted

There's just the structure for now, for now the workflow execution
doesn't know how to handle any decision type.
This commit is contained in:
Jean-Baptiste Barth 2015-10-12 11:08:52 +02:00
commit d97c770849
8 changed files with 211 additions and 2 deletions

View file

@ -10,6 +10,7 @@ from moto.swf.exceptions import (
SWFTypeDeprecatedFault,
SWFWorkflowExecutionAlreadyStartedFault,
SWFDefaultUndefinedFault,
SWFValidationException,
)
from moto.swf.models import (
WorkflowType,
@ -35,6 +36,16 @@ def test_swf_unknown_resource_fault():
"message": "Unknown type: detail"
})
def test_swf_unknown_resource_fault_with_only_one_parameter():
ex = SWFUnknownResourceFault("foo bar baz")
ex.status.should.equal(400)
ex.error_code.should.equal("UnknownResourceFault")
ex.body.should.equal({
"__type": "com.amazonaws.swf.base.model#UnknownResourceFault",
"message": "Unknown foo bar baz"
})
def test_swf_domain_already_exists_fault():
ex = SWFDomainAlreadyExistsFault("domain-name")
@ -103,3 +114,13 @@ def test_swf_default_undefined_fault():
"__type": "com.amazonaws.swf.base.model#DefaultUndefinedFault",
"message": "executionStartToCloseTimeout",
})
def test_swf_validation_exception():
ex = SWFValidationException("Invalid token")
ex.status.should.equal(400)
ex.error_code.should.equal("ValidationException")
ex.body.should.equal({
"__type": "com.amazon.coral.validate#ValidationException",
"message": "Invalid token",
})