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) )