Address SFN.Client.exceptions.ExecutionAlreadyExists Not implemented (#3263)
* Add check for existing execution, fix issue with make init * Remove f-string usage * Remove fstring usage in test * Pin black and run formatting on test_stepfunction * Reverse changes made by black 20.8b1
This commit is contained in:
parent
55b02c6ee9
commit
3b06ce689e
5 changed files with 37 additions and 1 deletions
|
|
@ -404,6 +404,27 @@ def test_state_machine_start_execution_with_custom_name():
|
|||
execution["startDate"].should.be.a(datetime)
|
||||
|
||||
|
||||
@mock_stepfunctions
|
||||
@mock_sts
|
||||
def test_state_machine_start_execution_fails_on_duplicate_execution_name():
|
||||
client = boto3.client("stepfunctions", region_name=region)
|
||||
#
|
||||
sm = client.create_state_machine(
|
||||
name="name", definition=str(simple_definition), roleArn=_get_default_role()
|
||||
)
|
||||
execution_one = client.start_execution(
|
||||
stateMachineArn=sm["stateMachineArn"], name="execution_name"
|
||||
)
|
||||
#
|
||||
with assert_raises(ClientError) as exc:
|
||||
_ = client.start_execution(
|
||||
stateMachineArn=sm["stateMachineArn"], name="execution_name"
|
||||
)
|
||||
exc.exception.response["Error"]["Message"].should.equal(
|
||||
"Execution Already Exists: '" + execution_one["executionArn"] + "'"
|
||||
)
|
||||
|
||||
|
||||
@mock_stepfunctions
|
||||
@mock_sts
|
||||
def test_state_machine_list_executions():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue