-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Support updating pull request draft status
- Loading branch information
Showing
5 changed files
with
162 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
############################ Copyrights and license ############################ | ||
# # | ||
# Copyright 2012 Vincent Jacques <[email protected]> # | ||
# Copyright 2012 Zearin <[email protected]> # | ||
# Copyright 2013 Vincent Jacques <[email protected]> # | ||
# Copyright 2014 Vincent Jacques <[email protected]> # | ||
# Copyright 2016 Matthew Neal <[email protected]> # | ||
# Copyright 2016 Peter Buckley <[email protected]> # | ||
# Copyright 2016 Sam Corbett <[email protected]> # | ||
# Copyright 2018 sfdye <[email protected]> # | ||
# Copyright 2019 Adam Baratz <[email protected]> # | ||
# Copyright 2019 Olof-Joachim Frahm (欧雅福) <[email protected]> # | ||
# Copyright 2019 Steve Kowalik <[email protected]> # | ||
# Copyright 2019 TechnicalPirate <[email protected]># | ||
# Copyright 2019 Wan Liuyang <[email protected]> # | ||
# Copyright 2020 Anuj Bansal <[email protected]> # | ||
# Copyright 2020 Steve Kowalik <[email protected]> # | ||
# Copyright 2023 Enrico Minack <[email protected]> # | ||
# Copyright 2023 Jirka Borovec <[email protected]> # | ||
# Copyright 2023 Mikhail f. Shiryaev <[email protected]> # | ||
# # | ||
# This file is part of PyGithub. # | ||
# http://pygithub.readthedocs.io/ # | ||
# # | ||
# PyGithub is free software: you can redistribute it and/or modify it under # | ||
# the terms of the GNU Lesser General Public License as published by the Free # | ||
# Software Foundation, either version 3 of the License, or (at your option) # | ||
# any later version. # | ||
# # | ||
# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY # | ||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS # | ||
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more # | ||
# details. # | ||
# # | ||
# You should have received a copy of the GNU Lesser General Public License # | ||
# along with PyGithub. If not, see <http://www.gnu.org/licenses/>. # | ||
# # | ||
################################################################################ | ||
|
||
from . import Framework | ||
|
||
|
||
class PullRequest2989(Framework.TestCase): | ||
def setUp(self): | ||
super().setUp() | ||
r = self.g.get_repo("didot/PyGithub", lazy=True) | ||
self.ready_pr = r.get_pull(1) | ||
self.draft_pr = r.get_pull(2) | ||
|
||
def testConvertToDraft(self): | ||
self.assertFalse(self.ready_pr.draft) | ||
response = self.ready_pr.convert_to_draft() | ||
self.assertTrue(self.ready_pr.draft) | ||
assert response == { | ||
"clientMutationId": None, | ||
"pullRequest": { | ||
"isDraft": True, | ||
}, | ||
} | ||
|
||
def testMarkReadyForReview(self): | ||
self.assertTrue(self.draft_pr.draft) | ||
response = self.draft_pr.mark_ready_for_review() | ||
self.assertFalse(self.draft_pr.draft) | ||
assert response == { | ||
"clientMutationId": None, | ||
"pullRequest": { | ||
"isDraft": False, | ||
}, | ||
} |
Oops, something went wrong.