moto/tests/test_stepfunctions/parser/test_choice_state.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

37 lines
1.1 KiB
Python
Raw Normal View History

2024-03-16 14:03:41 +00:00
import json
from unittest import SkipTest
from moto import mock_aws, settings
from . import aws_verified, verify_execution_result
@mock_aws(config={"stepfunctions": {"execute_state_machine": True}})
def test_state_machine_with_choice():
if settings.TEST_SERVER_MODE:
raise SkipTest("Don't need to test this in ServerMode")
tmpl_name = "choice_state_singleton"
exec_input = {"type": "Public"}
def _verify_result(client, execution, execution_arn):
assert json.loads(execution["input"]) == exec_input
verify_execution_result(
_verify_result, "SUCCEEDED", tmpl_name, exec_input=json.dumps(exec_input)
)
@aws_verified
def test_state_machine_with_choice_miss():
if settings.TEST_SERVER_MODE:
raise SkipTest("Don't need to test this in ServerMode")
tmpl_name = "choice_state_singleton"
exec_input = {"type": "Private"}
def _verify_result(client, execution, execution_arn):
assert execution["cause"] == "No Matches!"
verify_execution_result(
_verify_result, "FAILED", tmpl_name, exec_input=json.dumps(exec_input)
)