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 mocking capability #40

Closed
brizental opened this issue Sep 11, 2017 · 4 comments
Closed

Add mocking capability #40

brizental opened this issue Sep 11, 2017 · 4 comments

Comments

@brizental
Copy link

I have an app that uses this extension and I want to mock the login function for testing. I was thinking that maybe we could add a a flag saying that the app is in test mode or not, if that is the case, then mock everything. I am willing to implement this :)

@cenkalti
Copy link
Owner

Hello @brizental. Which function/method do you want to mock? Can you solve your problem using unittest.mock module?

@brizental
Copy link
Author

I need to mock the authorize method and the get method, to login and get user info. I can use unittest.mock , but I thought it would be useful to have that built into the extension, instead of only having it in my app. Of course then we would have to mock every request to the GitHub API, not only the ones that I need. What do you think?

@cenkalti
Copy link
Owner

Sorry @brizental, I don't want to add this functionality to the extension. I find unittest.mock more suitable for the job.

@brizental
Copy link
Author

That's fine @cenkalti . Thanks for the quicl answer :)

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

No branches or pull requests

2 participants