Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add additional waiter config validation for matching error codes #3253

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions tests/functional/test_waiter_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,17 @@ def _validate_acceptor(acceptor, op_model, waiter_name):
f"'{waiter_name}' with non list result in JMESPath expression: "
f"{expression}"
)
if acceptor.matcher == 'error':
expected_code = acceptor.expected
all_codes = [shape.error_code for shape in op_model.error_shapes]
if expected_code not in all_codes:
raise AssertionError(
f"The '{waiter_name}' waiter for the "
f"'{op_model.service_model.service_name}' service that defines"
f"a matcher with error code {expected_code} that's not in "
f"the error codes defined in the {op_model.name} operation "
f"model: {', '.join(all_codes)}"
)


def _search_jmespath_expression(expression, op_model):
Expand Down
Loading