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
Allow for cancellation of organization invitations #2072
Conversation
This requires tests, and type checking -- also, maybe having it return a boolean. |
Thanks for the feedback. I've adjusted it to return a bool in the same way as other methods in the Organization class. Apologies I'm not 100% sure that the tests are what you're looking for, I've adapted the way that a previous PR did Organization testing. If the way I've done that isn't right let me know and I'll take another crack at it. RE: type checking are you able to link to an example of where that's being done elsewhere? Happy to put it in but not sure what you mean other than the "assert isinstance" line already there :) |
The test failures in AuthenticatedUser are my partially fault -- I pushed a fix a few minutes ago, please rebase. WRT type checking, I actually mean type hints, and picking on the method before the you added, like this: https://github.com/PyGithub/PyGithub/blob/master/github/Organization.pyi#L164 As as aside, you can just assertTrue() with calling the method in the test case, no need for a result variable. |
Thanks - have rebased and updated with the suggested changes |
You've been caught by a sharp edge here -- your replay data has jwt, but we expect password, compare the sent headers in another replay data text file. |
Thanks for the info, re-recorded tests under |
More issues caused by master, sorry, rebase, and we should be good to merge. |
Done, fingers crossed :) |
Codecov Report
@@ Coverage Diff @@
## master #2072 +/- ##
=======================================
Coverage 98.86% 98.87%
=======================================
Files 108 108
Lines 11086 11090 +4
=======================================
+ Hits 10960 10965 +5
+ Misses 126 125 -1
Continue to review full report at Codecov.
|
@s-t-e-v-e-n-k, when do you plan to release 1.56 with this update? |
Temporary patch that works for those who need that functionality immediately:
This manual was used: https://bobbyhadz.com/blog/python-add-method-to-existing-object |
This pull request will implement a new function
cancel_invitation
forgithub.Organization
objects, allowing for cancellation of organization invitations per https://docs.github.com/en/rest/reference/orgs#cancel-an-organization-invitation