DX-2689 Add MFA Integration Tests#93
Merged
ajrice6713 merged 22 commits intofeature/openapi-generator-sdkfrom Jul 18, 2022
Merged
DX-2689 Add MFA Integration Tests#93ajrice6713 merged 22 commits intofeature/openapi-generator-sdkfrom
ajrice6713 merged 22 commits intofeature/openapi-generator-sdkfrom
Conversation
1st pass at writing integration tests
Use assertAuthException to match unittest assert names
No auth header causes a 401
Otherwise we hit a rate limit very quickly
ajrice6713
commented
Jul 11, 2022
bpateldx
approved these changes
Jul 12, 2022
bpateldx
left a comment
There was a problem hiding this comment.
Please review comments, no major issues
| from bandwidth.exceptions import ApiException, UnauthorizedException, ForbiddenException | ||
|
|
||
| # seed the random number generator for the verify request | ||
| seed(randint(10, 500)) |
There was a problem hiding this comment.
Wondering why seed here and not in setup?
Contributor
Author
There was a problem hiding this comment.
Its currently not working correctly so I need to fix this
| scope="scope", | ||
| message="Your temporary {NAME} {SCOPE} code is {CODE}", | ||
| digits=6, | ||
| ) |
There was a problem hiding this comment.
The setup function looks clean and variable names are expressive, nice work.
Any chance to apply DRY principle?
|
|
||
| api_response: VoiceCodeResponse = self.api_instance.generate_voice_code( | ||
| self.account_id, self.voice_code_request) | ||
| self.assertIs(type(api_response.call_id), str) |
There was a problem hiding this comment.
Would empty string be valid as per spec?
Contributor
Author
There was a problem hiding this comment.
No - same as above - will add a check to ensure its a non empty string
Requested by MFA team
These never get used due to the nature of the ApiException that gets raised. Overkill to initialize these by kwarg and test
Bump time.sleep from 30-35
sets seed value as system time by default - this works better for multiple tests in parallel
ckoegel
approved these changes
Jul 14, 2022
bpateldx
approved these changes
Jul 18, 2022
bpateldx
left a comment
There was a problem hiding this comment.
Changes look good. Like the RateLimit test.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.