Support labels for PullRequests (#752)

PullRequests can also have labels attached to them, like Issues or
Milestones. Extend PullRequest to also export them if they are present,
as well as adding methods to add, remove and set labels.
This commit is contained in:
Steve Kowalik
2018-04-16 16:43:07 +08:00
committed by Wan Liuyang
parent 1e0150b527
commit a308dc92df
8 changed files with 444 additions and 1 deletions
@@ -0,0 +1,77 @@
https
GET
api.github.com
None
/repos/jacquev6/PyGithub/pulls/31/labels
{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'}
None
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4990'), ('content-length', '328'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"c9f9beccb03030beaf7b80927da6fef6"'), ('date', 'Sun, 27 May 2012 09:04:03 GMT'), ('content-type', 'application/json; charset=utf-8')]
[{"url":"https://api.github.com/repos/jacquev6/PyGithub/labels/wip","name":"wip","color":"eb6420"},{"url":"https://api.github.com/repos/jacquev6/PyGithub/labels/refactoring","name":"refactoring","color":"fbca04"},{"url":"https://api.github.com/repos/jacquev6/PyGithub/labels/improvement","name":"improvement","color":"ffffff"}]
https
DELETE
api.github.com
None
/repos/jacquev6/PyGithub/pulls/31/labels/wip
{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'}
None
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4989'), ('content-length', '229'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"46cc70bad88a09b559a5e67089005105"'), ('date', 'Sun, 27 May 2012 09:04:03 GMT'), ('content-type', 'application/json; charset=utf-8')]
[{"url":"https://api.github.com/repos/jacquev6/PyGithub/labels/refactoring","name":"refactoring","color":"fbca04"},{"url":"https://api.github.com/repos/jacquev6/PyGithub/labels/improvement","name":"improvement","color":"ffffff"}]
https
GET
api.github.com
None
/repos/jacquev6/PyGithub/pulls/31/labels
{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'}
None
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4988'), ('content-length', '229'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"46cc70bad88a09b559a5e67089005105"'), ('date', 'Sun, 27 May 2012 09:04:04 GMT'), ('content-type', 'application/json; charset=utf-8')]
[{"url":"https://api.github.com/repos/jacquev6/PyGithub/labels/refactoring","name":"refactoring","color":"fbca04"},{"url":"https://api.github.com/repos/jacquev6/PyGithub/labels/improvement","name":"improvement","color":"ffffff"}]
https
DELETE
api.github.com
None
/repos/jacquev6/PyGithub/pulls/31/labels/refactoring
{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'}
None
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4987'), ('content-length', '115'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"5352ae15c8a5a36c6cace63be9367332"'), ('date', 'Sun, 27 May 2012 09:04:04 GMT'), ('content-type', 'application/json; charset=utf-8')]
[{"url":"https://api.github.com/repos/jacquev6/PyGithub/labels/improvement","name":"improvement","color":"ffffff"}]
https
GET
api.github.com
None
/repos/jacquev6/PyGithub/pulls/31/labels
{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'}
None
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4986'), ('content-length', '115'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"5352ae15c8a5a36c6cace63be9367332"'), ('date', 'Sun, 27 May 2012 09:04:05 GMT'), ('content-type', 'application/json; charset=utf-8')]
[{"url":"https://api.github.com/repos/jacquev6/PyGithub/labels/improvement","name":"improvement","color":"ffffff"}]
https
POST
api.github.com
None
/repos/jacquev6/PyGithub/pulls/31/labels
{'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'}
["wip", "refactoring"]
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4985'), ('content-length', '328'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"d135d74d2ea2159d044676a220d41d3a"'), ('date', 'Sun, 27 May 2012 09:04:06 GMT'), ('content-type', 'application/json; charset=utf-8')]
[{"url":"https://api.github.com/repos/jacquev6/PyGithub/labels/wip","name":"wip","color":"eb6420"},{"url":"https://api.github.com/repos/jacquev6/PyGithub/labels/refactoring","name":"refactoring","color":"fbca04"},{"url":"https://api.github.com/repos/jacquev6/PyGithub/labels/improvement","name":"improvement","color":"ffffff"}]
https
GET
api.github.com
None
/repos/jacquev6/PyGithub/pulls/31/labels
{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'}
None
200
[('status', '200 OK'), ('x-ratelimit-remaining', '4984'), ('content-length', '328'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"c9f9beccb03030beaf7b80927da6fef6"'), ('date', 'Sun, 27 May 2012 09:04:06 GMT'), ('content-type', 'application/json; charset=utf-8')]
[{"url":"https://api.github.com/repos/jacquev6/PyGithub/labels/wip","name":"wip","color":"eb6420"},{"url":"https://api.github.com/repos/jacquev6/PyGithub/labels/refactoring","name":"refactoring","color":"fbca04"},{"url":"https://api.github.com/repos/jacquev6/PyGithub/labels/improvement","name":"improvement","color":"ffffff"}]