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 comprehensive suite of mocks for testing #350

Closed
sigmavirus24 opened this issue Feb 14, 2015 · 2 comments
Closed

Add comprehensive suite of mocks for testing #350

sigmavirus24 opened this issue Feb 14, 2015 · 2 comments

Comments

@sigmavirus24
Copy link
Owner

sigmavirus24 commented Feb 14, 2015

It would be nice, when people are using github3.py, to not have to mock out different objects in github3.py. Having a comprehensive suite of mocks that people can use while writing tests would be a really awesome feature.

It would allow users in their tests to use something like

from github3 import mocks

gh = mocks.login(username, password)

And to pass that into whatever code they're testing so if their test code looks like:

def fetch_authenticated_user(github):
    return github.me()

They can do

fetch_authenticated_user(gh)
gh.me.assert_called_once_with()

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/8580260-add-comprehensive-suite-of-mocks-for-testing?utm_campaign=plugin&utm_content=tracker%2F183477&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F183477&utm_medium=issues&utm_source=github).
@sigmavirus24 sigmavirus24 added this to the 1.1.0 milestone Feb 14, 2015
@sigmavirus24
Copy link
Owner Author

Could also call this fixtures. We should probably also provide a session that is automagically betamaxified.

@sigmavirus24
Copy link
Owner Author

Duplicate of #805

@sigmavirus24 sigmavirus24 marked this as a duplicate of #805 Mar 22, 2018
@sigmavirus24 sigmavirus24 removed this from the 1.1.0 milestone Apr 21, 2018
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

1 participant