From 10bbfc1defc9a4129459ccb5a652e34c3b5081c2 Mon Sep 17 00:00:00 2001 From: David Farr Date: Mon, 16 Dec 2013 11:15:17 -0800 Subject: [PATCH 1/3] Now accepts strings for assignee. When calling pygithub for calls associated with assignees you can now simply pass a string instead of a NamedUser object. This applies to the following methods: - issue.edit() - repo.create_issue() - repo.get_issues() - repo.has_in_assignees() - repo.has_in_collaborators() - repo.remove_from_collaborators() - repo.add_to_collaborators() --- github/Issue.py | 9 +++++--- github/Repository.py | 53 ++++++++++++++++++++++++++++++-------------- 2 files changed, 42 insertions(+), 20 deletions(-) diff --git a/github/Issue.py b/github/Issue.py index aba747fe..8dd4439d 100644 --- a/github/Issue.py +++ b/github/Issue.py @@ -262,7 +262,7 @@ class Issue(github.GithubObject.CompletableGithubObject): :calls: `PATCH /repos/:owner/:repo/issues/:number `_ :param title: string :param body: string - :param assignee: :class:`github.NamedUser.NamedUser` or None + :param assignee: string or :class:`github.NamedUser.NamedUser` or None :param state: string :param milestone: :class:`github.Milestone.Milestone` or None :param labels: list of string @@ -270,7 +270,7 @@ class Issue(github.GithubObject.CompletableGithubObject): """ assert title is github.GithubObject.NotSet or isinstance(title, (str, unicode)), title assert body is github.GithubObject.NotSet or isinstance(body, (str, unicode)), body - assert assignee is github.GithubObject.NotSet or assignee is None or isinstance(assignee, github.NamedUser.NamedUser), assignee + assert assignee is github.GithubObject.NotSet or assignee is None or isinstance(assignee, github.NamedUser.NamedUser) or isinstance(assignee, (str, unicode)), assignee assert state is github.GithubObject.NotSet or isinstance(state, (str, unicode)), state assert milestone is github.GithubObject.NotSet or milestone is None or isinstance(milestone, github.Milestone.Milestone), milestone assert labels is github.GithubObject.NotSet or all(isinstance(element, (str, unicode)) for element in labels), labels @@ -280,7 +280,10 @@ class Issue(github.GithubObject.CompletableGithubObject): if body is not github.GithubObject.NotSet: post_parameters["body"] = body if assignee is not github.GithubObject.NotSet: - post_parameters["assignee"] = assignee._identity if assignee else '' + if isinstance(assignee, (str, unicode)): + post_parameters["assignee"] = assignee + else: + post_parameters["assignee"] = assignee._identity if assignee else '' if state is not github.GithubObject.NotSet: post_parameters["state"] = state if milestone is not github.GithubObject.NotSet: diff --git a/github/Repository.py b/github/Repository.py index 6a791b5f..c2a867af 100644 --- a/github/Repository.py +++ b/github/Repository.py @@ -636,13 +636,17 @@ class Repository(github.GithubObject.CompletableGithubObject): def add_to_collaborators(self, collaborator): """ :calls: `PUT /repos/:owner/:repo/collaborators/:user `_ - :param collaborator: :class:`github.NamedUser.NamedUser` + :param collaborator: string or :class:`github.NamedUser.NamedUser` :rtype: None """ - assert isinstance(collaborator, github.NamedUser.NamedUser), collaborator + assert isinstance(collaborator, github.NamedUser.NamedUser) or isinstance(collaborator, (str, unicode)), collaborator + + if isinstance(collaborator, github.NamedUser.NamedUser): + collaborator = collaborator._identity + headers, data = self._requester.requestJsonAndCheck( "PUT", - self.url + "/collaborators/" + collaborator._identity + self.url + "/collaborators/" + collaborator ) def compare(self, base, head): @@ -815,14 +819,14 @@ class Repository(github.GithubObject.CompletableGithubObject): :calls: `POST /repos/:owner/:repo/issues `_ :param title: string :param body: string - :param assignee: :class:`github.NamedUser.NamedUser` + :param assignee: string or :class:`github.NamedUser.NamedUser` :param milestone: :class:`github.Milestone.Milestone` :param labels: list of :class:`github.Label.Label` :rtype: :class:`github.Issue.Issue` """ assert isinstance(title, (str, unicode)), title assert body is github.GithubObject.NotSet or isinstance(body, (str, unicode)), body - assert assignee is github.GithubObject.NotSet or isinstance(assignee, github.NamedUser.NamedUser), assignee + assert assignee is github.GithubObject.NotSet or isinstance(assignee, github.NamedUser.NamedUser) or isinstance(assignee, (str, unicode)), assignee assert milestone is github.GithubObject.NotSet or isinstance(milestone, github.Milestone.Milestone), milestone assert labels is github.GithubObject.NotSet or all(isinstance(element, github.Label.Label) for element in labels), labels post_parameters = { @@ -831,7 +835,10 @@ class Repository(github.GithubObject.CompletableGithubObject): if body is not github.GithubObject.NotSet: post_parameters["body"] = body if assignee is not github.GithubObject.NotSet: - post_parameters["assignee"] = assignee._identity + if isinstance(assignee, (str, unicode)): + post_parameters["assignee"] = assignee + else: + post_parameters["assignee"] = assignee._identity if milestone is not github.GithubObject.NotSet: post_parameters["milestone"] = milestone._identity if labels is not github.GithubObject.NotSet: @@ -1394,7 +1401,7 @@ class Repository(github.GithubObject.CompletableGithubObject): :calls: `GET /repos/:owner/:repo/issues `_ :param milestone: :class:`github.Milestone.Milestone` or "none" or "*" :param state: string - :param assignee: :class:`github.NamedUser.NamedUser` or "none" or "*" + :param assignee: string or :class:`github.NamedUser.NamedUser` or "none" or "*" :param mentioned: :class:`github.NamedUser.NamedUser` :param labels: list of :class:`github.Label.Label` :param sort: string @@ -1404,7 +1411,7 @@ class Repository(github.GithubObject.CompletableGithubObject): """ assert milestone is github.GithubObject.NotSet or milestone == "*" or milestone == "none" or isinstance(milestone, github.Milestone.Milestone), milestone assert state is github.GithubObject.NotSet or isinstance(state, (str, unicode)), state - assert assignee is github.GithubObject.NotSet or assignee == "*" or assignee == "none" or isinstance(assignee, github.NamedUser.NamedUser), assignee + assert assignee is github.GithubObject.NotSet or isinstance(assignee, github.NamedUser.NamedUser) or isinstance(assignee, (str, unicode)), assignee assert mentioned is github.GithubObject.NotSet or isinstance(mentioned, github.NamedUser.NamedUser), mentioned assert labels is github.GithubObject.NotSet or all(isinstance(element, github.Label.Label) for element in labels), labels assert sort is github.GithubObject.NotSet or isinstance(sort, (str, unicode)), sort @@ -1825,26 +1832,34 @@ class Repository(github.GithubObject.CompletableGithubObject): def has_in_assignees(self, assignee): """ :calls: `GET /repos/:owner/:repo/assignees/:assignee `_ - :param assignee: :class:`github.NamedUser.NamedUser` + :param assignee: string or :class:`github.NamedUser.NamedUser` :rtype: bool """ - assert isinstance(assignee, github.NamedUser.NamedUser), assignee + assert isinstance(assignee, github.NamedUser.NamedUser) or isinstance(assignee, (str, unicode)), assignee + + if isinstance(assignee, github.NamedUser.NamedUser): + assignee = assignee._identity + status, headers, data = self._requester.requestJson( "GET", - self.url + "/assignees/" + assignee._identity + self.url + "/assignees/" + assignee ) return status == 204 def has_in_collaborators(self, collaborator): """ :calls: `GET /repos/:owner/:repo/collaborators/:user `_ - :param collaborator: :class:`github.NamedUser.NamedUser` + :param collaborator: string or :class:`github.NamedUser.NamedUser` :rtype: bool """ - assert isinstance(collaborator, github.NamedUser.NamedUser), collaborator + assert isinstance(collaborator, github.NamedUser.NamedUser) or isinstance(collaborator, (str, unicode)), collaborator + + if isinstance(collaborator, github.NamedUser.NamedUser): + collaborator = collaborator._identity + status, headers, data = self._requester.requestJson( "GET", - self.url + "/collaborators/" + collaborator._identity + self.url + "/collaborators/" + collaborator ) return status == 204 @@ -1896,13 +1911,17 @@ class Repository(github.GithubObject.CompletableGithubObject): def remove_from_collaborators(self, collaborator): """ :calls: `DELETE /repos/:owner/:repo/collaborators/:user `_ - :param collaborator: :class:`github.NamedUser.NamedUser` + :param collaborator: string or :class:`github.NamedUser.NamedUser` :rtype: None """ - assert isinstance(collaborator, github.NamedUser.NamedUser), collaborator + assert isinstance(collaborator, github.NamedUser.NamedUser) or isinstance(collaborator, (str, unicode)), collaborator + + if isinstance(collaborator, github.NamedUser.NamedUser): + collaborator = collaborator._identity + headers, data = self._requester.requestJsonAndCheck( "DELETE", - self.url + "/collaborators/" + collaborator._identity + self.url + "/collaborators/" + collaborator ) def subscribe_to_hub(self, event, callback, secret=github.GithubObject.NotSet): From ce3fb533e06f5973813f845284129125718b83ae Mon Sep 17 00:00:00 2001 From: David Farr Date: Mon, 16 Dec 2013 16:24:24 -0800 Subject: [PATCH 2/3] adding the tests for issue 214 --- github/tests/AllTests.py | 1 + github/tests/Issue214.py | 70 +++++++++++++++++ github/tests/ReplayData/Issue214.setUp.txt | 33 ++++++++ .../ReplayData/Issue214.testAssignees.txt | 22 ++++++ .../ReplayData/Issue214.testCollaborators.txt | 77 +++++++++++++++++++ .../ReplayData/Issue214.testCreateIssue.txt | 11 +++ .../ReplayData/Issue214.testEditIssue.txt | 22 ++++++ .../ReplayData/Issue214.testGetIssues.txt | 11 +++ 8 files changed, 247 insertions(+) create mode 100644 github/tests/Issue214.py create mode 100644 github/tests/ReplayData/Issue214.setUp.txt create mode 100644 github/tests/ReplayData/Issue214.testAssignees.txt create mode 100644 github/tests/ReplayData/Issue214.testCollaborators.txt create mode 100644 github/tests/ReplayData/Issue214.testCreateIssue.txt create mode 100644 github/tests/ReplayData/Issue214.testEditIssue.txt create mode 100644 github/tests/ReplayData/Issue214.testGetIssues.txt diff --git a/github/tests/AllTests.py b/github/tests/AllTests.py index de6ca0f2..23b12792 100644 --- a/github/tests/AllTests.py +++ b/github/tests/AllTests.py @@ -86,3 +86,4 @@ from Issue140 import * from Issue142 import * from Issue158 import * from Issue174 import * +from Issue214 import * diff --git a/github/tests/Issue214.py b/github/tests/Issue214.py new file mode 100644 index 00000000..3dca6228 --- /dev/null +++ b/github/tests/Issue214.py @@ -0,0 +1,70 @@ +# -*- coding: utf-8 -*- + +############################ Copyrights and license ############################ +# # +# Copyright 2012 Vincent Jacques # +# Copyright 2012 Zearin # +# Copyright 2013 Vincent Jacques # +# # +# This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ # +# # +# 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 . # +# # +################################################################################ + +import github + +import Framework + + +class Issue214(Framework.TestCase): # https://github.com/jacquev6/PyGithub/issues/214 + def setUp(self): + Framework.TestCase.setUp(self) + self.repo = self.g.get_user().get_repo("PyGithub") + self.issue = self.repo.get_issue(1) + + def testAssignees(self): + self.assertTrue(self.repo.has_in_assignees('farrd')) + self.assertFalse(self.repo.has_in_assignees('fake')) + + def testCollaborators(self): + self.assertTrue(self.repo.has_in_collaborators('farrd')) + self.assertFalse(self.repo.has_in_collaborators('fake')) + + self.assertFalse(self.repo.has_in_collaborators('marcmenges')) + self.repo.add_to_collaborators('marcmenges') + self.assertTrue(self.repo.has_in_collaborators('marcmenges')) + + self.repo.remove_from_collaborators('marcmenges') + self.assertFalse(self.repo.has_in_collaborators('marcmenges')) + + def testEditIssue(self): + self.assertEqual(self.issue.assignee, None) + + self.issue.edit(assignee='farrd') + self.assertEqual(self.issue.assignee.login, 'farrd') + + self.issue.edit(assignee=None) + self.assertEqual(self.issue.assignee, None) + + def testCreateIssue(self): + issue = self.repo.create_issue("Issue created by PyGithub", assignee='farrd') + self.assertEqual(issue.assignee.login, 'farrd') + + def testGetIssues(self): + issues = self.repo.get_issues(assignee='farrd') + + for issue in issues: + self.assertEqual(issue.assignee.login, 'farrd') + diff --git a/github/tests/ReplayData/Issue214.setUp.txt b/github/tests/ReplayData/Issue214.setUp.txt new file mode 100644 index 00000000..83a57d95 --- /dev/null +++ b/github/tests/ReplayData/Issue214.setUp.txt @@ -0,0 +1,33 @@ +https +GET +api.github.com +None +/user +{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +null +200 +[('status', '200 OK'), ('x-ratelimit-remaining', '4768'), ('x-github-media-type', 'github.beta; format=json'), ('x-content-type-options', 'nosniff'), ('access-control-expose-headers', 'ETag, Link, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('x-github-request-id', 'A99159CE:6DA8:2C02300:52AF94DA'), ('access-control-allow-credentials', 'true'), ('vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('content-length', '1395'), ('server', 'GitHub.com'), ('last-modified', 'Mon, 16 Dec 2013 23:51:56 GMT'), ('x-ratelimit-limit', '5000'), ('etag', '"56120a0ff6bd4c69ed5aca11916c2ff8"'), ('cache-control', 'private, max-age=60, s-maxage=60'), ('date', 'Tue, 17 Dec 2013 00:03:38 GMT'), ('access-control-allow-origin', '*'), ('content-type', 'application/json; charset=utf-8'), ('x-ratelimit-reset', '1387240227')] +{"login":"farrd","id":1387834,"avatar_url":"https://gravatar.com/avatar/3281acd8cd12337bfba7577736ae663e?d=https%3A%2F%2Fidenticons.github.com%2Fe57fcb2ce01df0e0a8305b6fff8070d8.png&r=x","gravatar_id":"3281acd8cd12337bfba7577736ae663e","url":"https://api.github.com/users/farrd","html_url":"https://github.com/farrd","followers_url":"https://api.github.com/users/farrd/followers","following_url":"https://api.github.com/users/farrd/following{/other_user}","gists_url":"https://api.github.com/users/farrd/gists{/gist_id}","starred_url":"https://api.github.com/users/farrd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/farrd/subscriptions","organizations_url":"https://api.github.com/users/farrd/orgs","repos_url":"https://api.github.com/users/farrd/repos","events_url":"https://api.github.com/users/farrd/events{/privacy}","received_events_url":"https://api.github.com/users/farrd/received_events","type":"User","site_admin":false,"name":"","company":null,"blog":"","location":null,"email":"","hireable":false,"bio":null,"public_repos":10,"followers":0,"following":1,"created_at":"2012-01-28T19:38:20Z","updated_at":"2013-12-16T23:51:56Z","public_gists":0,"total_private_repos":0,"owned_private_repos":0,"disk_usage":16176,"collaborators":0,"plan":{"name":"free","space":307200,"collaborators":0,"private_repos":0},"private_gists":0} + +https +GET +api.github.com +None +/repos/farrd/PyGithub +{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +null +200 +[('status', '200 OK'), ('x-ratelimit-remaining', '4767'), ('x-github-media-type', 'github.beta; format=json'), ('x-content-type-options', 'nosniff'), ('access-control-expose-headers', 'ETag, Link, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('x-github-request-id', 'A99159CE:6DAC:7BF4DD8:52AF94DA'), ('access-control-allow-credentials', 'true'), ('vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('content-length', '14028'), ('server', 'GitHub.com'), ('last-modified', 'Mon, 16 Dec 2013 23:29:38 GMT'), ('x-ratelimit-limit', '5000'), ('etag', '"481861750ad70aeeae3fc09b40288ade"'), ('cache-control', 'private, max-age=60, s-maxage=60'), ('date', 'Tue, 17 Dec 2013 00:03:39 GMT'), ('access-control-allow-origin', '*'), ('content-type', 'application/json; charset=utf-8'), ('x-ratelimit-reset', '1387240227')] +{"id":15089554,"name":"PyGithub","full_name":"farrd/PyGithub","owner":{"login":"farrd","id":1387834,"avatar_url":"https://gravatar.com/avatar/3281acd8cd12337bfba7577736ae663e?d=https%3A%2F%2Fidenticons.github.com%2Fe57fcb2ce01df0e0a8305b6fff8070d8.png&r=x","gravatar_id":"3281acd8cd12337bfba7577736ae663e","url":"https://api.github.com/users/farrd","html_url":"https://github.com/farrd","followers_url":"https://api.github.com/users/farrd/followers","following_url":"https://api.github.com/users/farrd/following{/other_user}","gists_url":"https://api.github.com/users/farrd/gists{/gist_id}","starred_url":"https://api.github.com/users/farrd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/farrd/subscriptions","organizations_url":"https://api.github.com/users/farrd/orgs","repos_url":"https://api.github.com/users/farrd/repos","events_url":"https://api.github.com/users/farrd/events{/privacy}","received_events_url":"https://api.github.com/users/farrd/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/farrd/PyGithub","description":"Python library implementing the full Github API v3","fork":true,"url":"https://api.github.com/repos/farrd/PyGithub","forks_url":"https://api.github.com/repos/farrd/PyGithub/forks","keys_url":"https://api.github.com/repos/farrd/PyGithub/keys{/key_id}","collaborators_url":"https://api.github.com/repos/farrd/PyGithub/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/farrd/PyGithub/teams","hooks_url":"https://api.github.com/repos/farrd/PyGithub/hooks","issue_events_url":"https://api.github.com/repos/farrd/PyGithub/issues/events{/number}","events_url":"https://api.github.com/repos/farrd/PyGithub/events","assignees_url":"https://api.github.com/repos/farrd/PyGithub/assignees{/user}","branches_url":"https://api.github.com/repos/farrd/PyGithub/branches{/branch}","tags_url":"https://api.github.com/repos/farrd/PyGithub/tags","blobs_url":"https://api.github.com/repos/farrd/PyGithub/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/farrd/PyGithub/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/farrd/PyGithub/git/refs{/sha}","trees_url":"https://api.github.com/repos/farrd/PyGithub/git/trees{/sha}","statuses_url":"https://api.github.com/repos/farrd/PyGithub/statuses/{sha}","languages_url":"https://api.github.com/repos/farrd/PyGithub/languages","stargazers_url":"https://api.github.com/repos/farrd/PyGithub/stargazers","contributors_url":"https://api.github.com/repos/farrd/PyGithub/contributors","subscribers_url":"https://api.github.com/repos/farrd/PyGithub/subscribers","subscription_url":"https://api.github.com/repos/farrd/PyGithub/subscription","commits_url":"https://api.github.com/repos/farrd/PyGithub/commits{/sha}","git_commits_url":"https://api.github.com/repos/farrd/PyGithub/git/commits{/sha}","comments_url":"https://api.github.com/repos/farrd/PyGithub/comments{/number}","issue_comment_url":"https://api.github.com/repos/farrd/PyGithub/issues/comments/{number}","contents_url":"https://api.github.com/repos/farrd/PyGithub/contents/{+path}","compare_url":"https://api.github.com/repos/farrd/PyGithub/compare/{base}...{head}","merges_url":"https://api.github.com/repos/farrd/PyGithub/merges","archive_url":"https://api.github.com/repos/farrd/PyGithub/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/farrd/PyGithub/downloads","issues_url":"https://api.github.com/repos/farrd/PyGithub/issues{/number}","pulls_url":"https://api.github.com/repos/farrd/PyGithub/pulls{/number}","milestones_url":"https://api.github.com/repos/farrd/PyGithub/milestones{/number}","notifications_url":"https://api.github.com/repos/farrd/PyGithub/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/farrd/PyGithub/labels{/name}","releases_url":"https://api.github.com/repos/farrd/PyGithub/releases{/id}","created_at":"2013-12-10T21:12:48Z","updated_at":"2013-12-16T23:29:38Z","pushed_at":"2013-12-16T19:15:40Z","git_url":"git://github.com/farrd/PyGithub.git","ssh_url":"git@github.com:farrd/PyGithub.git","clone_url":"https://github.com/farrd/PyGithub.git","svn_url":"https://github.com/farrd/PyGithub","homepage":"http://jacquev6.github.com/PyGithub","size":8785,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master","master_branch":"master","permissions":{"admin":true,"push":true,"pull":true},"parent":{"id":3544490,"name":"PyGithub","full_name":"jacquev6/PyGithub","owner":{"login":"jacquev6","id":327146,"avatar_url":"https://gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https%3A%2F%2Fidenticons.github.com%2Ffadfb5f7088ef66579d198a3c9a4935e.png&r=x","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","url":"https://api.github.com/users/jacquev6","html_url":"https://github.com/jacquev6","followers_url":"https://api.github.com/users/jacquev6/followers","following_url":"https://api.github.com/users/jacquev6/following{/other_user}","gists_url":"https://api.github.com/users/jacquev6/gists{/gist_id}","starred_url":"https://api.github.com/users/jacquev6/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacquev6/subscriptions","organizations_url":"https://api.github.com/users/jacquev6/orgs","repos_url":"https://api.github.com/users/jacquev6/repos","events_url":"https://api.github.com/users/jacquev6/events{/privacy}","received_events_url":"https://api.github.com/users/jacquev6/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jacquev6/PyGithub","description":"Python library implementing the full Github API v3","fork":false,"url":"https://api.github.com/repos/jacquev6/PyGithub","forks_url":"https://api.github.com/repos/jacquev6/PyGithub/forks","keys_url":"https://api.github.com/repos/jacquev6/PyGithub/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jacquev6/PyGithub/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jacquev6/PyGithub/teams","hooks_url":"https://api.github.com/repos/jacquev6/PyGithub/hooks","issue_events_url":"https://api.github.com/repos/jacquev6/PyGithub/issues/events{/number}","events_url":"https://api.github.com/repos/jacquev6/PyGithub/events","assignees_url":"https://api.github.com/repos/jacquev6/PyGithub/assignees{/user}","branches_url":"https://api.github.com/repos/jacquev6/PyGithub/branches{/branch}","tags_url":"https://api.github.com/repos/jacquev6/PyGithub/tags","blobs_url":"https://api.github.com/repos/jacquev6/PyGithub/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jacquev6/PyGithub/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jacquev6/PyGithub/git/refs{/sha}","trees_url":"https://api.github.com/repos/jacquev6/PyGithub/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jacquev6/PyGithub/statuses/{sha}","languages_url":"https://api.github.com/repos/jacquev6/PyGithub/languages","stargazers_url":"https://api.github.com/repos/jacquev6/PyGithub/stargazers","contributors_url":"https://api.github.com/repos/jacquev6/PyGithub/contributors","subscribers_url":"https://api.github.com/repos/jacquev6/PyGithub/subscribers","subscription_url":"https://api.github.com/repos/jacquev6/PyGithub/subscription","commits_url":"https://api.github.com/repos/jacquev6/PyGithub/commits{/sha}","git_commits_url":"https://api.github.com/repos/jacquev6/PyGithub/git/commits{/sha}","comments_url":"https://api.github.com/repos/jacquev6/PyGithub/comments{/number}","issue_comment_url":"https://api.github.com/repos/jacquev6/PyGithub/issues/comments/{number}","contents_url":"https://api.github.com/repos/jacquev6/PyGithub/contents/{+path}","compare_url":"https://api.github.com/repos/jacquev6/PyGithub/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jacquev6/PyGithub/merges","archive_url":"https://api.github.com/repos/jacquev6/PyGithub/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jacquev6/PyGithub/downloads","issues_url":"https://api.github.com/repos/jacquev6/PyGithub/issues{/number}","pulls_url":"https://api.github.com/repos/jacquev6/PyGithub/pulls{/number}","milestones_url":"https://api.github.com/repos/jacquev6/PyGithub/milestones{/number}","notifications_url":"https://api.github.com/repos/jacquev6/PyGithub/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jacquev6/PyGithub/labels{/name}","releases_url":"https://api.github.com/repos/jacquev6/PyGithub/releases{/id}","created_at":"2012-02-25T12:53:47Z","updated_at":"2013-12-16T02:11:29Z","pushed_at":"2013-12-16T02:11:29Z","git_url":"git://github.com/jacquev6/PyGithub.git","ssh_url":"git@github.com:jacquev6/PyGithub.git","clone_url":"https://github.com/jacquev6/PyGithub.git","svn_url":"https://github.com/jacquev6/PyGithub","homepage":"http://jacquev6.github.com/PyGithub","size":8785,"stargazers_count":314,"watchers_count":314,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":88,"mirror_url":null,"open_issues_count":23,"forks":88,"open_issues":23,"watchers":314,"default_branch":"master","master_branch":"master"},"source":{"id":3544490,"name":"PyGithub","full_name":"jacquev6/PyGithub","owner":{"login":"jacquev6","id":327146,"avatar_url":"https://gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https%3A%2F%2Fidenticons.github.com%2Ffadfb5f7088ef66579d198a3c9a4935e.png&r=x","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","url":"https://api.github.com/users/jacquev6","html_url":"https://github.com/jacquev6","followers_url":"https://api.github.com/users/jacquev6/followers","following_url":"https://api.github.com/users/jacquev6/following{/other_user}","gists_url":"https://api.github.com/users/jacquev6/gists{/gist_id}","starred_url":"https://api.github.com/users/jacquev6/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacquev6/subscriptions","organizations_url":"https://api.github.com/users/jacquev6/orgs","repos_url":"https://api.github.com/users/jacquev6/repos","events_url":"https://api.github.com/users/jacquev6/events{/privacy}","received_events_url":"https://api.github.com/users/jacquev6/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jacquev6/PyGithub","description":"Python library implementing the full Github API v3","fork":false,"url":"https://api.github.com/repos/jacquev6/PyGithub","forks_url":"https://api.github.com/repos/jacquev6/PyGithub/forks","keys_url":"https://api.github.com/repos/jacquev6/PyGithub/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jacquev6/PyGithub/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jacquev6/PyGithub/teams","hooks_url":"https://api.github.com/repos/jacquev6/PyGithub/hooks","issue_events_url":"https://api.github.com/repos/jacquev6/PyGithub/issues/events{/number}","events_url":"https://api.github.com/repos/jacquev6/PyGithub/events","assignees_url":"https://api.github.com/repos/jacquev6/PyGithub/assignees{/user}","branches_url":"https://api.github.com/repos/jacquev6/PyGithub/branches{/branch}","tags_url":"https://api.github.com/repos/jacquev6/PyGithub/tags","blobs_url":"https://api.github.com/repos/jacquev6/PyGithub/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jacquev6/PyGithub/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jacquev6/PyGithub/git/refs{/sha}","trees_url":"https://api.github.com/repos/jacquev6/PyGithub/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jacquev6/PyGithub/statuses/{sha}","languages_url":"https://api.github.com/repos/jacquev6/PyGithub/languages","stargazers_url":"https://api.github.com/repos/jacquev6/PyGithub/stargazers","contributors_url":"https://api.github.com/repos/jacquev6/PyGithub/contributors","subscribers_url":"https://api.github.com/repos/jacquev6/PyGithub/subscribers","subscription_url":"https://api.github.com/repos/jacquev6/PyGithub/subscription","commits_url":"https://api.github.com/repos/jacquev6/PyGithub/commits{/sha}","git_commits_url":"https://api.github.com/repos/jacquev6/PyGithub/git/commits{/sha}","comments_url":"https://api.github.com/repos/jacquev6/PyGithub/comments{/number}","issue_comment_url":"https://api.github.com/repos/jacquev6/PyGithub/issues/comments/{number}","contents_url":"https://api.github.com/repos/jacquev6/PyGithub/contents/{+path}","compare_url":"https://api.github.com/repos/jacquev6/PyGithub/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jacquev6/PyGithub/merges","archive_url":"https://api.github.com/repos/jacquev6/PyGithub/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jacquev6/PyGithub/downloads","issues_url":"https://api.github.com/repos/jacquev6/PyGithub/issues{/number}","pulls_url":"https://api.github.com/repos/jacquev6/PyGithub/pulls{/number}","milestones_url":"https://api.github.com/repos/jacquev6/PyGithub/milestones{/number}","notifications_url":"https://api.github.com/repos/jacquev6/PyGithub/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jacquev6/PyGithub/labels{/name}","releases_url":"https://api.github.com/repos/jacquev6/PyGithub/releases{/id}","created_at":"2012-02-25T12:53:47Z","updated_at":"2013-12-16T02:11:29Z","pushed_at":"2013-12-16T02:11:29Z","git_url":"git://github.com/jacquev6/PyGithub.git","ssh_url":"git@github.com:jacquev6/PyGithub.git","clone_url":"https://github.com/jacquev6/PyGithub.git","svn_url":"https://github.com/jacquev6/PyGithub","homepage":"http://jacquev6.github.com/PyGithub","size":8785,"stargazers_count":314,"watchers_count":314,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":88,"mirror_url":null,"open_issues_count":23,"forks":88,"open_issues":23,"watchers":314,"default_branch":"master","master_branch":"master"},"network_count":88,"subscribers_count":2} + +https +GET +api.github.com +None +/repos/farrd/PyGithub/issues/1 +{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +null +200 +[('status', '200 OK'), ('x-ratelimit-remaining', '4766'), ('x-github-media-type', 'github.beta; format=json'), ('x-content-type-options', 'nosniff'), ('access-control-expose-headers', 'ETag, Link, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('x-github-request-id', 'A99159CE:6DAB:78E783D:52AF94DB'), ('access-control-allow-credentials', 'true'), ('vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('content-length', '1621'), ('server', 'GitHub.com'), ('last-modified', 'Mon, 16 Dec 2013 23:51:58 GMT'), ('x-ratelimit-limit', '5000'), ('etag', '"10591bd2c625813e49751bcca25b7c61"'), ('cache-control', 'private, max-age=60, s-maxage=60'), ('date', 'Tue, 17 Dec 2013 00:03:39 GMT'), ('access-control-allow-origin', '*'), ('content-type', 'application/json; charset=utf-8'), ('x-ratelimit-reset', '1387240227')] +{"url":"https://api.github.com/repos/farrd/PyGithub/issues/1","labels_url":"https://api.github.com/repos/farrd/PyGithub/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/farrd/PyGithub/issues/1/comments","events_url":"https://api.github.com/repos/farrd/PyGithub/issues/1/events","html_url":"https://github.com/farrd/PyGithub/issues/1","id":24389294,"number":1,"title":"Test Issue","user":{"login":"farrd","id":1387834,"avatar_url":"https://gravatar.com/avatar/3281acd8cd12337bfba7577736ae663e?d=https%3A%2F%2Fidenticons.github.com%2Fe57fcb2ce01df0e0a8305b6fff8070d8.png&r=x","gravatar_id":"3281acd8cd12337bfba7577736ae663e","url":"https://api.github.com/users/farrd","html_url":"https://github.com/farrd","followers_url":"https://api.github.com/users/farrd/followers","following_url":"https://api.github.com/users/farrd/following{/other_user}","gists_url":"https://api.github.com/users/farrd/gists{/gist_id}","starred_url":"https://api.github.com/users/farrd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/farrd/subscriptions","organizations_url":"https://api.github.com/users/farrd/orgs","repos_url":"https://api.github.com/users/farrd/repos","events_url":"https://api.github.com/users/farrd/events{/privacy}","received_events_url":"https://api.github.com/users/farrd/received_events","type":"User","site_admin":false},"labels":[],"state":"open","assignee":null,"milestone":null,"comments":0,"created_at":"2013-12-16T23:36:11Z","updated_at":"2013-12-16T23:51:58Z","closed_at":null,"pull_request":{"html_url":null,"diff_url":null,"patch_url":null},"body":"","closed_by":null} + diff --git a/github/tests/ReplayData/Issue214.testAssignees.txt b/github/tests/ReplayData/Issue214.testAssignees.txt new file mode 100644 index 00000000..b268ae29 --- /dev/null +++ b/github/tests/ReplayData/Issue214.testAssignees.txt @@ -0,0 +1,22 @@ +https +GET +api.github.com +None +/repos/farrd/PyGithub/assignees/farrd +{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +null +204 +[('status', '204 No Content'), ('x-ratelimit-remaining', '4838'), ('x-github-media-type', 'github.beta; format=json'), ('x-content-type-options', 'nosniff'), ('access-control-expose-headers', 'ETag, Link, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('x-github-request-id', 'A99159CE:043C:7376C18:52AF9217'), ('vary', 'Accept-Encoding'), ('server', 'GitHub.com'), ('x-ratelimit-limit', '5000'), ('access-control-allow-credentials', 'true'), ('date', 'Mon, 16 Dec 2013 23:51:51 GMT'), ('access-control-allow-origin', '*'), ('x-ratelimit-reset', '1387240227')] + + +https +GET +api.github.com +None +/repos/farrd/PyGithub/assignees/fake +{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +null +404 +[('status', '404 Not Found'), ('x-ratelimit-remaining', '4837'), ('x-github-media-type', 'github.beta; format=json'), ('x-content-type-options', 'nosniff'), ('access-control-expose-headers', 'ETag, Link, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('x-github-request-id', 'A99159CE:0438:2A76207:52AF9218'), ('content-length', '76'), ('server', 'GitHub.com'), ('x-ratelimit-limit', '5000'), ('access-control-allow-credentials', 'true'), ('date', 'Mon, 16 Dec 2013 23:51:52 GMT'), ('access-control-allow-origin', '*'), ('content-type', 'application/json; charset=utf-8'), ('x-ratelimit-reset', '1387240227')] +{"message":"Not Found","documentation_url":"http://developer.github.com/v3"} + diff --git a/github/tests/ReplayData/Issue214.testCollaborators.txt b/github/tests/ReplayData/Issue214.testCollaborators.txt new file mode 100644 index 00000000..5880b26a --- /dev/null +++ b/github/tests/ReplayData/Issue214.testCollaborators.txt @@ -0,0 +1,77 @@ +https +GET +api.github.com +None +/repos/farrd/PyGithub/collaborators/farrd +{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +null +204 +[('status', '204 No Content'), ('x-ratelimit-remaining', '4765'), ('x-github-media-type', 'github.beta; format=json'), ('x-content-type-options', 'nosniff'), ('access-control-expose-headers', 'ETag, Link, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('x-github-request-id', 'A99159CE:6DAC:7BF4F10:52AF94DB'), ('vary', 'Accept-Encoding'), ('server', 'GitHub.com'), ('x-ratelimit-limit', '5000'), ('access-control-allow-credentials', 'true'), ('date', 'Tue, 17 Dec 2013 00:03:40 GMT'), ('access-control-allow-origin', '*'), ('x-ratelimit-reset', '1387240227')] + + +https +GET +api.github.com +None +/repos/farrd/PyGithub/collaborators/fake +{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +null +404 +[('status', '404 Not Found'), ('x-ratelimit-remaining', '4764'), ('x-github-media-type', 'github.beta; format=json'), ('x-content-type-options', 'nosniff'), ('access-control-expose-headers', 'ETag, Link, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('x-github-request-id', 'A99159CE:6DAC:7BF4F8B:52AF94DC'), ('content-length', '76'), ('server', 'GitHub.com'), ('x-ratelimit-limit', '5000'), ('access-control-allow-credentials', 'true'), ('date', 'Tue, 17 Dec 2013 00:03:40 GMT'), ('access-control-allow-origin', '*'), ('content-type', 'application/json; charset=utf-8'), ('x-ratelimit-reset', '1387240227')] +{"message":"Not Found","documentation_url":"http://developer.github.com/v3"} + +https +GET +api.github.com +None +/repos/farrd/PyGithub/collaborators/marcmenges +{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +null +404 +[('status', '404 Not Found'), ('x-ratelimit-remaining', '4763'), ('x-github-media-type', 'github.beta; format=json'), ('x-content-type-options', 'nosniff'), ('access-control-expose-headers', 'ETag, Link, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('x-github-request-id', 'A99159CE:6DAA:61929C1:52AF94DC'), ('content-length', '76'), ('server', 'GitHub.com'), ('x-ratelimit-limit', '5000'), ('access-control-allow-credentials', 'true'), ('date', 'Tue, 17 Dec 2013 00:03:40 GMT'), ('access-control-allow-origin', '*'), ('content-type', 'application/json; charset=utf-8'), ('x-ratelimit-reset', '1387240227')] +{"message":"Not Found","documentation_url":"http://developer.github.com/v3"} + +https +PUT +api.github.com +None +/repos/farrd/PyGithub/collaborators/marcmenges +{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +null +204 +[('status', '204 No Content'), ('x-ratelimit-remaining', '4762'), ('x-github-media-type', 'github.beta; format=json'), ('x-content-type-options', 'nosniff'), ('access-control-expose-headers', 'ETag, Link, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('x-github-request-id', 'A99159CE:6DAA:6192A15:52AF94DC'), ('vary', 'Accept-Encoding'), ('server', 'GitHub.com'), ('x-ratelimit-limit', '5000'), ('access-control-allow-credentials', 'true'), ('date', 'Tue, 17 Dec 2013 00:03:41 GMT'), ('access-control-allow-origin', '*'), ('x-ratelimit-reset', '1387240227')] + + +https +GET +api.github.com +None +/repos/farrd/PyGithub/collaborators/marcmenges +{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +null +204 +[('status', '204 No Content'), ('x-ratelimit-remaining', '4761'), ('x-github-media-type', 'github.beta; format=json'), ('x-content-type-options', 'nosniff'), ('access-control-expose-headers', 'ETag, Link, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('x-github-request-id', 'A99159CE:6DAB:78E7BE4:52AF94DD'), ('vary', 'Accept-Encoding'), ('server', 'GitHub.com'), ('x-ratelimit-limit', '5000'), ('access-control-allow-credentials', 'true'), ('date', 'Tue, 17 Dec 2013 00:03:41 GMT'), ('access-control-allow-origin', '*'), ('x-ratelimit-reset', '1387240227')] + + +https +DELETE +api.github.com +None +/repos/farrd/PyGithub/collaborators/marcmenges +{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +null +204 +[('status', '204 No Content'), ('x-ratelimit-remaining', '4760'), ('x-github-media-type', 'github.beta; format=json'), ('x-content-type-options', 'nosniff'), ('access-control-expose-headers', 'ETag, Link, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('x-github-request-id', 'A99159CE:6DAC:7BF51C3:52AF94DD'), ('vary', 'Accept-Encoding'), ('server', 'GitHub.com'), ('x-ratelimit-limit', '5000'), ('access-control-allow-credentials', 'true'), ('date', 'Tue, 17 Dec 2013 00:03:41 GMT'), ('access-control-allow-origin', '*'), ('x-ratelimit-reset', '1387240227')] + + +https +GET +api.github.com +None +/repos/farrd/PyGithub/collaborators/marcmenges +{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +null +404 +[('status', '404 Not Found'), ('x-ratelimit-remaining', '4759'), ('x-github-media-type', 'github.beta; format=json'), ('x-content-type-options', 'nosniff'), ('access-control-expose-headers', 'ETag, Link, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('x-github-request-id', 'A99159CE:6DA9:6920FB1:52AF94DE'), ('content-length', '76'), ('server', 'GitHub.com'), ('x-ratelimit-limit', '5000'), ('access-control-allow-credentials', 'true'), ('date', 'Tue, 17 Dec 2013 00:03:42 GMT'), ('access-control-allow-origin', '*'), ('content-type', 'application/json; charset=utf-8'), ('x-ratelimit-reset', '1387240227')] +{"message":"Not Found","documentation_url":"http://developer.github.com/v3"} + diff --git a/github/tests/ReplayData/Issue214.testCreateIssue.txt b/github/tests/ReplayData/Issue214.testCreateIssue.txt new file mode 100644 index 00000000..8517b3b2 --- /dev/null +++ b/github/tests/ReplayData/Issue214.testCreateIssue.txt @@ -0,0 +1,11 @@ +https +POST +api.github.com +None +/repos/farrd/PyGithub/issues +{'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +{"assignee": "farrd", "title": "Issue created by PyGithub"} +201 +[('status', '201 Created'), ('x-ratelimit-remaining', '4828'), ('x-github-media-type', 'github.beta; format=json'), ('x-content-type-options', 'nosniff'), ('access-control-expose-headers', 'ETag, Link, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('x-github-request-id', 'A99159CE:043B:6651E72:52AF921C'), ('access-control-allow-credentials', 'true'), ('vary', 'Accept, Authorization, Cookie, X-GitHub-OTP'), ('location', 'https://api.github.com/repos/farrd/PyGithub/issues/3'), ('content-length', '2592'), ('server', 'GitHub.com'), ('x-ratelimit-limit', '5000'), ('etag', '"900018f8180df60c18df92fcab23cf23"'), ('cache-control', 'private, max-age=60, s-maxage=60'), ('date', 'Mon, 16 Dec 2013 23:51:56 GMT'), ('access-control-allow-origin', '*'), ('content-type', 'application/json; charset=utf-8'), ('x-ratelimit-reset', '1387240227')] +{"url":"https://api.github.com/repos/farrd/PyGithub/issues/3","labels_url":"https://api.github.com/repos/farrd/PyGithub/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/farrd/PyGithub/issues/3/comments","events_url":"https://api.github.com/repos/farrd/PyGithub/issues/3/events","html_url":"https://github.com/farrd/PyGithub/issues/3","id":24390063,"number":3,"title":"Issue created by PyGithub","user":{"login":"farrd","id":1387834,"avatar_url":"https://gravatar.com/avatar/3281acd8cd12337bfba7577736ae663e?d=https%3A%2F%2Fidenticons.github.com%2Fe57fcb2ce01df0e0a8305b6fff8070d8.png&r=x","gravatar_id":"3281acd8cd12337bfba7577736ae663e","url":"https://api.github.com/users/farrd","html_url":"https://github.com/farrd","followers_url":"https://api.github.com/users/farrd/followers","following_url":"https://api.github.com/users/farrd/following{/other_user}","gists_url":"https://api.github.com/users/farrd/gists{/gist_id}","starred_url":"https://api.github.com/users/farrd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/farrd/subscriptions","organizations_url":"https://api.github.com/users/farrd/orgs","repos_url":"https://api.github.com/users/farrd/repos","events_url":"https://api.github.com/users/farrd/events{/privacy}","received_events_url":"https://api.github.com/users/farrd/received_events","type":"User","site_admin":false},"labels":[],"state":"open","assignee":{"login":"farrd","id":1387834,"avatar_url":"https://gravatar.com/avatar/3281acd8cd12337bfba7577736ae663e?d=https%3A%2F%2Fidenticons.github.com%2Fe57fcb2ce01df0e0a8305b6fff8070d8.png&r=x","gravatar_id":"3281acd8cd12337bfba7577736ae663e","url":"https://api.github.com/users/farrd","html_url":"https://github.com/farrd","followers_url":"https://api.github.com/users/farrd/followers","following_url":"https://api.github.com/users/farrd/following{/other_user}","gists_url":"https://api.github.com/users/farrd/gists{/gist_id}","starred_url":"https://api.github.com/users/farrd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/farrd/subscriptions","organizations_url":"https://api.github.com/users/farrd/orgs","repos_url":"https://api.github.com/users/farrd/repos","events_url":"https://api.github.com/users/farrd/events{/privacy}","received_events_url":"https://api.github.com/users/farrd/received_events","type":"User","site_admin":false},"milestone":null,"comments":0,"created_at":"2013-12-16T23:51:56Z","updated_at":"2013-12-16T23:51:56Z","closed_at":null,"pull_request":{"html_url":null,"diff_url":null,"patch_url":null},"body":null,"closed_by":null} + diff --git a/github/tests/ReplayData/Issue214.testEditIssue.txt b/github/tests/ReplayData/Issue214.testEditIssue.txt new file mode 100644 index 00000000..593004c4 --- /dev/null +++ b/github/tests/ReplayData/Issue214.testEditIssue.txt @@ -0,0 +1,22 @@ +https +PATCH +api.github.com +None +/repos/farrd/PyGithub/issues/1 +{'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +{"assignee": "farrd"} +200 +[('status', '200 OK'), ('x-ratelimit-remaining', '4824'), ('x-github-media-type', 'github.beta; format=json'), ('x-content-type-options', 'nosniff'), ('access-control-expose-headers', 'ETag, Link, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('x-github-request-id', 'A99159CE:043C:7377930:52AF921D'), ('access-control-allow-credentials', 'true'), ('vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('content-length', '2575'), ('server', 'GitHub.com'), ('x-ratelimit-limit', '5000'), ('etag', '"fa6d38417e4f455619cdfe179b7b1e40"'), ('cache-control', 'private, max-age=60, s-maxage=60'), ('date', 'Mon, 16 Dec 2013 23:51:58 GMT'), ('access-control-allow-origin', '*'), ('content-type', 'application/json; charset=utf-8'), ('x-ratelimit-reset', '1387240227')] +{"url":"https://api.github.com/repos/farrd/PyGithub/issues/1","labels_url":"https://api.github.com/repos/farrd/PyGithub/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/farrd/PyGithub/issues/1/comments","events_url":"https://api.github.com/repos/farrd/PyGithub/issues/1/events","html_url":"https://github.com/farrd/PyGithub/issues/1","id":24389294,"number":1,"title":"Test Issue","user":{"login":"farrd","id":1387834,"avatar_url":"https://gravatar.com/avatar/3281acd8cd12337bfba7577736ae663e?d=https%3A%2F%2Fidenticons.github.com%2Fe57fcb2ce01df0e0a8305b6fff8070d8.png&r=x","gravatar_id":"3281acd8cd12337bfba7577736ae663e","url":"https://api.github.com/users/farrd","html_url":"https://github.com/farrd","followers_url":"https://api.github.com/users/farrd/followers","following_url":"https://api.github.com/users/farrd/following{/other_user}","gists_url":"https://api.github.com/users/farrd/gists{/gist_id}","starred_url":"https://api.github.com/users/farrd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/farrd/subscriptions","organizations_url":"https://api.github.com/users/farrd/orgs","repos_url":"https://api.github.com/users/farrd/repos","events_url":"https://api.github.com/users/farrd/events{/privacy}","received_events_url":"https://api.github.com/users/farrd/received_events","type":"User","site_admin":false},"labels":[],"state":"open","assignee":{"login":"farrd","id":1387834,"avatar_url":"https://gravatar.com/avatar/3281acd8cd12337bfba7577736ae663e?d=https%3A%2F%2Fidenticons.github.com%2Fe57fcb2ce01df0e0a8305b6fff8070d8.png&r=x","gravatar_id":"3281acd8cd12337bfba7577736ae663e","url":"https://api.github.com/users/farrd","html_url":"https://github.com/farrd","followers_url":"https://api.github.com/users/farrd/followers","following_url":"https://api.github.com/users/farrd/following{/other_user}","gists_url":"https://api.github.com/users/farrd/gists{/gist_id}","starred_url":"https://api.github.com/users/farrd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/farrd/subscriptions","organizations_url":"https://api.github.com/users/farrd/orgs","repos_url":"https://api.github.com/users/farrd/repos","events_url":"https://api.github.com/users/farrd/events{/privacy}","received_events_url":"https://api.github.com/users/farrd/received_events","type":"User","site_admin":false},"milestone":null,"comments":0,"created_at":"2013-12-16T23:36:11Z","updated_at":"2013-12-16T23:51:58Z","closed_at":null,"pull_request":{"html_url":null,"diff_url":null,"patch_url":null},"body":"","closed_by":null} + +https +PATCH +api.github.com +None +/repos/farrd/PyGithub/issues/1 +{'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +{"assignee": ""} +200 +[('status', '200 OK'), ('x-ratelimit-remaining', '4823'), ('x-github-media-type', 'github.beta; format=json'), ('x-content-type-options', 'nosniff'), ('access-control-expose-headers', 'ETag, Link, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('x-github-request-id', 'A99159CE:043C:7377A01:52AF921E'), ('access-control-allow-credentials', 'true'), ('vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('content-length', '1621'), ('server', 'GitHub.com'), ('x-ratelimit-limit', '5000'), ('etag', '"f6bb6e7859e5f62cdc99f6fc6cbe0c09"'), ('cache-control', 'private, max-age=60, s-maxage=60'), ('date', 'Mon, 16 Dec 2013 23:51:58 GMT'), ('access-control-allow-origin', '*'), ('content-type', 'application/json; charset=utf-8'), ('x-ratelimit-reset', '1387240227')] +{"url":"https://api.github.com/repos/farrd/PyGithub/issues/1","labels_url":"https://api.github.com/repos/farrd/PyGithub/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/farrd/PyGithub/issues/1/comments","events_url":"https://api.github.com/repos/farrd/PyGithub/issues/1/events","html_url":"https://github.com/farrd/PyGithub/issues/1","id":24389294,"number":1,"title":"Test Issue","user":{"login":"farrd","id":1387834,"avatar_url":"https://gravatar.com/avatar/3281acd8cd12337bfba7577736ae663e?d=https%3A%2F%2Fidenticons.github.com%2Fe57fcb2ce01df0e0a8305b6fff8070d8.png&r=x","gravatar_id":"3281acd8cd12337bfba7577736ae663e","url":"https://api.github.com/users/farrd","html_url":"https://github.com/farrd","followers_url":"https://api.github.com/users/farrd/followers","following_url":"https://api.github.com/users/farrd/following{/other_user}","gists_url":"https://api.github.com/users/farrd/gists{/gist_id}","starred_url":"https://api.github.com/users/farrd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/farrd/subscriptions","organizations_url":"https://api.github.com/users/farrd/orgs","repos_url":"https://api.github.com/users/farrd/repos","events_url":"https://api.github.com/users/farrd/events{/privacy}","received_events_url":"https://api.github.com/users/farrd/received_events","type":"User","site_admin":false},"labels":[],"state":"open","assignee":null,"milestone":null,"comments":0,"created_at":"2013-12-16T23:36:11Z","updated_at":"2013-12-16T23:51:58Z","closed_at":null,"pull_request":{"html_url":null,"diff_url":null,"patch_url":null},"body":"","closed_by":null} + diff --git a/github/tests/ReplayData/Issue214.testGetIssues.txt b/github/tests/ReplayData/Issue214.testGetIssues.txt new file mode 100644 index 00000000..e3f86910 --- /dev/null +++ b/github/tests/ReplayData/Issue214.testGetIssues.txt @@ -0,0 +1,11 @@ +https +GET +api.github.com +None +/repos/farrd/PyGithub/issues?assignee=farrd +{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} +null +200 +[('status', '200 OK'), ('x-ratelimit-remaining', '4815'), ('x-github-media-type', 'github.beta; format=json'), ('x-content-type-options', 'nosniff'), ('access-control-expose-headers', 'ETag, Link, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('x-github-request-id', 'A99159CE:2C50:65E63AF:52AF923A'), ('access-control-allow-credentials', 'true'), ('vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('content-length', '5153'), ('server', 'GitHub.com'), ('x-ratelimit-limit', '5000'), ('etag', '"3758de592b6c58f9de00b937c89b4db4"'), ('cache-control', 'private, max-age=60, s-maxage=60'), ('date', 'Mon, 16 Dec 2013 23:52:27 GMT'), ('access-control-allow-origin', '*'), ('content-type', 'application/json; charset=utf-8'), ('x-ratelimit-reset', '1387240227')] +[{"url":"https://api.github.com/repos/farrd/PyGithub/issues/3","labels_url":"https://api.github.com/repos/farrd/PyGithub/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/farrd/PyGithub/issues/3/comments","events_url":"https://api.github.com/repos/farrd/PyGithub/issues/3/events","html_url":"https://github.com/farrd/PyGithub/issues/3","id":24390063,"number":3,"title":"Issue created by PyGithub","user":{"login":"farrd","id":1387834,"avatar_url":"https://gravatar.com/avatar/3281acd8cd12337bfba7577736ae663e?d=https%3A%2F%2Fidenticons.github.com%2Fe57fcb2ce01df0e0a8305b6fff8070d8.png&r=x","gravatar_id":"3281acd8cd12337bfba7577736ae663e","url":"https://api.github.com/users/farrd","html_url":"https://github.com/farrd","followers_url":"https://api.github.com/users/farrd/followers","following_url":"https://api.github.com/users/farrd/following{/other_user}","gists_url":"https://api.github.com/users/farrd/gists{/gist_id}","starred_url":"https://api.github.com/users/farrd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/farrd/subscriptions","organizations_url":"https://api.github.com/users/farrd/orgs","repos_url":"https://api.github.com/users/farrd/repos","events_url":"https://api.github.com/users/farrd/events{/privacy}","received_events_url":"https://api.github.com/users/farrd/received_events","type":"User","site_admin":false},"labels":[],"state":"open","assignee":{"login":"farrd","id":1387834,"avatar_url":"https://gravatar.com/avatar/3281acd8cd12337bfba7577736ae663e?d=https%3A%2F%2Fidenticons.github.com%2Fe57fcb2ce01df0e0a8305b6fff8070d8.png&r=x","gravatar_id":"3281acd8cd12337bfba7577736ae663e","url":"https://api.github.com/users/farrd","html_url":"https://github.com/farrd","followers_url":"https://api.github.com/users/farrd/followers","following_url":"https://api.github.com/users/farrd/following{/other_user}","gists_url":"https://api.github.com/users/farrd/gists{/gist_id}","starred_url":"https://api.github.com/users/farrd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/farrd/subscriptions","organizations_url":"https://api.github.com/users/farrd/orgs","repos_url":"https://api.github.com/users/farrd/repos","events_url":"https://api.github.com/users/farrd/events{/privacy}","received_events_url":"https://api.github.com/users/farrd/received_events","type":"User","site_admin":false},"milestone":null,"comments":0,"created_at":"2013-12-16T23:51:56Z","updated_at":"2013-12-16T23:51:56Z","closed_at":null,"pull_request":{"html_url":null,"diff_url":null,"patch_url":null},"body":null},{"url":"https://api.github.com/repos/farrd/PyGithub/issues/2","labels_url":"https://api.github.com/repos/farrd/PyGithub/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/farrd/PyGithub/issues/2/comments","events_url":"https://api.github.com/repos/farrd/PyGithub/issues/2/events","html_url":"https://github.com/farrd/PyGithub/issues/2","id":24389967,"number":2,"title":"Issue created by PyGithub","user":{"login":"farrd","id":1387834,"avatar_url":"https://gravatar.com/avatar/3281acd8cd12337bfba7577736ae663e?d=https%3A%2F%2Fidenticons.github.com%2Fe57fcb2ce01df0e0a8305b6fff8070d8.png&r=x","gravatar_id":"3281acd8cd12337bfba7577736ae663e","url":"https://api.github.com/users/farrd","html_url":"https://github.com/farrd","followers_url":"https://api.github.com/users/farrd/followers","following_url":"https://api.github.com/users/farrd/following{/other_user}","gists_url":"https://api.github.com/users/farrd/gists{/gist_id}","starred_url":"https://api.github.com/users/farrd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/farrd/subscriptions","organizations_url":"https://api.github.com/users/farrd/orgs","repos_url":"https://api.github.com/users/farrd/repos","events_url":"https://api.github.com/users/farrd/events{/privacy}","received_events_url":"https://api.github.com/users/farrd/received_events","type":"User","site_admin":false},"labels":[],"state":"open","assignee":{"login":"farrd","id":1387834,"avatar_url":"https://gravatar.com/avatar/3281acd8cd12337bfba7577736ae663e?d=https%3A%2F%2Fidenticons.github.com%2Fe57fcb2ce01df0e0a8305b6fff8070d8.png&r=x","gravatar_id":"3281acd8cd12337bfba7577736ae663e","url":"https://api.github.com/users/farrd","html_url":"https://github.com/farrd","followers_url":"https://api.github.com/users/farrd/followers","following_url":"https://api.github.com/users/farrd/following{/other_user}","gists_url":"https://api.github.com/users/farrd/gists{/gist_id}","starred_url":"https://api.github.com/users/farrd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/farrd/subscriptions","organizations_url":"https://api.github.com/users/farrd/orgs","repos_url":"https://api.github.com/users/farrd/repos","events_url":"https://api.github.com/users/farrd/events{/privacy}","received_events_url":"https://api.github.com/users/farrd/received_events","type":"User","site_admin":false},"milestone":null,"comments":0,"created_at":"2013-12-16T23:49:47Z","updated_at":"2013-12-16T23:49:47Z","closed_at":null,"pull_request":{"html_url":null,"diff_url":null,"patch_url":null},"body":null}] + From 031471d6856963b1901089e03464caff10112dda Mon Sep 17 00:00:00 2001 From: David Farr Date: Mon, 16 Dec 2013 17:00:52 -0800 Subject: [PATCH 3/3] meeting coding conventions --- github/tests/Issue214.py | 1 - 1 file changed, 1 deletion(-) diff --git a/github/tests/Issue214.py b/github/tests/Issue214.py index 3dca6228..e1030f50 100644 --- a/github/tests/Issue214.py +++ b/github/tests/Issue214.py @@ -67,4 +67,3 @@ class Issue214(Framework.TestCase): # https://github.com/jacquev6/PyGithub/issu for issue in issues: self.assertEqual(issue.assignee.login, 'farrd') -