Proving once again that untested code is broken code, correctly set two
attributes during initialization of Invitation. Increase coverage by
checking every attribute.
Repository.create_git_tag_and_release() is a convience function that
creates a git tag and then a release. It was not passing the SHA1 of the
commit to the release function, resulting in incorrect releases.
Fixes#1336
The POST parameters passed to the create_project API call did not
consider the body optional, and always included it. Fix up a formatting
error in the docstring for good measure.
Fixes#1357
* Added nested teams and parent
- Added github.Team.Team.get_teams() to get nested teams.
- Added github.Team.Team.parent which points to the parent team.
Fixes#1337
Read the Docs defaults to using Python 2 to build the documentation, so
add a configuration file so we use a supported (upstream and by us)
version.
Fixes#1341
InputGitTreeElement is used to build tree objects for
Repository.create_git_tree(). However, the GitHub API allows passing
sha=null to delete a file, which we don't allow. Extend the checking in
InputGitTreeElement to also allow None, and add a test for good measure.
Fixes#1318
The API preview flag for both MainClass and Requester was the last
hard-coded custom header, and it seems to not be relevant since
mid-2015. Remove it, if any users are using it, they shouldn't be. Its
code path was also entirely untested.
Xenial has been the default distribution since May, 2019, so tidy up the
test matrix to no longer specify it. Furthermore, due to not quoting the
distributions in the deploy config, we did not ship wheels on pypi.
Fixes#1321
* Add Support for PullRequest update-branch
* Add test case
* Fix test case
* Add test data record
* Update PullRequest.py
* Update PullRequest.py
* Support py2.7
* Assert response status is 202
* black + isort
To stop skipping logging tests on Python 3, refactor them to mock out
the logger and check arguments directly, rather than naively comparing
strings. Allow a logger to be injected into Requester for this.
* Support for create_fork
http://developer.github.com/v3/repos/forks
* Add test case for create_fork
* Add param doc and fix extra line
* Specify the organization to increase line coverage
* Update test data
* Add type assert for organization param
SourceImport.update() is really GithubObject.update(), which just calls
GET on the object's URL. Refetching a source import requires an
additional header, so change GithubObject.update() to pass any it is
given, and add a test for SourceImport.update()
Fixes#1297
The current API for changing user and teams push restrictions is
brittle, and flat out incorrect when it comes to adding members. Break
the API, but replace it with one that is correct.
Co-Authored-By: Jonas Maurus <jonas-github@maurus.net>
Repository.get_contents() and Repository.get_dir_contents() call the
same endpoint, with slightly different error handling, and with the
difference that get_dir_contents() throws an odd exception if you call
it with a file. get_contents() already even handles being called for a
directory anyway, so deprecate get_dir_contents(), and refactor the code
so the tests pass.
Fixes#1283
Use set -e in manage.sh for some safety, and allow the remote to be
overridden for those of us who have different setups, and switch to
using flake8 for checks like travis does.
NamedUser.get_organization_membership() was calling the API method for
fetching the currently authenticated user only, which is incorrect. The
method was not tested directly, so add tests. Furthermore, Membership
had some errors which had slipped through review, so correct them.
Sadly, this is an API break, since passing the organization as an int
made no sense in this case.
Fixes#1276
Currently, we were checking for an uppercase header if GitHub was
refusing our authentication because we didn't provide a token. Requests
returns headers with all lowercase. Fix the const, and add a test for
good measure.
Fixes#1273