-
Notifications
You must be signed in to change notification settings - Fork 80
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
chore: Add aws_json error code tests #1798
Conversation
"aws.protocoltests.restjson#FooError:http://internal.amazon.com/coral/com.amazon.coral.validate/" | ||
] | ||
|
||
// MARK: - error code decoding & sanitization |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests are added below to ensure that error code can be decoded no matter which of the allowed places it is located.
) else { | ||
XCTFail("Something is wrong with the created http response") | ||
return | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logic above is extracted to a helper method, defined below.
} | ||
|
||
func testSanitizeErrorName() async throws { | ||
let errorCodes = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These error codes match the ones used for AWS JSON
Description of changes
Note that are no actual code changes in this PR, only tests. Upon close examination, the logic for error codes is correct but it was untested.
New/existing dependencies impact assessment, if applicable
No new dependencies were added to this change.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.