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

DX-2689 Add MFA Integration Tests #93

Merged
merged 22 commits into from
Jul 18, 2022
Merged

Conversation

ajrice6713
Copy link
Contributor

No description provided.

1st pass at writing integration tests
Use assertAuthException to match unittest assert names
@ajrice6713 ajrice6713 requested a review from a team July 11, 2022 17:35
@ajrice6713 ajrice6713 changed the base branch from main to feature/openapi-generator-sdk July 11, 2022 17:35
@ajrice6713 ajrice6713 marked this pull request as draft July 11, 2022 18:06
Copy link

@bpateldx bpateldx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering why seed here and not in setup?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its currently not working correctly so I need to fix this

scope="scope",
message="Your temporary {NAME} {SCOPE} code is {CODE}",
digits=6,
)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would empty string be valid as per spec?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No - same as above - will add a check to ensure its a non empty string

These never get used due to the nature of the ApiException that gets raised.

Overkill to initialize these by kwarg and test
sets seed value as system time by default - this works better for multiple tests in parallel
@ajrice6713 ajrice6713 marked this pull request as ready for review July 14, 2022 19:30
@ajrice6713 ajrice6713 requested a review from bpateldx July 18, 2022 15:21
Copy link

@bpateldx bpateldx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes look good. Like the RateLimit test.

@ajrice6713 ajrice6713 merged commit 2b4c190 into feature/openapi-generator-sdk Jul 18, 2022
@ajrice6713 ajrice6713 deleted the DX-2689 branch July 18, 2022 16:41
@ajrice6713 ajrice6713 restored the DX-2689 branch July 18, 2022 19:42
@ajrice6713 ajrice6713 deleted the DX-2689 branch July 18, 2022 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants