From 60bd58ffd853071a904bdca2e4cf4e48e1a8f07c Mon Sep 17 00:00:00 2001 From: Kevin DeJong Date: Sat, 13 Jul 2024 09:59:08 -0700 Subject: [PATCH] Test string definition errors --- .../test_state_machine_definition.py | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/test/unit/rules/resources/stepfunctions/test_state_machine_definition.py b/test/unit/rules/resources/stepfunctions/test_state_machine_definition.py index 69eecf2e03..00fdcf4ba6 100644 --- a/test/unit/rules/resources/stepfunctions/test_state_machine_definition.py +++ b/test/unit/rules/resources/stepfunctions/test_state_machine_definition.py @@ -454,6 +454,44 @@ def rule(): ), ], ), + ( + "Invalid string definition", + """ + { + "States": { + "NoType": {} + } + } + """, + [ + ValidationError( + "'Type' is a required property at 'States/NoType'", + rule=StateMachineDefinition(), + validator="required", + schema_path=deque( + [ + "properties", + "States", + "patternProperties", + "^.{1,128}$", + "required", + ] + ), + path=deque(["States", "NoType"]), + ), + ValidationError( + "'StartAt' is a required property", + rule=StateMachineDefinition(), + validator="required", + schema_path=deque( + [ + "required", + ] + ), + path=deque([]), + ), + ], + ), ], ) def test_validate(