-
Notifications
You must be signed in to change notification settings - Fork 3
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
Testing for gh.py #5
Conversation
This commit simplifies the parameter needed for calling _do_request. Using urljoin allows for a user to either provide "/testing/route" or "testing/route" and they will function the same in the context of building the API. This is in an effort to simplify testing.
This commit adds the initial support for testing the GitHub portion of this project. Most of this code is done via mocking all the HTTP requests made to the GitHub API.
Removed the returned function call that is being mocked since we were not using it.
Adds a test to validate that the wait call runs accordingly.
This simplifies and consolidates the test_remove_runner tests into a single parameter driven test.
This consolidates and simplifies the do_request testing.
This simplifies and consolidates the create_runner_token tests to be simpler.
Moved to a top level import to reduce repetition and simplify import logic.
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
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.
Pretty good start.
- Add smoke tests, where possible, to warn us if PyGithub's API changes. Since you test our logic in the existing tests, those tests can be just smoke tests.
- Looks like a TODO still to be implemented (which might simplify the associated test, as well?)
Updated get_runner test to ensure that we could check the instance correctly.
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.
Looks good for now! Note that we might come back and make a few updates here and in gh.py (I noticed a camelCase variable name there, which should be changed).
Merging.
This PR adds testing for
gh.py
making heavy use of mocks for the GitHub API calls. Additionally, this PR usesurljoin
to help fix some of the testing issues that can occur with URLs.