SFN - fix InvalidARN exception on start_execution (#3007)
This commit is contained in:
parent
2320e82647
commit
93feeec1b7
@ -95,7 +95,10 @@ class StepFunctionResponse(BaseResponse):
|
|||||||
def start_execution(self):
|
def start_execution(self):
|
||||||
arn = self._get_param("stateMachineArn")
|
arn = self._get_param("stateMachineArn")
|
||||||
name = self._get_param("name")
|
name = self._get_param("name")
|
||||||
|
try:
|
||||||
execution = self.stepfunction_backend.start_execution(arn, name)
|
execution = self.stepfunction_backend.start_execution(arn, name)
|
||||||
|
except AWSError as err:
|
||||||
|
return err.response()
|
||||||
response = {
|
response = {
|
||||||
"executionArn": execution.execution_arn,
|
"executionArn": execution.execution_arn,
|
||||||
"startDate": execution.start_date,
|
"startDate": execution.start_date,
|
||||||
|
@ -253,6 +253,15 @@ def test_state_machine_throws_error_when_describing_unknown_machine():
|
|||||||
client.describe_state_machine(stateMachineArn=unknown_state_machine)
|
client.describe_state_machine(stateMachineArn=unknown_state_machine)
|
||||||
|
|
||||||
|
|
||||||
|
@mock_stepfunctions
|
||||||
|
@mock_sts
|
||||||
|
def test_state_machine_throws_error_when_describing_bad_arn():
|
||||||
|
client = boto3.client("stepfunctions", region_name=region)
|
||||||
|
#
|
||||||
|
with assert_raises(ClientError) as exc:
|
||||||
|
client.describe_state_machine(stateMachineArn="bad")
|
||||||
|
|
||||||
|
|
||||||
@mock_stepfunctions
|
@mock_stepfunctions
|
||||||
@mock_sts
|
@mock_sts
|
||||||
def test_state_machine_throws_error_when_describing_machine_in_different_account():
|
def test_state_machine_throws_error_when_describing_machine_in_different_account():
|
||||||
@ -362,6 +371,15 @@ def test_state_machine_start_execution():
|
|||||||
execution["startDate"].should.be.a(datetime)
|
execution["startDate"].should.be.a(datetime)
|
||||||
|
|
||||||
|
|
||||||
|
@mock_stepfunctions
|
||||||
|
@mock_sts
|
||||||
|
def test_state_machine_start_execution_bad_arn_raises_exception():
|
||||||
|
client = boto3.client("stepfunctions", region_name=region)
|
||||||
|
#
|
||||||
|
with assert_raises(ClientError) as exc:
|
||||||
|
client.start_execution(stateMachineArn="bad")
|
||||||
|
|
||||||
|
|
||||||
@mock_stepfunctions
|
@mock_stepfunctions
|
||||||
@mock_sts
|
@mock_sts
|
||||||
def test_state_machine_start_execution_with_custom_name():
|
def test_state_machine_start_execution_with_custom_name():
|
||||||
@ -446,7 +464,7 @@ def test_state_machine_describe_execution():
|
|||||||
|
|
||||||
@mock_stepfunctions
|
@mock_stepfunctions
|
||||||
@mock_sts
|
@mock_sts
|
||||||
def test_state_machine_throws_error_when_describing_unknown_machine():
|
def test_execution_throws_error_when_describing_unknown_execution():
|
||||||
client = boto3.client("stepfunctions", region_name=region)
|
client = boto3.client("stepfunctions", region_name=region)
|
||||||
#
|
#
|
||||||
with assert_raises(ClientError) as exc:
|
with assert_raises(ClientError) as exc:
|
||||||
|
Loading…
Reference in New Issue
Block a user