From ed2e72e126183c10480c546d8630b23e55ac798f Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Sun, 16 Sep 2012 10:22:21 +0200 Subject: [PATCH 01/62] Enable Travis CI --- .travis.yml | 7 +++++++ ReadMe.md | 5 +++++ python25-requirements.txt | 1 + 3 files changed, 13 insertions(+) create mode 100644 .travis.yml create mode 100644 python25-requirements.txt diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..f1c09ace --- /dev/null +++ b/.travis.yml @@ -0,0 +1,7 @@ +language: python +python: + - "2.7" + - "2.6" + - "2.5" +install: if [ "$(python --version 2>&1)" == "Python 2.5.6" ]; then pip install -r python25-requirements.txt --use-mirrors; fi +script: python test/IntegrationTest.py diff --git a/ReadMe.md b/ReadMe.md index 1fc3eacf..58b9f0fb 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -11,6 +11,11 @@ PyGithub is stable. I will maintain it up to date with the API, and fix bugs if What's new? =========== +[Next version](https://github.com/jacquev6/PyGithub/issues?milestone=13&state=closed) (???, 2012) +----------------------------------------------------------------------------------------------------------- + +* Enable Travis CI + [Version 1.7](https://github.com/jacquev6/PyGithub/issues?milestone=12&state=closed) (September 12th, 2012) ----------------------------------------------------------------------------------------------------------- diff --git a/python25-requirements.txt b/python25-requirements.txt new file mode 100644 index 00000000..7693e645 --- /dev/null +++ b/python25-requirements.txt @@ -0,0 +1 @@ +simplejson From e735e636013c7edca0db59ab993ff2832ba40d9d Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Sun, 16 Sep 2012 10:22:31 +0200 Subject: [PATCH 02/62] Fix tests on Python 2.5 --- test/Exceptions.py | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/test/Exceptions.py b/test/Exceptions.py index 1166993b..e94b4bd8 100644 --- a/test/Exceptions.py +++ b/test/Exceptions.py @@ -12,9 +12,12 @@ # You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see . import github +import sys import Framework +atLeastPython26 = sys.hexversion >= 0x02060000 + # To stay compatible with Python 2.6, we do not use self.assertRaises with only one argument class Exceptions( Framework.TestCase ): def testInvalidInput( self ): @@ -37,7 +40,10 @@ class Exceptions( Framework.TestCase ): "message": "Validation Failed" } ) - self.assertEqual( str( exception ), "422 {u\'message\': u\'Validation Failed\', u\'errors\': [{u\'field\': u\'key\', u\'message\': u\"key is invalid. It must begin with \'ssh-rsa\' or \'ssh-dss\'. Check that you\'re copying the public half of the key\", u\'code\': u\'custom\', u\'resource\': u\'PublicKey\'}]}" ) + if atLeastPython26: + self.assertEqual( str( exception ), "422 {u\'message\': u\'Validation Failed\', u\'errors\': [{u\'field\': u\'key\', u\'message\': u\"key is invalid. It must begin with \'ssh-rsa\' or \'ssh-dss\'. Check that you\'re copying the public half of the key\", u\'code\': u\'custom\', u\'resource\': u\'PublicKey\'}]}" ) + else: + self.assertEqual( str( exception ), "422 {\'message\': \'Validation Failed\', \'errors\': [{\'field\': \'key\', \'message\': \"key is invalid. It must begin with \'ssh-rsa\' or \'ssh-dss\'. Check that you\'re copying the public half of the key\", \'code\': \'custom\', \'resource\': \'PublicKey\'}]}" ) def testUnknownObject( self ): try: @@ -46,7 +52,10 @@ class Exceptions( Framework.TestCase ): except github.GithubException, exception: self.assertEqual( exception.status, 404 ) self.assertEqual( exception.data, { "message": "Not Found" } ) - self.assertEqual( str( exception ), "404 {u'message': u'Not Found'}" ) + if atLeastPython26: + self.assertEqual( str( exception ), "404 {u'message': u'Not Found'}" ) + else: + self.assertEqual( str( exception ), "404 {'message': 'Not Found'}" ) def testUnknownUser( self ): try: @@ -55,7 +64,10 @@ class Exceptions( Framework.TestCase ): except github.GithubException, exception: self.assertEqual( exception.status, 404 ) self.assertEqual( exception.data, { "message": "Not Found" } ) - self.assertEqual( str( exception ), "404 {u'message': u'Not Found'}" ) + if atLeastPython26: + self.assertEqual( str( exception ), "404 {u'message': u'Not Found'}" ) + else: + self.assertEqual( str( exception ), "404 {'message': 'Not Found'}" ) def testBadAuthentication( self ): try: @@ -64,4 +76,7 @@ class Exceptions( Framework.TestCase ): except github.GithubException, exception: self.assertEqual( exception.status, 401 ) self.assertEqual( exception.data, { "message": "Bad credentials" } ) - self.assertEqual( str( exception ), "401 {u'message': u'Bad credentials'}" ) + if atLeastPython26: + self.assertEqual( str( exception ), "401 {u'message': u'Bad credentials'}" ) + else: + self.assertEqual( str( exception ), "401 {'message': 'Bad credentials'}" ) From 442b66c81c2855af4152ab219f9aa454eb6b0b4a Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Sun, 16 Sep 2012 18:46:34 +0200 Subject: [PATCH 03/62] Use the ./setup.py test convention --- .travis.yml | 2 +- setup.py | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index f1c09ace..6e717c33 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,4 +4,4 @@ python: - "2.6" - "2.5" install: if [ "$(python --version 2>&1)" == "Python 2.5.6" ]; then pip install -r python25-requirements.txt --use-mirrors; fi -script: python test/IntegrationTest.py +script: python ./setup.py test diff --git a/setup.py b/setup.py index cb64cbd1..52f1c295 100755 --- a/setup.py +++ b/setup.py @@ -13,9 +13,22 @@ # You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see . -from distutils.core import setup +from distutils.core import setup, Command import textwrap +class TestCommand( Command ): + user_options = [] + + def initialize_options(self): + pass + + def finalize_options(self): + pass + + def run(self): + import sys, subprocess + raise SystemExit( subprocess.call( [ sys.executable, "test/IntegrationTest.py" ] ) ) + setup( name = "PyGithub", version = "1.7", @@ -66,4 +79,5 @@ setup( "Programming Language :: Python", "Topic :: Software Development", ], + cmdclass = { "test": TestCommand }, ) From aadb06753ca2d07bbd6b005dc2535b9c5aac3444 Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Sun, 16 Sep 2012 20:07:33 +0200 Subject: [PATCH 04/62] On the way to publish tests (issue #86) This commit only moves stuff around. Modifications will be done in next commit. --- {test => github/tests}/AuthenticatedUser.py | 0 {test => github/tests}/Authentication.py | 0 {test => github/tests}/Authorization.py | 0 {test => github/tests}/Branch.py | 0 {test => github/tests}/Commit.py | 0 {test => github/tests}/CommitComment.py | 0 {test => github/tests}/CommitStatus.py | 0 {test => github/tests}/ContentFile.py | 0 {test => github/tests}/Download.py | 0 {test => github/tests}/Enterprise.py | 0 {test => github/tests}/Event.py | 0 {test => github/tests}/Exceptions.py | 0 {test => github/tests}/Framework.py | 0 {test => github/tests}/Gist.py | 0 {test => github/tests}/GistComment.py | 0 {test => github/tests}/GitBlob.py | 0 {test => github/tests}/GitCommit.py | 0 {test => github/tests}/GitRef.py | 0 {test => github/tests}/GitTag.py | 0 {test => github/tests}/GitTree.py | 0 {test => github/tests}/Github.py | 0 {test => github/tests}/Hook.py | 0 {test => github/tests}/IntegrationTest.py | 0 {test => github/tests}/Issue.py | 0 {test => github/tests}/Issue33.py | 0 {test => github/tests}/Issue50.py | 0 {test => github/tests}/Issue54.py | 0 {test => github/tests}/Issue80.py | 0 {test => github/tests}/IssueComment.py | 0 {test => github/tests}/IssueEvent.py | 0 {test => github/tests}/Label.py | 0 {test => github/tests}/Markdown.py | 0 {test => github/tests}/Milestone.py | 0 {test => github/tests}/NamedUser.py | 0 {test => github/tests}/Organization.py | 0 {test => github/tests}/PaginatedList.py | 0 {test => github/tests}/PullRequest.py | 0 {test => github/tests}/PullRequestComment.py | 0 {test => github/tests}/PullRequestFile.py | 0 {test => github/tests}/RateLimiting.py | 0 .../tests}/ReplayData/AuthenticatedUser.testAttributes.txt | 0 .../AuthenticatedUser.testCreateAuthorizationWithAllArguments.txt | 0 .../AuthenticatedUser.testCreateAuthorizationWithoutArguments.txt | 0 .../tests}/ReplayData/AuthenticatedUser.testCreateFork.txt | 0 .../tests}/ReplayData/AuthenticatedUser.testCreateGist.txt | 0 .../AuthenticatedUser.testCreateGistWithoutDescription.txt | 0 .../tests}/ReplayData/AuthenticatedUser.testCreateKey.txt | 0 .../tests}/ReplayData/AuthenticatedUser.testCreateRepository.txt | 0 .../AuthenticatedUser.testCreateRepositoryWithAllArguments.txt | 0 .../ReplayData/AuthenticatedUser.testEditWithAllArguments.txt | 0 .../ReplayData/AuthenticatedUser.testEditWithoutArguments.txt | 0 .../tests}/ReplayData/AuthenticatedUser.testEmails.txt | 0 .../tests}/ReplayData/AuthenticatedUser.testFollowing.txt | 0 .../tests}/ReplayData/AuthenticatedUser.testGetAuthorizations.txt | 0 .../tests}/ReplayData/AuthenticatedUser.testGetEvents.txt | 0 .../tests}/ReplayData/AuthenticatedUser.testGetGists.txt | 0 .../tests}/ReplayData/AuthenticatedUser.testGetIssues.txt | 0 .../tests}/ReplayData/AuthenticatedUser.testGetKeys.txt | 0 .../ReplayData/AuthenticatedUser.testGetOrganizationEvents.txt | 0 .../tests}/ReplayData/AuthenticatedUser.testGetOrgs.txt | 0 .../tests}/ReplayData/AuthenticatedUser.testGetRepos.txt | 0 .../ReplayData/AuthenticatedUser.testGetReposWithArguments.txt | 0 .../tests}/ReplayData/AuthenticatedUser.testGetStarredGists.txt | 0 .../tests}/ReplayData/AuthenticatedUser.testStarring.txt | 0 .../tests}/ReplayData/AuthenticatedUser.testSubscriptions.txt | 0 .../tests}/ReplayData/AuthenticatedUser.testWatching.txt | 0 .../tests}/ReplayData/Authentication.testBasicAuthentication.txt | 0 .../tests}/ReplayData/Authentication.testNoAuthentication.txt | 0 .../tests}/ReplayData/Authentication.testOAuthAuthentication.txt | 0 {test => github/tests}/ReplayData/Authorization.setUp.txt | 0 {test => github/tests}/ReplayData/Authorization.testDelete.txt | 0 {test => github/tests}/ReplayData/Authorization.testEdit.txt | 0 {test => github/tests}/ReplayData/Branch.setUp.txt | 0 .../tests}/ReplayData/Branch.testCommitCommentsOnLine.txt | 0 {test => github/tests}/ReplayData/Commit.setUp.txt | 0 {test => github/tests}/ReplayData/Commit.testCreateComment.txt | 0 .../tests}/ReplayData/Commit.testCreateCommentOnFileLine.txt | 0 .../tests}/ReplayData/Commit.testCreateCommentOnFilePosition.txt | 0 .../ReplayData/Commit.testCreateStatusWithAllParameters.txt | 0 .../Commit.testCreateStatusWithoutOptionalParameters.txt | 0 {test => github/tests}/ReplayData/Commit.testGetComments.txt | 0 {test => github/tests}/ReplayData/CommitComment.setUp.txt | 0 {test => github/tests}/ReplayData/CommitComment.testDelete.txt | 0 {test => github/tests}/ReplayData/CommitComment.testEdit.txt | 0 {test => github/tests}/ReplayData/CommitStatus.setUp.txt | 0 {test => github/tests}/ReplayData/ContentFile.setUp.txt | 0 {test => github/tests}/ReplayData/Download.setUp.txt | 0 {test => github/tests}/ReplayData/Download.testDelete.txt | 0 {test => github/tests}/ReplayData/Enterprise.testHttp.txt | 0 {test => github/tests}/ReplayData/Enterprise.testHttps.txt | 0 {test => github/tests}/ReplayData/Enterprise.testLongUrl.txt | 0 {test => github/tests}/ReplayData/Enterprise.testSpecificPort.txt | 0 {test => github/tests}/ReplayData/Event.setUp.txt | 0 .../tests}/ReplayData/Exceptions.testBadAuthentication.txt | 0 {test => github/tests}/ReplayData/Exceptions.testInvalidInput.txt | 0 .../tests}/ReplayData/Exceptions.testUnknownObject.txt | 0 {test => github/tests}/ReplayData/Exceptions.testUnknownUser.txt | 0 {test => github/tests}/ReplayData/Gist.setUp.txt | 0 {test => github/tests}/ReplayData/Gist.testCreateComment.txt | 0 {test => github/tests}/ReplayData/Gist.testDelete.txt | 0 .../tests}/ReplayData/Gist.testEditWithAllParameters.txt | 0 .../tests}/ReplayData/Gist.testEditWithoutParameters.txt | 0 {test => github/tests}/ReplayData/Gist.testFork.txt | 0 {test => github/tests}/ReplayData/Gist.testGetComments.txt | 0 {test => github/tests}/ReplayData/Gist.testStarring.txt | 0 {test => github/tests}/ReplayData/GistComment.setUp.txt | 0 {test => github/tests}/ReplayData/GistComment.testDelete.txt | 0 {test => github/tests}/ReplayData/GistComment.testEdit.txt | 0 {test => github/tests}/ReplayData/GitBlob.setUp.txt | 0 {test => github/tests}/ReplayData/GitCommit.setUp.txt | 0 {test => github/tests}/ReplayData/GitRef.setUp.txt | 0 {test => github/tests}/ReplayData/GitRef.testDelete.txt | 0 {test => github/tests}/ReplayData/GitRef.testEdit.txt | 0 {test => github/tests}/ReplayData/GitRef.testEditWithForce.txt | 0 {test => github/tests}/ReplayData/GitTag.setUp.txt | 0 {test => github/tests}/ReplayData/GitTree.setUp.txt | 0 {test => github/tests}/ReplayData/Github.testGetGists.txt | 0 {test => github/tests}/ReplayData/Github.testGetHooks.txt | 0 .../tests}/ReplayData/Github.testLegacySearchRepos.txt | 0 .../ReplayData/Github.testLegacySearchReposExplicitPagination.txt | 0 .../tests}/ReplayData/Github.testLegacySearchReposPagination.txt | 0 .../ReplayData/Github.testLegacySearchReposWithLanguage.txt | 0 .../tests}/ReplayData/Github.testLegacySearchUserByEmail.txt | 0 .../tests}/ReplayData/Github.testLegacySearchUsers.txt | 0 .../ReplayData/Github.testLegacySearchUsersExplicitPagination.txt | 0 .../tests}/ReplayData/Github.testLegacySearchUsersPagination.txt | 0 {test => github/tests}/ReplayData/Github.testSearchRepos.txt | 0 .../tests}/ReplayData/Github.testSearchUserByEmail.txt | 0 {test => github/tests}/ReplayData/Github.testSearchUsers.txt | 0 {test => github/tests}/ReplayData/Hook.setUp.txt | 0 {test => github/tests}/ReplayData/Hook.testDelete.txt | 0 .../tests}/ReplayData/Hook.testEditWithAllParameters.txt | 0 .../tests}/ReplayData/Hook.testEditWithMinimalParameters.txt | 0 {test => github/tests}/ReplayData/Hook.testTest.txt | 0 {test => github/tests}/ReplayData/Issue.setUp.txt | 0 .../tests}/ReplayData/Issue.testAddAndRemoveLabels.txt | 0 {test => github/tests}/ReplayData/Issue.testCreateComment.txt | 0 .../tests}/ReplayData/Issue.testDeleteAndSetLabels.txt | 0 {test => github/tests}/ReplayData/Issue.testEditResetAssignee.txt | 0 .../tests}/ReplayData/Issue.testEditResetMilestone.txt | 0 .../tests}/ReplayData/Issue.testEditWithAllParameters.txt | 0 .../tests}/ReplayData/Issue.testEditWithoutParameters.txt | 0 {test => github/tests}/ReplayData/Issue.testGetComments.txt | 0 {test => github/tests}/ReplayData/Issue.testGetEvents.txt | 0 {test => github/tests}/ReplayData/Issue.testGetLabels.txt | 0 {test => github/tests}/ReplayData/Issue33.setUp.txt | 0 {test => github/tests}/ReplayData/Issue33.testClosedIssues.txt | 0 {test => github/tests}/ReplayData/Issue33.testOpenIssues.txt | 0 {test => github/tests}/ReplayData/Issue50.setUp.txt | 0 {test => github/tests}/ReplayData/Issue50.testAddLabelToIssue.txt | 0 .../tests}/ReplayData/Issue50.testCreateIssueWithLabel.txt | 0 {test => github/tests}/ReplayData/Issue50.testCreateLabel.txt | 0 .../tests}/ReplayData/Issue50.testGetIssuesWithLabel.txt | 0 {test => github/tests}/ReplayData/Issue50.testGetLabel.txt | 0 {test => github/tests}/ReplayData/Issue50.testGetLabels.txt | 0 {test => github/tests}/ReplayData/Issue50.testIssueGetLabels.txt | 0 .../tests}/ReplayData/Issue50.testRemoveLabelFromIssue.txt | 0 {test => github/tests}/ReplayData/Issue50.testSetIssueLabels.txt | 0 {test => github/tests}/ReplayData/Issue54.setUp.txt | 0 {test => github/tests}/ReplayData/Issue54.testConversion.txt | 0 .../ReplayData/Issue80.testIgnoreHttpsFromGithubEnterprise.txt | 0 .../Issue80.testIgnoreHttpsFromGithubEnterpriseWithPort.txt | 0 {test => github/tests}/ReplayData/IssueComment.setUp.txt | 0 {test => github/tests}/ReplayData/IssueComment.testDelete.txt | 0 {test => github/tests}/ReplayData/IssueComment.testEdit.txt | 0 {test => github/tests}/ReplayData/IssueEvent.setUp.txt | 0 {test => github/tests}/ReplayData/IssueEvent.testAttributes.txt | 0 {test => github/tests}/ReplayData/Label.setUp.txt | 0 {test => github/tests}/ReplayData/Label.testDelete.txt | 0 {test => github/tests}/ReplayData/Label.testEdit.txt | 0 {test => github/tests}/ReplayData/Markdown.setUp.txt | 0 .../ReplayData/Markdown.testRenderGithubFlavoredMarkdown.txt | 0 {test => github/tests}/ReplayData/Markdown.testRenderMarkdown.txt | 0 {test => github/tests}/ReplayData/Milestone.setUp.txt | 0 {test => github/tests}/ReplayData/Milestone.testDelete.txt | 0 .../tests}/ReplayData/Milestone.testEditWithAllParameters.txt | 0 .../tests}/ReplayData/Milestone.testEditWithMinimalParameters.txt | 0 {test => github/tests}/ReplayData/Milestone.testGetLabels.txt | 0 {test => github/tests}/ReplayData/NamedUser.setUp.txt | 0 .../tests}/ReplayData/NamedUser.testAttributesOfOtherUser.txt | 0 {test => github/tests}/ReplayData/NamedUser.testCreateGist.txt | 0 .../ReplayData/NamedUser.testCreateGistWithoutDescription.txt | 0 {test => github/tests}/ReplayData/NamedUser.testGetEvents.txt | 0 {test => github/tests}/ReplayData/NamedUser.testGetFollowers.txt | 0 {test => github/tests}/ReplayData/NamedUser.testGetFollowing.txt | 0 {test => github/tests}/ReplayData/NamedUser.testGetGists.txt | 0 {test => github/tests}/ReplayData/NamedUser.testGetOrgs.txt | 0 .../tests}/ReplayData/NamedUser.testGetPublicEvents.txt | 0 .../tests}/ReplayData/NamedUser.testGetPublicReceivedEvents.txt | 0 .../tests}/ReplayData/NamedUser.testGetReceivedEvents.txt | 0 {test => github/tests}/ReplayData/NamedUser.testGetRepo.txt | 0 {test => github/tests}/ReplayData/NamedUser.testGetRepos.txt | 0 .../tests}/ReplayData/NamedUser.testGetReposWithType.txt | 0 {test => github/tests}/ReplayData/NamedUser.testGetStarred.txt | 0 .../tests}/ReplayData/NamedUser.testGetSubscriptions.txt | 0 {test => github/tests}/ReplayData/NamedUser.testGetWatched.txt | 0 {test => github/tests}/ReplayData/Organization.setUp.txt | 0 {test => github/tests}/ReplayData/Organization.testCreateFork.txt | 0 .../ReplayData/Organization.testCreateRepoWithAllArguments.txt | 0 .../Organization.testCreateRepoWithMinimalArguments.txt | 0 {test => github/tests}/ReplayData/Organization.testCreateTeam.txt | 0 .../ReplayData/Organization.testCreateTeamWithAllArguments.txt | 0 .../tests}/ReplayData/Organization.testEditWithAllArguments.txt | 0 .../tests}/ReplayData/Organization.testEditWithoutArguments.txt | 0 {test => github/tests}/ReplayData/Organization.testGetEvents.txt | 0 {test => github/tests}/ReplayData/Organization.testGetMembers.txt | 0 .../tests}/ReplayData/Organization.testGetPublicMembers.txt | 0 {test => github/tests}/ReplayData/Organization.testGetRepos.txt | 0 .../tests}/ReplayData/Organization.testGetReposWithType.txt | 0 {test => github/tests}/ReplayData/Organization.testGetTeams.txt | 0 {test => github/tests}/ReplayData/Organization.testMembers.txt | 0 .../tests}/ReplayData/Organization.testPublicMembers.txt | 0 {test => github/tests}/ReplayData/PaginatedList.setUp.txt | 0 .../tests}/ReplayData/PaginatedList.testGetFirstPage.txt | 0 .../tests}/ReplayData/PaginatedList.testGetThirdPage.txt | 0 .../ReplayData/PaginatedList.testIntIndexingAfterIteration.txt | 0 .../ReplayData/PaginatedList.testIntIndexingInFirstPage.txt | 0 .../ReplayData/PaginatedList.testIntIndexingInThirdPage.txt | 0 .../tests}/ReplayData/PaginatedList.testInterruptedIteration.txt | 0 .../ReplayData/PaginatedList.testInterruptedIterationInSlice.txt | 0 {test => github/tests}/ReplayData/PaginatedList.testIteration.txt | 0 .../tests}/ReplayData/PaginatedList.testSeveralIterations.txt | 0 .../ReplayData/PaginatedList.testSliceIndexingInFirstPage.txt | 0 .../tests}/ReplayData/PaginatedList.testSliceIndexingUntilEnd.txt | 0 .../ReplayData/PaginatedList.testSliceIndexingUntilFourthPage.txt | 0 {test => github/tests}/ReplayData/PullRequest.setUp.txt | 0 .../tests}/ReplayData/PullRequest.testCreateComment.txt | 0 .../tests}/ReplayData/PullRequest.testCreateIssueComment.txt | 0 .../tests}/ReplayData/PullRequest.testEditWithAllArguments.txt | 0 .../tests}/ReplayData/PullRequest.testEditWithoutArguments.txt | 0 {test => github/tests}/ReplayData/PullRequest.testGetComments.txt | 0 {test => github/tests}/ReplayData/PullRequest.testGetCommits.txt | 0 {test => github/tests}/ReplayData/PullRequest.testGetFiles.txt | 0 .../tests}/ReplayData/PullRequest.testGetIssueComment.txt | 0 .../tests}/ReplayData/PullRequest.testGetIssueComments.txt | 0 {test => github/tests}/ReplayData/PullRequest.testMerge.txt | 0 .../tests}/ReplayData/PullRequest.testMergeWithCommitMessage.txt | 0 {test => github/tests}/ReplayData/PullRequestComment.setUp.txt | 0 .../tests}/ReplayData/PullRequestComment.testDelete.txt | 0 {test => github/tests}/ReplayData/PullRequestComment.testEdit.txt | 0 {test => github/tests}/ReplayData/PullRequestFile.setUp.txt | 0 .../tests}/ReplayData/RateLimiting.testRateLimiting.txt | 0 {test => github/tests}/ReplayData/Repository.setUp.txt | 0 {test => github/tests}/ReplayData/Repository.testAssignees.txt | 0 .../tests}/ReplayData/Repository.testCollaborators.txt | 0 {test => github/tests}/ReplayData/Repository.testCompare.txt | 0 .../ReplayData/Repository.testCreateDownloadWithAllArguments.txt | 0 .../Repository.testCreateDownloadWithMinimalArguments.txt | 0 .../tests}/ReplayData/Repository.testCreateGitBlob.txt | 0 .../tests}/ReplayData/Repository.testCreateGitCommit.txt | 0 .../ReplayData/Repository.testCreateGitCommitWithAllArguments.txt | 0 .../ReplayData/Repository.testCreateGitCommitWithParents.txt | 0 {test => github/tests}/ReplayData/Repository.testCreateGitRef.txt | 0 {test => github/tests}/ReplayData/Repository.testCreateGitTag.txt | 0 .../ReplayData/Repository.testCreateGitTagWithAllArguments.txt | 0 .../tests}/ReplayData/Repository.testCreateGitTree.txt | 0 .../ReplayData/Repository.testCreateGitTreeWithBaseTree.txt | 0 .../tests}/ReplayData/Repository.testCreateGitTreeWithSha.txt | 0 .../ReplayData/Repository.testCreateHookWithAllParameters.txt | 0 .../ReplayData/Repository.testCreateHookWithMinimalParameters.txt | 0 {test => github/tests}/ReplayData/Repository.testCreateIssue.txt | 0 .../ReplayData/Repository.testCreateIssueWithAllArguments.txt | 0 {test => github/tests}/ReplayData/Repository.testCreateKey.txt | 0 {test => github/tests}/ReplayData/Repository.testCreateLabel.txt | 0 .../tests}/ReplayData/Repository.testCreateMilestone.txt | 0 .../Repository.testCreateMilestoneWithMinimalArguments.txt | 0 {test => github/tests}/ReplayData/Repository.testCreatePull.txt | 0 .../tests}/ReplayData/Repository.testCreatePullFromIssue.txt | 0 {test => github/tests}/ReplayData/Repository.testDelete.txt | 0 .../tests}/ReplayData/Repository.testEditWithAllArguments.txt | 0 .../tests}/ReplayData/Repository.testEditWithoutArguments.txt | 0 .../tests}/ReplayData/Repository.testGetArchiveLink.txt | 0 {test => github/tests}/ReplayData/Repository.testGetBranch.txt | 0 {test => github/tests}/ReplayData/Repository.testGetComments.txt | 0 {test => github/tests}/ReplayData/Repository.testGetCommits.txt | 0 .../tests}/ReplayData/Repository.testGetCommitsWithArguments.txt | 0 {test => github/tests}/ReplayData/Repository.testGetContents.txt | 0 .../tests}/ReplayData/Repository.testGetContributors.txt | 0 {test => github/tests}/ReplayData/Repository.testGetDownloads.txt | 0 {test => github/tests}/ReplayData/Repository.testGetEvents.txt | 0 {test => github/tests}/ReplayData/Repository.testGetForks.txt | 0 {test => github/tests}/ReplayData/Repository.testGetGitRefs.txt | 0 .../tests}/ReplayData/Repository.testGetGitTreeWithRecursive.txt | 0 {test => github/tests}/ReplayData/Repository.testGetHooks.txt | 0 {test => github/tests}/ReplayData/Repository.testGetIssues.txt | 0 .../tests}/ReplayData/Repository.testGetIssuesEvents.txt | 0 .../tests}/ReplayData/Repository.testGetIssuesWithArguments.txt | 0 .../tests}/ReplayData/Repository.testGetIssuesWithWildcards.txt | 0 {test => github/tests}/ReplayData/Repository.testGetKeys.txt | 0 {test => github/tests}/ReplayData/Repository.testGetLabel.txt | 0 {test => github/tests}/ReplayData/Repository.testGetLabels.txt | 0 {test => github/tests}/ReplayData/Repository.testGetLanguages.txt | 0 .../tests}/ReplayData/Repository.testGetMilestones.txt | 0 .../ReplayData/Repository.testGetMilestonesWithArguments.txt | 0 .../tests}/ReplayData/Repository.testGetNetworkEvents.txt | 0 {test => github/tests}/ReplayData/Repository.testGetPulls.txt | 0 .../tests}/ReplayData/Repository.testGetPullsWithArguments.txt | 0 .../tests}/ReplayData/Repository.testGetStargazers.txt | 0 .../tests}/ReplayData/Repository.testGetSubscribers.txt | 0 {test => github/tests}/ReplayData/Repository.testGetTeams.txt | 0 {test => github/tests}/ReplayData/Repository.testGetWatchers.txt | 0 .../tests}/ReplayData/Repository.testLegacySearchIssues.txt | 0 .../tests}/ReplayData/Repository.testMergeWithConflict.txt | 0 .../tests}/ReplayData/Repository.testMergeWithMessage.txt | 0 .../tests}/ReplayData/Repository.testMergeWithNothingToDo.txt | 0 .../tests}/ReplayData/Repository.testMergeWithoutMessage.txt | 0 {test => github/tests}/ReplayData/Repository.testSearchIssues.txt | 0 {test => github/tests}/ReplayData/RepositoryKey.setUp.txt | 0 {test => github/tests}/ReplayData/RepositoryKey.testDelete.txt | 0 {test => github/tests}/ReplayData/RepositoryKey.testEdit.txt | 0 .../tests}/ReplayData/RepositoryKey.testEditWithoutParameters.txt | 0 {test => github/tests}/ReplayData/Tag.setUp.txt | 0 {test => github/tests}/ReplayData/Team.setUp.txt | 0 {test => github/tests}/ReplayData/Team.testDelete.txt | 0 .../tests}/ReplayData/Team.testEditWithAllArguments.txt | 0 .../tests}/ReplayData/Team.testEditWithoutArguments.txt | 0 {test => github/tests}/ReplayData/Team.testMembers.txt | 0 {test => github/tests}/ReplayData/Team.testRepos.txt | 0 {test => github/tests}/ReplayData/UserKey.setUp.txt | 0 {test => github/tests}/ReplayData/UserKey.testDelete.txt | 0 .../tests}/ReplayData/UserKey.testEditWithAllArguments.txt | 0 .../tests}/ReplayData/UserKey.testEditWithoutArguments.txt | 0 {test => github/tests}/Repository.py | 0 {test => github/tests}/RepositoryKey.py | 0 {test => github/tests}/Tag.py | 0 {test => github/tests}/Team.py | 0 {test => github/tests}/UserKey.py | 0 327 files changed, 0 insertions(+), 0 deletions(-) rename {test => github/tests}/AuthenticatedUser.py (100%) rename {test => github/tests}/Authentication.py (100%) rename {test => github/tests}/Authorization.py (100%) rename {test => github/tests}/Branch.py (100%) rename {test => github/tests}/Commit.py (100%) rename {test => github/tests}/CommitComment.py (100%) rename {test => github/tests}/CommitStatus.py (100%) rename {test => github/tests}/ContentFile.py (100%) rename {test => github/tests}/Download.py (100%) rename {test => github/tests}/Enterprise.py (100%) rename {test => github/tests}/Event.py (100%) rename {test => github/tests}/Exceptions.py (100%) rename {test => github/tests}/Framework.py (100%) rename {test => github/tests}/Gist.py (100%) rename {test => github/tests}/GistComment.py (100%) rename {test => github/tests}/GitBlob.py (100%) rename {test => github/tests}/GitCommit.py (100%) rename {test => github/tests}/GitRef.py (100%) rename {test => github/tests}/GitTag.py (100%) rename {test => github/tests}/GitTree.py (100%) rename {test => github/tests}/Github.py (100%) rename {test => github/tests}/Hook.py (100%) rename {test => github/tests}/IntegrationTest.py (100%) rename {test => github/tests}/Issue.py (100%) rename {test => github/tests}/Issue33.py (100%) rename {test => github/tests}/Issue50.py (100%) rename {test => github/tests}/Issue54.py (100%) rename {test => github/tests}/Issue80.py (100%) rename {test => github/tests}/IssueComment.py (100%) rename {test => github/tests}/IssueEvent.py (100%) rename {test => github/tests}/Label.py (100%) rename {test => github/tests}/Markdown.py (100%) rename {test => github/tests}/Milestone.py (100%) rename {test => github/tests}/NamedUser.py (100%) rename {test => github/tests}/Organization.py (100%) rename {test => github/tests}/PaginatedList.py (100%) rename {test => github/tests}/PullRequest.py (100%) rename {test => github/tests}/PullRequestComment.py (100%) rename {test => github/tests}/PullRequestFile.py (100%) rename {test => github/tests}/RateLimiting.py (100%) rename {test => github/tests}/ReplayData/AuthenticatedUser.testAttributes.txt (100%) rename {test => github/tests}/ReplayData/AuthenticatedUser.testCreateAuthorizationWithAllArguments.txt (100%) rename {test => github/tests}/ReplayData/AuthenticatedUser.testCreateAuthorizationWithoutArguments.txt (100%) rename {test => github/tests}/ReplayData/AuthenticatedUser.testCreateFork.txt (100%) rename {test => github/tests}/ReplayData/AuthenticatedUser.testCreateGist.txt (100%) rename {test => github/tests}/ReplayData/AuthenticatedUser.testCreateGistWithoutDescription.txt (100%) rename {test => github/tests}/ReplayData/AuthenticatedUser.testCreateKey.txt (100%) rename {test => github/tests}/ReplayData/AuthenticatedUser.testCreateRepository.txt (100%) rename {test => github/tests}/ReplayData/AuthenticatedUser.testCreateRepositoryWithAllArguments.txt (100%) rename {test => github/tests}/ReplayData/AuthenticatedUser.testEditWithAllArguments.txt (100%) rename {test => github/tests}/ReplayData/AuthenticatedUser.testEditWithoutArguments.txt (100%) rename {test => github/tests}/ReplayData/AuthenticatedUser.testEmails.txt (100%) rename {test => github/tests}/ReplayData/AuthenticatedUser.testFollowing.txt (100%) rename {test => github/tests}/ReplayData/AuthenticatedUser.testGetAuthorizations.txt (100%) rename {test => github/tests}/ReplayData/AuthenticatedUser.testGetEvents.txt (100%) rename {test => github/tests}/ReplayData/AuthenticatedUser.testGetGists.txt (100%) rename {test => github/tests}/ReplayData/AuthenticatedUser.testGetIssues.txt (100%) rename {test => github/tests}/ReplayData/AuthenticatedUser.testGetKeys.txt (100%) rename {test => github/tests}/ReplayData/AuthenticatedUser.testGetOrganizationEvents.txt (100%) rename {test => github/tests}/ReplayData/AuthenticatedUser.testGetOrgs.txt (100%) rename {test => github/tests}/ReplayData/AuthenticatedUser.testGetRepos.txt (100%) rename {test => github/tests}/ReplayData/AuthenticatedUser.testGetReposWithArguments.txt (100%) rename {test => github/tests}/ReplayData/AuthenticatedUser.testGetStarredGists.txt (100%) rename {test => github/tests}/ReplayData/AuthenticatedUser.testStarring.txt (100%) rename {test => github/tests}/ReplayData/AuthenticatedUser.testSubscriptions.txt (100%) rename {test => github/tests}/ReplayData/AuthenticatedUser.testWatching.txt (100%) rename {test => github/tests}/ReplayData/Authentication.testBasicAuthentication.txt (100%) rename {test => github/tests}/ReplayData/Authentication.testNoAuthentication.txt (100%) rename {test => github/tests}/ReplayData/Authentication.testOAuthAuthentication.txt (100%) rename {test => github/tests}/ReplayData/Authorization.setUp.txt (100%) rename {test => github/tests}/ReplayData/Authorization.testDelete.txt (100%) rename {test => github/tests}/ReplayData/Authorization.testEdit.txt (100%) rename {test => github/tests}/ReplayData/Branch.setUp.txt (100%) rename {test => github/tests}/ReplayData/Branch.testCommitCommentsOnLine.txt (100%) rename {test => github/tests}/ReplayData/Commit.setUp.txt (100%) rename {test => github/tests}/ReplayData/Commit.testCreateComment.txt (100%) rename {test => github/tests}/ReplayData/Commit.testCreateCommentOnFileLine.txt (100%) rename {test => github/tests}/ReplayData/Commit.testCreateCommentOnFilePosition.txt (100%) rename {test => github/tests}/ReplayData/Commit.testCreateStatusWithAllParameters.txt (100%) rename {test => github/tests}/ReplayData/Commit.testCreateStatusWithoutOptionalParameters.txt (100%) rename {test => github/tests}/ReplayData/Commit.testGetComments.txt (100%) rename {test => github/tests}/ReplayData/CommitComment.setUp.txt (100%) rename {test => github/tests}/ReplayData/CommitComment.testDelete.txt (100%) rename {test => github/tests}/ReplayData/CommitComment.testEdit.txt (100%) rename {test => github/tests}/ReplayData/CommitStatus.setUp.txt (100%) rename {test => github/tests}/ReplayData/ContentFile.setUp.txt (100%) rename {test => github/tests}/ReplayData/Download.setUp.txt (100%) rename {test => github/tests}/ReplayData/Download.testDelete.txt (100%) rename {test => github/tests}/ReplayData/Enterprise.testHttp.txt (100%) rename {test => github/tests}/ReplayData/Enterprise.testHttps.txt (100%) rename {test => github/tests}/ReplayData/Enterprise.testLongUrl.txt (100%) rename {test => github/tests}/ReplayData/Enterprise.testSpecificPort.txt (100%) rename {test => github/tests}/ReplayData/Event.setUp.txt (100%) rename {test => github/tests}/ReplayData/Exceptions.testBadAuthentication.txt (100%) rename {test => github/tests}/ReplayData/Exceptions.testInvalidInput.txt (100%) rename {test => github/tests}/ReplayData/Exceptions.testUnknownObject.txt (100%) rename {test => github/tests}/ReplayData/Exceptions.testUnknownUser.txt (100%) rename {test => github/tests}/ReplayData/Gist.setUp.txt (100%) rename {test => github/tests}/ReplayData/Gist.testCreateComment.txt (100%) rename {test => github/tests}/ReplayData/Gist.testDelete.txt (100%) rename {test => github/tests}/ReplayData/Gist.testEditWithAllParameters.txt (100%) rename {test => github/tests}/ReplayData/Gist.testEditWithoutParameters.txt (100%) rename {test => github/tests}/ReplayData/Gist.testFork.txt (100%) rename {test => github/tests}/ReplayData/Gist.testGetComments.txt (100%) rename {test => github/tests}/ReplayData/Gist.testStarring.txt (100%) rename {test => github/tests}/ReplayData/GistComment.setUp.txt (100%) rename {test => github/tests}/ReplayData/GistComment.testDelete.txt (100%) rename {test => github/tests}/ReplayData/GistComment.testEdit.txt (100%) rename {test => github/tests}/ReplayData/GitBlob.setUp.txt (100%) rename {test => github/tests}/ReplayData/GitCommit.setUp.txt (100%) rename {test => github/tests}/ReplayData/GitRef.setUp.txt (100%) rename {test => github/tests}/ReplayData/GitRef.testDelete.txt (100%) rename {test => github/tests}/ReplayData/GitRef.testEdit.txt (100%) rename {test => github/tests}/ReplayData/GitRef.testEditWithForce.txt (100%) rename {test => github/tests}/ReplayData/GitTag.setUp.txt (100%) rename {test => github/tests}/ReplayData/GitTree.setUp.txt (100%) rename {test => github/tests}/ReplayData/Github.testGetGists.txt (100%) rename {test => github/tests}/ReplayData/Github.testGetHooks.txt (100%) rename {test => github/tests}/ReplayData/Github.testLegacySearchRepos.txt (100%) rename {test => github/tests}/ReplayData/Github.testLegacySearchReposExplicitPagination.txt (100%) rename {test => github/tests}/ReplayData/Github.testLegacySearchReposPagination.txt (100%) rename {test => github/tests}/ReplayData/Github.testLegacySearchReposWithLanguage.txt (100%) rename {test => github/tests}/ReplayData/Github.testLegacySearchUserByEmail.txt (100%) rename {test => github/tests}/ReplayData/Github.testLegacySearchUsers.txt (100%) rename {test => github/tests}/ReplayData/Github.testLegacySearchUsersExplicitPagination.txt (100%) rename {test => github/tests}/ReplayData/Github.testLegacySearchUsersPagination.txt (100%) rename {test => github/tests}/ReplayData/Github.testSearchRepos.txt (100%) rename {test => github/tests}/ReplayData/Github.testSearchUserByEmail.txt (100%) rename {test => github/tests}/ReplayData/Github.testSearchUsers.txt (100%) rename {test => github/tests}/ReplayData/Hook.setUp.txt (100%) rename {test => github/tests}/ReplayData/Hook.testDelete.txt (100%) rename {test => github/tests}/ReplayData/Hook.testEditWithAllParameters.txt (100%) rename {test => github/tests}/ReplayData/Hook.testEditWithMinimalParameters.txt (100%) rename {test => github/tests}/ReplayData/Hook.testTest.txt (100%) rename {test => github/tests}/ReplayData/Issue.setUp.txt (100%) rename {test => github/tests}/ReplayData/Issue.testAddAndRemoveLabels.txt (100%) rename {test => github/tests}/ReplayData/Issue.testCreateComment.txt (100%) rename {test => github/tests}/ReplayData/Issue.testDeleteAndSetLabels.txt (100%) rename {test => github/tests}/ReplayData/Issue.testEditResetAssignee.txt (100%) rename {test => github/tests}/ReplayData/Issue.testEditResetMilestone.txt (100%) rename {test => github/tests}/ReplayData/Issue.testEditWithAllParameters.txt (100%) rename {test => github/tests}/ReplayData/Issue.testEditWithoutParameters.txt (100%) rename {test => github/tests}/ReplayData/Issue.testGetComments.txt (100%) rename {test => github/tests}/ReplayData/Issue.testGetEvents.txt (100%) rename {test => github/tests}/ReplayData/Issue.testGetLabels.txt (100%) rename {test => github/tests}/ReplayData/Issue33.setUp.txt (100%) rename {test => github/tests}/ReplayData/Issue33.testClosedIssues.txt (100%) rename {test => github/tests}/ReplayData/Issue33.testOpenIssues.txt (100%) rename {test => github/tests}/ReplayData/Issue50.setUp.txt (100%) rename {test => github/tests}/ReplayData/Issue50.testAddLabelToIssue.txt (100%) rename {test => github/tests}/ReplayData/Issue50.testCreateIssueWithLabel.txt (100%) rename {test => github/tests}/ReplayData/Issue50.testCreateLabel.txt (100%) rename {test => github/tests}/ReplayData/Issue50.testGetIssuesWithLabel.txt (100%) rename {test => github/tests}/ReplayData/Issue50.testGetLabel.txt (100%) rename {test => github/tests}/ReplayData/Issue50.testGetLabels.txt (100%) rename {test => github/tests}/ReplayData/Issue50.testIssueGetLabels.txt (100%) rename {test => github/tests}/ReplayData/Issue50.testRemoveLabelFromIssue.txt (100%) rename {test => github/tests}/ReplayData/Issue50.testSetIssueLabels.txt (100%) rename {test => github/tests}/ReplayData/Issue54.setUp.txt (100%) rename {test => github/tests}/ReplayData/Issue54.testConversion.txt (100%) rename {test => github/tests}/ReplayData/Issue80.testIgnoreHttpsFromGithubEnterprise.txt (100%) rename {test => github/tests}/ReplayData/Issue80.testIgnoreHttpsFromGithubEnterpriseWithPort.txt (100%) rename {test => github/tests}/ReplayData/IssueComment.setUp.txt (100%) rename {test => github/tests}/ReplayData/IssueComment.testDelete.txt (100%) rename {test => github/tests}/ReplayData/IssueComment.testEdit.txt (100%) rename {test => github/tests}/ReplayData/IssueEvent.setUp.txt (100%) rename {test => github/tests}/ReplayData/IssueEvent.testAttributes.txt (100%) rename {test => github/tests}/ReplayData/Label.setUp.txt (100%) rename {test => github/tests}/ReplayData/Label.testDelete.txt (100%) rename {test => github/tests}/ReplayData/Label.testEdit.txt (100%) rename {test => github/tests}/ReplayData/Markdown.setUp.txt (100%) rename {test => github/tests}/ReplayData/Markdown.testRenderGithubFlavoredMarkdown.txt (100%) rename {test => github/tests}/ReplayData/Markdown.testRenderMarkdown.txt (100%) rename {test => github/tests}/ReplayData/Milestone.setUp.txt (100%) rename {test => github/tests}/ReplayData/Milestone.testDelete.txt (100%) rename {test => github/tests}/ReplayData/Milestone.testEditWithAllParameters.txt (100%) rename {test => github/tests}/ReplayData/Milestone.testEditWithMinimalParameters.txt (100%) rename {test => github/tests}/ReplayData/Milestone.testGetLabels.txt (100%) rename {test => github/tests}/ReplayData/NamedUser.setUp.txt (100%) rename {test => github/tests}/ReplayData/NamedUser.testAttributesOfOtherUser.txt (100%) rename {test => github/tests}/ReplayData/NamedUser.testCreateGist.txt (100%) rename {test => github/tests}/ReplayData/NamedUser.testCreateGistWithoutDescription.txt (100%) rename {test => github/tests}/ReplayData/NamedUser.testGetEvents.txt (100%) rename {test => github/tests}/ReplayData/NamedUser.testGetFollowers.txt (100%) rename {test => github/tests}/ReplayData/NamedUser.testGetFollowing.txt (100%) rename {test => github/tests}/ReplayData/NamedUser.testGetGists.txt (100%) rename {test => github/tests}/ReplayData/NamedUser.testGetOrgs.txt (100%) rename {test => github/tests}/ReplayData/NamedUser.testGetPublicEvents.txt (100%) rename {test => github/tests}/ReplayData/NamedUser.testGetPublicReceivedEvents.txt (100%) rename {test => github/tests}/ReplayData/NamedUser.testGetReceivedEvents.txt (100%) rename {test => github/tests}/ReplayData/NamedUser.testGetRepo.txt (100%) rename {test => github/tests}/ReplayData/NamedUser.testGetRepos.txt (100%) rename {test => github/tests}/ReplayData/NamedUser.testGetReposWithType.txt (100%) rename {test => github/tests}/ReplayData/NamedUser.testGetStarred.txt (100%) rename {test => github/tests}/ReplayData/NamedUser.testGetSubscriptions.txt (100%) rename {test => github/tests}/ReplayData/NamedUser.testGetWatched.txt (100%) rename {test => github/tests}/ReplayData/Organization.setUp.txt (100%) rename {test => github/tests}/ReplayData/Organization.testCreateFork.txt (100%) rename {test => github/tests}/ReplayData/Organization.testCreateRepoWithAllArguments.txt (100%) rename {test => github/tests}/ReplayData/Organization.testCreateRepoWithMinimalArguments.txt (100%) rename {test => github/tests}/ReplayData/Organization.testCreateTeam.txt (100%) rename {test => github/tests}/ReplayData/Organization.testCreateTeamWithAllArguments.txt (100%) rename {test => github/tests}/ReplayData/Organization.testEditWithAllArguments.txt (100%) rename {test => github/tests}/ReplayData/Organization.testEditWithoutArguments.txt (100%) rename {test => github/tests}/ReplayData/Organization.testGetEvents.txt (100%) rename {test => github/tests}/ReplayData/Organization.testGetMembers.txt (100%) rename {test => github/tests}/ReplayData/Organization.testGetPublicMembers.txt (100%) rename {test => github/tests}/ReplayData/Organization.testGetRepos.txt (100%) rename {test => github/tests}/ReplayData/Organization.testGetReposWithType.txt (100%) rename {test => github/tests}/ReplayData/Organization.testGetTeams.txt (100%) rename {test => github/tests}/ReplayData/Organization.testMembers.txt (100%) rename {test => github/tests}/ReplayData/Organization.testPublicMembers.txt (100%) rename {test => github/tests}/ReplayData/PaginatedList.setUp.txt (100%) rename {test => github/tests}/ReplayData/PaginatedList.testGetFirstPage.txt (100%) rename {test => github/tests}/ReplayData/PaginatedList.testGetThirdPage.txt (100%) rename {test => github/tests}/ReplayData/PaginatedList.testIntIndexingAfterIteration.txt (100%) rename {test => github/tests}/ReplayData/PaginatedList.testIntIndexingInFirstPage.txt (100%) rename {test => github/tests}/ReplayData/PaginatedList.testIntIndexingInThirdPage.txt (100%) rename {test => github/tests}/ReplayData/PaginatedList.testInterruptedIteration.txt (100%) rename {test => github/tests}/ReplayData/PaginatedList.testInterruptedIterationInSlice.txt (100%) rename {test => github/tests}/ReplayData/PaginatedList.testIteration.txt (100%) rename {test => github/tests}/ReplayData/PaginatedList.testSeveralIterations.txt (100%) rename {test => github/tests}/ReplayData/PaginatedList.testSliceIndexingInFirstPage.txt (100%) rename {test => github/tests}/ReplayData/PaginatedList.testSliceIndexingUntilEnd.txt (100%) rename {test => github/tests}/ReplayData/PaginatedList.testSliceIndexingUntilFourthPage.txt (100%) rename {test => github/tests}/ReplayData/PullRequest.setUp.txt (100%) rename {test => github/tests}/ReplayData/PullRequest.testCreateComment.txt (100%) rename {test => github/tests}/ReplayData/PullRequest.testCreateIssueComment.txt (100%) rename {test => github/tests}/ReplayData/PullRequest.testEditWithAllArguments.txt (100%) rename {test => github/tests}/ReplayData/PullRequest.testEditWithoutArguments.txt (100%) rename {test => github/tests}/ReplayData/PullRequest.testGetComments.txt (100%) rename {test => github/tests}/ReplayData/PullRequest.testGetCommits.txt (100%) rename {test => github/tests}/ReplayData/PullRequest.testGetFiles.txt (100%) rename {test => github/tests}/ReplayData/PullRequest.testGetIssueComment.txt (100%) rename {test => github/tests}/ReplayData/PullRequest.testGetIssueComments.txt (100%) rename {test => github/tests}/ReplayData/PullRequest.testMerge.txt (100%) rename {test => github/tests}/ReplayData/PullRequest.testMergeWithCommitMessage.txt (100%) rename {test => github/tests}/ReplayData/PullRequestComment.setUp.txt (100%) rename {test => github/tests}/ReplayData/PullRequestComment.testDelete.txt (100%) rename {test => github/tests}/ReplayData/PullRequestComment.testEdit.txt (100%) rename {test => github/tests}/ReplayData/PullRequestFile.setUp.txt (100%) rename {test => github/tests}/ReplayData/RateLimiting.testRateLimiting.txt (100%) rename {test => github/tests}/ReplayData/Repository.setUp.txt (100%) rename {test => github/tests}/ReplayData/Repository.testAssignees.txt (100%) rename {test => github/tests}/ReplayData/Repository.testCollaborators.txt (100%) rename {test => github/tests}/ReplayData/Repository.testCompare.txt (100%) rename {test => github/tests}/ReplayData/Repository.testCreateDownloadWithAllArguments.txt (100%) rename {test => github/tests}/ReplayData/Repository.testCreateDownloadWithMinimalArguments.txt (100%) rename {test => github/tests}/ReplayData/Repository.testCreateGitBlob.txt (100%) rename {test => github/tests}/ReplayData/Repository.testCreateGitCommit.txt (100%) rename {test => github/tests}/ReplayData/Repository.testCreateGitCommitWithAllArguments.txt (100%) rename {test => github/tests}/ReplayData/Repository.testCreateGitCommitWithParents.txt (100%) rename {test => github/tests}/ReplayData/Repository.testCreateGitRef.txt (100%) rename {test => github/tests}/ReplayData/Repository.testCreateGitTag.txt (100%) rename {test => github/tests}/ReplayData/Repository.testCreateGitTagWithAllArguments.txt (100%) rename {test => github/tests}/ReplayData/Repository.testCreateGitTree.txt (100%) rename {test => github/tests}/ReplayData/Repository.testCreateGitTreeWithBaseTree.txt (100%) rename {test => github/tests}/ReplayData/Repository.testCreateGitTreeWithSha.txt (100%) rename {test => github/tests}/ReplayData/Repository.testCreateHookWithAllParameters.txt (100%) rename {test => github/tests}/ReplayData/Repository.testCreateHookWithMinimalParameters.txt (100%) rename {test => github/tests}/ReplayData/Repository.testCreateIssue.txt (100%) rename {test => github/tests}/ReplayData/Repository.testCreateIssueWithAllArguments.txt (100%) rename {test => github/tests}/ReplayData/Repository.testCreateKey.txt (100%) rename {test => github/tests}/ReplayData/Repository.testCreateLabel.txt (100%) rename {test => github/tests}/ReplayData/Repository.testCreateMilestone.txt (100%) rename {test => github/tests}/ReplayData/Repository.testCreateMilestoneWithMinimalArguments.txt (100%) rename {test => github/tests}/ReplayData/Repository.testCreatePull.txt (100%) rename {test => github/tests}/ReplayData/Repository.testCreatePullFromIssue.txt (100%) rename {test => github/tests}/ReplayData/Repository.testDelete.txt (100%) rename {test => github/tests}/ReplayData/Repository.testEditWithAllArguments.txt (100%) rename {test => github/tests}/ReplayData/Repository.testEditWithoutArguments.txt (100%) rename {test => github/tests}/ReplayData/Repository.testGetArchiveLink.txt (100%) rename {test => github/tests}/ReplayData/Repository.testGetBranch.txt (100%) rename {test => github/tests}/ReplayData/Repository.testGetComments.txt (100%) rename {test => github/tests}/ReplayData/Repository.testGetCommits.txt (100%) rename {test => github/tests}/ReplayData/Repository.testGetCommitsWithArguments.txt (100%) rename {test => github/tests}/ReplayData/Repository.testGetContents.txt (100%) rename {test => github/tests}/ReplayData/Repository.testGetContributors.txt (100%) rename {test => github/tests}/ReplayData/Repository.testGetDownloads.txt (100%) rename {test => github/tests}/ReplayData/Repository.testGetEvents.txt (100%) rename {test => github/tests}/ReplayData/Repository.testGetForks.txt (100%) rename {test => github/tests}/ReplayData/Repository.testGetGitRefs.txt (100%) rename {test => github/tests}/ReplayData/Repository.testGetGitTreeWithRecursive.txt (100%) rename {test => github/tests}/ReplayData/Repository.testGetHooks.txt (100%) rename {test => github/tests}/ReplayData/Repository.testGetIssues.txt (100%) rename {test => github/tests}/ReplayData/Repository.testGetIssuesEvents.txt (100%) rename {test => github/tests}/ReplayData/Repository.testGetIssuesWithArguments.txt (100%) rename {test => github/tests}/ReplayData/Repository.testGetIssuesWithWildcards.txt (100%) rename {test => github/tests}/ReplayData/Repository.testGetKeys.txt (100%) rename {test => github/tests}/ReplayData/Repository.testGetLabel.txt (100%) rename {test => github/tests}/ReplayData/Repository.testGetLabels.txt (100%) rename {test => github/tests}/ReplayData/Repository.testGetLanguages.txt (100%) rename {test => github/tests}/ReplayData/Repository.testGetMilestones.txt (100%) rename {test => github/tests}/ReplayData/Repository.testGetMilestonesWithArguments.txt (100%) rename {test => github/tests}/ReplayData/Repository.testGetNetworkEvents.txt (100%) rename {test => github/tests}/ReplayData/Repository.testGetPulls.txt (100%) rename {test => github/tests}/ReplayData/Repository.testGetPullsWithArguments.txt (100%) rename {test => github/tests}/ReplayData/Repository.testGetStargazers.txt (100%) rename {test => github/tests}/ReplayData/Repository.testGetSubscribers.txt (100%) rename {test => github/tests}/ReplayData/Repository.testGetTeams.txt (100%) rename {test => github/tests}/ReplayData/Repository.testGetWatchers.txt (100%) rename {test => github/tests}/ReplayData/Repository.testLegacySearchIssues.txt (100%) rename {test => github/tests}/ReplayData/Repository.testMergeWithConflict.txt (100%) rename {test => github/tests}/ReplayData/Repository.testMergeWithMessage.txt (100%) rename {test => github/tests}/ReplayData/Repository.testMergeWithNothingToDo.txt (100%) rename {test => github/tests}/ReplayData/Repository.testMergeWithoutMessage.txt (100%) rename {test => github/tests}/ReplayData/Repository.testSearchIssues.txt (100%) rename {test => github/tests}/ReplayData/RepositoryKey.setUp.txt (100%) rename {test => github/tests}/ReplayData/RepositoryKey.testDelete.txt (100%) rename {test => github/tests}/ReplayData/RepositoryKey.testEdit.txt (100%) rename {test => github/tests}/ReplayData/RepositoryKey.testEditWithoutParameters.txt (100%) rename {test => github/tests}/ReplayData/Tag.setUp.txt (100%) rename {test => github/tests}/ReplayData/Team.setUp.txt (100%) rename {test => github/tests}/ReplayData/Team.testDelete.txt (100%) rename {test => github/tests}/ReplayData/Team.testEditWithAllArguments.txt (100%) rename {test => github/tests}/ReplayData/Team.testEditWithoutArguments.txt (100%) rename {test => github/tests}/ReplayData/Team.testMembers.txt (100%) rename {test => github/tests}/ReplayData/Team.testRepos.txt (100%) rename {test => github/tests}/ReplayData/UserKey.setUp.txt (100%) rename {test => github/tests}/ReplayData/UserKey.testDelete.txt (100%) rename {test => github/tests}/ReplayData/UserKey.testEditWithAllArguments.txt (100%) rename {test => github/tests}/ReplayData/UserKey.testEditWithoutArguments.txt (100%) rename {test => github/tests}/Repository.py (100%) rename {test => github/tests}/RepositoryKey.py (100%) rename {test => github/tests}/Tag.py (100%) rename {test => github/tests}/Team.py (100%) rename {test => github/tests}/UserKey.py (100%) diff --git a/test/AuthenticatedUser.py b/github/tests/AuthenticatedUser.py similarity index 100% rename from test/AuthenticatedUser.py rename to github/tests/AuthenticatedUser.py diff --git a/test/Authentication.py b/github/tests/Authentication.py similarity index 100% rename from test/Authentication.py rename to github/tests/Authentication.py diff --git a/test/Authorization.py b/github/tests/Authorization.py similarity index 100% rename from test/Authorization.py rename to github/tests/Authorization.py diff --git a/test/Branch.py b/github/tests/Branch.py similarity index 100% rename from test/Branch.py rename to github/tests/Branch.py diff --git a/test/Commit.py b/github/tests/Commit.py similarity index 100% rename from test/Commit.py rename to github/tests/Commit.py diff --git a/test/CommitComment.py b/github/tests/CommitComment.py similarity index 100% rename from test/CommitComment.py rename to github/tests/CommitComment.py diff --git a/test/CommitStatus.py b/github/tests/CommitStatus.py similarity index 100% rename from test/CommitStatus.py rename to github/tests/CommitStatus.py diff --git a/test/ContentFile.py b/github/tests/ContentFile.py similarity index 100% rename from test/ContentFile.py rename to github/tests/ContentFile.py diff --git a/test/Download.py b/github/tests/Download.py similarity index 100% rename from test/Download.py rename to github/tests/Download.py diff --git a/test/Enterprise.py b/github/tests/Enterprise.py similarity index 100% rename from test/Enterprise.py rename to github/tests/Enterprise.py diff --git a/test/Event.py b/github/tests/Event.py similarity index 100% rename from test/Event.py rename to github/tests/Event.py diff --git a/test/Exceptions.py b/github/tests/Exceptions.py similarity index 100% rename from test/Exceptions.py rename to github/tests/Exceptions.py diff --git a/test/Framework.py b/github/tests/Framework.py similarity index 100% rename from test/Framework.py rename to github/tests/Framework.py diff --git a/test/Gist.py b/github/tests/Gist.py similarity index 100% rename from test/Gist.py rename to github/tests/Gist.py diff --git a/test/GistComment.py b/github/tests/GistComment.py similarity index 100% rename from test/GistComment.py rename to github/tests/GistComment.py diff --git a/test/GitBlob.py b/github/tests/GitBlob.py similarity index 100% rename from test/GitBlob.py rename to github/tests/GitBlob.py diff --git a/test/GitCommit.py b/github/tests/GitCommit.py similarity index 100% rename from test/GitCommit.py rename to github/tests/GitCommit.py diff --git a/test/GitRef.py b/github/tests/GitRef.py similarity index 100% rename from test/GitRef.py rename to github/tests/GitRef.py diff --git a/test/GitTag.py b/github/tests/GitTag.py similarity index 100% rename from test/GitTag.py rename to github/tests/GitTag.py diff --git a/test/GitTree.py b/github/tests/GitTree.py similarity index 100% rename from test/GitTree.py rename to github/tests/GitTree.py diff --git a/test/Github.py b/github/tests/Github.py similarity index 100% rename from test/Github.py rename to github/tests/Github.py diff --git a/test/Hook.py b/github/tests/Hook.py similarity index 100% rename from test/Hook.py rename to github/tests/Hook.py diff --git a/test/IntegrationTest.py b/github/tests/IntegrationTest.py similarity index 100% rename from test/IntegrationTest.py rename to github/tests/IntegrationTest.py diff --git a/test/Issue.py b/github/tests/Issue.py similarity index 100% rename from test/Issue.py rename to github/tests/Issue.py diff --git a/test/Issue33.py b/github/tests/Issue33.py similarity index 100% rename from test/Issue33.py rename to github/tests/Issue33.py diff --git a/test/Issue50.py b/github/tests/Issue50.py similarity index 100% rename from test/Issue50.py rename to github/tests/Issue50.py diff --git a/test/Issue54.py b/github/tests/Issue54.py similarity index 100% rename from test/Issue54.py rename to github/tests/Issue54.py diff --git a/test/Issue80.py b/github/tests/Issue80.py similarity index 100% rename from test/Issue80.py rename to github/tests/Issue80.py diff --git a/test/IssueComment.py b/github/tests/IssueComment.py similarity index 100% rename from test/IssueComment.py rename to github/tests/IssueComment.py diff --git a/test/IssueEvent.py b/github/tests/IssueEvent.py similarity index 100% rename from test/IssueEvent.py rename to github/tests/IssueEvent.py diff --git a/test/Label.py b/github/tests/Label.py similarity index 100% rename from test/Label.py rename to github/tests/Label.py diff --git a/test/Markdown.py b/github/tests/Markdown.py similarity index 100% rename from test/Markdown.py rename to github/tests/Markdown.py diff --git a/test/Milestone.py b/github/tests/Milestone.py similarity index 100% rename from test/Milestone.py rename to github/tests/Milestone.py diff --git a/test/NamedUser.py b/github/tests/NamedUser.py similarity index 100% rename from test/NamedUser.py rename to github/tests/NamedUser.py diff --git a/test/Organization.py b/github/tests/Organization.py similarity index 100% rename from test/Organization.py rename to github/tests/Organization.py diff --git a/test/PaginatedList.py b/github/tests/PaginatedList.py similarity index 100% rename from test/PaginatedList.py rename to github/tests/PaginatedList.py diff --git a/test/PullRequest.py b/github/tests/PullRequest.py similarity index 100% rename from test/PullRequest.py rename to github/tests/PullRequest.py diff --git a/test/PullRequestComment.py b/github/tests/PullRequestComment.py similarity index 100% rename from test/PullRequestComment.py rename to github/tests/PullRequestComment.py diff --git a/test/PullRequestFile.py b/github/tests/PullRequestFile.py similarity index 100% rename from test/PullRequestFile.py rename to github/tests/PullRequestFile.py diff --git a/test/RateLimiting.py b/github/tests/RateLimiting.py similarity index 100% rename from test/RateLimiting.py rename to github/tests/RateLimiting.py diff --git a/test/ReplayData/AuthenticatedUser.testAttributes.txt b/github/tests/ReplayData/AuthenticatedUser.testAttributes.txt similarity index 100% rename from test/ReplayData/AuthenticatedUser.testAttributes.txt rename to github/tests/ReplayData/AuthenticatedUser.testAttributes.txt diff --git a/test/ReplayData/AuthenticatedUser.testCreateAuthorizationWithAllArguments.txt b/github/tests/ReplayData/AuthenticatedUser.testCreateAuthorizationWithAllArguments.txt similarity index 100% rename from test/ReplayData/AuthenticatedUser.testCreateAuthorizationWithAllArguments.txt rename to github/tests/ReplayData/AuthenticatedUser.testCreateAuthorizationWithAllArguments.txt diff --git a/test/ReplayData/AuthenticatedUser.testCreateAuthorizationWithoutArguments.txt b/github/tests/ReplayData/AuthenticatedUser.testCreateAuthorizationWithoutArguments.txt similarity index 100% rename from test/ReplayData/AuthenticatedUser.testCreateAuthorizationWithoutArguments.txt rename to github/tests/ReplayData/AuthenticatedUser.testCreateAuthorizationWithoutArguments.txt diff --git a/test/ReplayData/AuthenticatedUser.testCreateFork.txt b/github/tests/ReplayData/AuthenticatedUser.testCreateFork.txt similarity index 100% rename from test/ReplayData/AuthenticatedUser.testCreateFork.txt rename to github/tests/ReplayData/AuthenticatedUser.testCreateFork.txt diff --git a/test/ReplayData/AuthenticatedUser.testCreateGist.txt b/github/tests/ReplayData/AuthenticatedUser.testCreateGist.txt similarity index 100% rename from test/ReplayData/AuthenticatedUser.testCreateGist.txt rename to github/tests/ReplayData/AuthenticatedUser.testCreateGist.txt diff --git a/test/ReplayData/AuthenticatedUser.testCreateGistWithoutDescription.txt b/github/tests/ReplayData/AuthenticatedUser.testCreateGistWithoutDescription.txt similarity index 100% rename from test/ReplayData/AuthenticatedUser.testCreateGistWithoutDescription.txt rename to github/tests/ReplayData/AuthenticatedUser.testCreateGistWithoutDescription.txt diff --git a/test/ReplayData/AuthenticatedUser.testCreateKey.txt b/github/tests/ReplayData/AuthenticatedUser.testCreateKey.txt similarity index 100% rename from test/ReplayData/AuthenticatedUser.testCreateKey.txt rename to github/tests/ReplayData/AuthenticatedUser.testCreateKey.txt diff --git a/test/ReplayData/AuthenticatedUser.testCreateRepository.txt b/github/tests/ReplayData/AuthenticatedUser.testCreateRepository.txt similarity index 100% rename from test/ReplayData/AuthenticatedUser.testCreateRepository.txt rename to github/tests/ReplayData/AuthenticatedUser.testCreateRepository.txt diff --git a/test/ReplayData/AuthenticatedUser.testCreateRepositoryWithAllArguments.txt b/github/tests/ReplayData/AuthenticatedUser.testCreateRepositoryWithAllArguments.txt similarity index 100% rename from test/ReplayData/AuthenticatedUser.testCreateRepositoryWithAllArguments.txt rename to github/tests/ReplayData/AuthenticatedUser.testCreateRepositoryWithAllArguments.txt diff --git a/test/ReplayData/AuthenticatedUser.testEditWithAllArguments.txt b/github/tests/ReplayData/AuthenticatedUser.testEditWithAllArguments.txt similarity index 100% rename from test/ReplayData/AuthenticatedUser.testEditWithAllArguments.txt rename to github/tests/ReplayData/AuthenticatedUser.testEditWithAllArguments.txt diff --git a/test/ReplayData/AuthenticatedUser.testEditWithoutArguments.txt b/github/tests/ReplayData/AuthenticatedUser.testEditWithoutArguments.txt similarity index 100% rename from test/ReplayData/AuthenticatedUser.testEditWithoutArguments.txt rename to github/tests/ReplayData/AuthenticatedUser.testEditWithoutArguments.txt diff --git a/test/ReplayData/AuthenticatedUser.testEmails.txt b/github/tests/ReplayData/AuthenticatedUser.testEmails.txt similarity index 100% rename from test/ReplayData/AuthenticatedUser.testEmails.txt rename to github/tests/ReplayData/AuthenticatedUser.testEmails.txt diff --git a/test/ReplayData/AuthenticatedUser.testFollowing.txt b/github/tests/ReplayData/AuthenticatedUser.testFollowing.txt similarity index 100% rename from test/ReplayData/AuthenticatedUser.testFollowing.txt rename to github/tests/ReplayData/AuthenticatedUser.testFollowing.txt diff --git a/test/ReplayData/AuthenticatedUser.testGetAuthorizations.txt b/github/tests/ReplayData/AuthenticatedUser.testGetAuthorizations.txt similarity index 100% rename from test/ReplayData/AuthenticatedUser.testGetAuthorizations.txt rename to github/tests/ReplayData/AuthenticatedUser.testGetAuthorizations.txt diff --git a/test/ReplayData/AuthenticatedUser.testGetEvents.txt b/github/tests/ReplayData/AuthenticatedUser.testGetEvents.txt similarity index 100% rename from test/ReplayData/AuthenticatedUser.testGetEvents.txt rename to github/tests/ReplayData/AuthenticatedUser.testGetEvents.txt diff --git a/test/ReplayData/AuthenticatedUser.testGetGists.txt b/github/tests/ReplayData/AuthenticatedUser.testGetGists.txt similarity index 100% rename from test/ReplayData/AuthenticatedUser.testGetGists.txt rename to github/tests/ReplayData/AuthenticatedUser.testGetGists.txt diff --git a/test/ReplayData/AuthenticatedUser.testGetIssues.txt b/github/tests/ReplayData/AuthenticatedUser.testGetIssues.txt similarity index 100% rename from test/ReplayData/AuthenticatedUser.testGetIssues.txt rename to github/tests/ReplayData/AuthenticatedUser.testGetIssues.txt diff --git a/test/ReplayData/AuthenticatedUser.testGetKeys.txt b/github/tests/ReplayData/AuthenticatedUser.testGetKeys.txt similarity index 100% rename from test/ReplayData/AuthenticatedUser.testGetKeys.txt rename to github/tests/ReplayData/AuthenticatedUser.testGetKeys.txt diff --git a/test/ReplayData/AuthenticatedUser.testGetOrganizationEvents.txt b/github/tests/ReplayData/AuthenticatedUser.testGetOrganizationEvents.txt similarity index 100% rename from test/ReplayData/AuthenticatedUser.testGetOrganizationEvents.txt rename to github/tests/ReplayData/AuthenticatedUser.testGetOrganizationEvents.txt diff --git a/test/ReplayData/AuthenticatedUser.testGetOrgs.txt b/github/tests/ReplayData/AuthenticatedUser.testGetOrgs.txt similarity index 100% rename from test/ReplayData/AuthenticatedUser.testGetOrgs.txt rename to github/tests/ReplayData/AuthenticatedUser.testGetOrgs.txt diff --git a/test/ReplayData/AuthenticatedUser.testGetRepos.txt b/github/tests/ReplayData/AuthenticatedUser.testGetRepos.txt similarity index 100% rename from test/ReplayData/AuthenticatedUser.testGetRepos.txt rename to github/tests/ReplayData/AuthenticatedUser.testGetRepos.txt diff --git a/test/ReplayData/AuthenticatedUser.testGetReposWithArguments.txt b/github/tests/ReplayData/AuthenticatedUser.testGetReposWithArguments.txt similarity index 100% rename from test/ReplayData/AuthenticatedUser.testGetReposWithArguments.txt rename to github/tests/ReplayData/AuthenticatedUser.testGetReposWithArguments.txt diff --git a/test/ReplayData/AuthenticatedUser.testGetStarredGists.txt b/github/tests/ReplayData/AuthenticatedUser.testGetStarredGists.txt similarity index 100% rename from test/ReplayData/AuthenticatedUser.testGetStarredGists.txt rename to github/tests/ReplayData/AuthenticatedUser.testGetStarredGists.txt diff --git a/test/ReplayData/AuthenticatedUser.testStarring.txt b/github/tests/ReplayData/AuthenticatedUser.testStarring.txt similarity index 100% rename from test/ReplayData/AuthenticatedUser.testStarring.txt rename to github/tests/ReplayData/AuthenticatedUser.testStarring.txt diff --git a/test/ReplayData/AuthenticatedUser.testSubscriptions.txt b/github/tests/ReplayData/AuthenticatedUser.testSubscriptions.txt similarity index 100% rename from test/ReplayData/AuthenticatedUser.testSubscriptions.txt rename to github/tests/ReplayData/AuthenticatedUser.testSubscriptions.txt diff --git a/test/ReplayData/AuthenticatedUser.testWatching.txt b/github/tests/ReplayData/AuthenticatedUser.testWatching.txt similarity index 100% rename from test/ReplayData/AuthenticatedUser.testWatching.txt rename to github/tests/ReplayData/AuthenticatedUser.testWatching.txt diff --git a/test/ReplayData/Authentication.testBasicAuthentication.txt b/github/tests/ReplayData/Authentication.testBasicAuthentication.txt similarity index 100% rename from test/ReplayData/Authentication.testBasicAuthentication.txt rename to github/tests/ReplayData/Authentication.testBasicAuthentication.txt diff --git a/test/ReplayData/Authentication.testNoAuthentication.txt b/github/tests/ReplayData/Authentication.testNoAuthentication.txt similarity index 100% rename from test/ReplayData/Authentication.testNoAuthentication.txt rename to github/tests/ReplayData/Authentication.testNoAuthentication.txt diff --git a/test/ReplayData/Authentication.testOAuthAuthentication.txt b/github/tests/ReplayData/Authentication.testOAuthAuthentication.txt similarity index 100% rename from test/ReplayData/Authentication.testOAuthAuthentication.txt rename to github/tests/ReplayData/Authentication.testOAuthAuthentication.txt diff --git a/test/ReplayData/Authorization.setUp.txt b/github/tests/ReplayData/Authorization.setUp.txt similarity index 100% rename from test/ReplayData/Authorization.setUp.txt rename to github/tests/ReplayData/Authorization.setUp.txt diff --git a/test/ReplayData/Authorization.testDelete.txt b/github/tests/ReplayData/Authorization.testDelete.txt similarity index 100% rename from test/ReplayData/Authorization.testDelete.txt rename to github/tests/ReplayData/Authorization.testDelete.txt diff --git a/test/ReplayData/Authorization.testEdit.txt b/github/tests/ReplayData/Authorization.testEdit.txt similarity index 100% rename from test/ReplayData/Authorization.testEdit.txt rename to github/tests/ReplayData/Authorization.testEdit.txt diff --git a/test/ReplayData/Branch.setUp.txt b/github/tests/ReplayData/Branch.setUp.txt similarity index 100% rename from test/ReplayData/Branch.setUp.txt rename to github/tests/ReplayData/Branch.setUp.txt diff --git a/test/ReplayData/Branch.testCommitCommentsOnLine.txt b/github/tests/ReplayData/Branch.testCommitCommentsOnLine.txt similarity index 100% rename from test/ReplayData/Branch.testCommitCommentsOnLine.txt rename to github/tests/ReplayData/Branch.testCommitCommentsOnLine.txt diff --git a/test/ReplayData/Commit.setUp.txt b/github/tests/ReplayData/Commit.setUp.txt similarity index 100% rename from test/ReplayData/Commit.setUp.txt rename to github/tests/ReplayData/Commit.setUp.txt diff --git a/test/ReplayData/Commit.testCreateComment.txt b/github/tests/ReplayData/Commit.testCreateComment.txt similarity index 100% rename from test/ReplayData/Commit.testCreateComment.txt rename to github/tests/ReplayData/Commit.testCreateComment.txt diff --git a/test/ReplayData/Commit.testCreateCommentOnFileLine.txt b/github/tests/ReplayData/Commit.testCreateCommentOnFileLine.txt similarity index 100% rename from test/ReplayData/Commit.testCreateCommentOnFileLine.txt rename to github/tests/ReplayData/Commit.testCreateCommentOnFileLine.txt diff --git a/test/ReplayData/Commit.testCreateCommentOnFilePosition.txt b/github/tests/ReplayData/Commit.testCreateCommentOnFilePosition.txt similarity index 100% rename from test/ReplayData/Commit.testCreateCommentOnFilePosition.txt rename to github/tests/ReplayData/Commit.testCreateCommentOnFilePosition.txt diff --git a/test/ReplayData/Commit.testCreateStatusWithAllParameters.txt b/github/tests/ReplayData/Commit.testCreateStatusWithAllParameters.txt similarity index 100% rename from test/ReplayData/Commit.testCreateStatusWithAllParameters.txt rename to github/tests/ReplayData/Commit.testCreateStatusWithAllParameters.txt diff --git a/test/ReplayData/Commit.testCreateStatusWithoutOptionalParameters.txt b/github/tests/ReplayData/Commit.testCreateStatusWithoutOptionalParameters.txt similarity index 100% rename from test/ReplayData/Commit.testCreateStatusWithoutOptionalParameters.txt rename to github/tests/ReplayData/Commit.testCreateStatusWithoutOptionalParameters.txt diff --git a/test/ReplayData/Commit.testGetComments.txt b/github/tests/ReplayData/Commit.testGetComments.txt similarity index 100% rename from test/ReplayData/Commit.testGetComments.txt rename to github/tests/ReplayData/Commit.testGetComments.txt diff --git a/test/ReplayData/CommitComment.setUp.txt b/github/tests/ReplayData/CommitComment.setUp.txt similarity index 100% rename from test/ReplayData/CommitComment.setUp.txt rename to github/tests/ReplayData/CommitComment.setUp.txt diff --git a/test/ReplayData/CommitComment.testDelete.txt b/github/tests/ReplayData/CommitComment.testDelete.txt similarity index 100% rename from test/ReplayData/CommitComment.testDelete.txt rename to github/tests/ReplayData/CommitComment.testDelete.txt diff --git a/test/ReplayData/CommitComment.testEdit.txt b/github/tests/ReplayData/CommitComment.testEdit.txt similarity index 100% rename from test/ReplayData/CommitComment.testEdit.txt rename to github/tests/ReplayData/CommitComment.testEdit.txt diff --git a/test/ReplayData/CommitStatus.setUp.txt b/github/tests/ReplayData/CommitStatus.setUp.txt similarity index 100% rename from test/ReplayData/CommitStatus.setUp.txt rename to github/tests/ReplayData/CommitStatus.setUp.txt diff --git a/test/ReplayData/ContentFile.setUp.txt b/github/tests/ReplayData/ContentFile.setUp.txt similarity index 100% rename from test/ReplayData/ContentFile.setUp.txt rename to github/tests/ReplayData/ContentFile.setUp.txt diff --git a/test/ReplayData/Download.setUp.txt b/github/tests/ReplayData/Download.setUp.txt similarity index 100% rename from test/ReplayData/Download.setUp.txt rename to github/tests/ReplayData/Download.setUp.txt diff --git a/test/ReplayData/Download.testDelete.txt b/github/tests/ReplayData/Download.testDelete.txt similarity index 100% rename from test/ReplayData/Download.testDelete.txt rename to github/tests/ReplayData/Download.testDelete.txt diff --git a/test/ReplayData/Enterprise.testHttp.txt b/github/tests/ReplayData/Enterprise.testHttp.txt similarity index 100% rename from test/ReplayData/Enterprise.testHttp.txt rename to github/tests/ReplayData/Enterprise.testHttp.txt diff --git a/test/ReplayData/Enterprise.testHttps.txt b/github/tests/ReplayData/Enterprise.testHttps.txt similarity index 100% rename from test/ReplayData/Enterprise.testHttps.txt rename to github/tests/ReplayData/Enterprise.testHttps.txt diff --git a/test/ReplayData/Enterprise.testLongUrl.txt b/github/tests/ReplayData/Enterprise.testLongUrl.txt similarity index 100% rename from test/ReplayData/Enterprise.testLongUrl.txt rename to github/tests/ReplayData/Enterprise.testLongUrl.txt diff --git a/test/ReplayData/Enterprise.testSpecificPort.txt b/github/tests/ReplayData/Enterprise.testSpecificPort.txt similarity index 100% rename from test/ReplayData/Enterprise.testSpecificPort.txt rename to github/tests/ReplayData/Enterprise.testSpecificPort.txt diff --git a/test/ReplayData/Event.setUp.txt b/github/tests/ReplayData/Event.setUp.txt similarity index 100% rename from test/ReplayData/Event.setUp.txt rename to github/tests/ReplayData/Event.setUp.txt diff --git a/test/ReplayData/Exceptions.testBadAuthentication.txt b/github/tests/ReplayData/Exceptions.testBadAuthentication.txt similarity index 100% rename from test/ReplayData/Exceptions.testBadAuthentication.txt rename to github/tests/ReplayData/Exceptions.testBadAuthentication.txt diff --git a/test/ReplayData/Exceptions.testInvalidInput.txt b/github/tests/ReplayData/Exceptions.testInvalidInput.txt similarity index 100% rename from test/ReplayData/Exceptions.testInvalidInput.txt rename to github/tests/ReplayData/Exceptions.testInvalidInput.txt diff --git a/test/ReplayData/Exceptions.testUnknownObject.txt b/github/tests/ReplayData/Exceptions.testUnknownObject.txt similarity index 100% rename from test/ReplayData/Exceptions.testUnknownObject.txt rename to github/tests/ReplayData/Exceptions.testUnknownObject.txt diff --git a/test/ReplayData/Exceptions.testUnknownUser.txt b/github/tests/ReplayData/Exceptions.testUnknownUser.txt similarity index 100% rename from test/ReplayData/Exceptions.testUnknownUser.txt rename to github/tests/ReplayData/Exceptions.testUnknownUser.txt diff --git a/test/ReplayData/Gist.setUp.txt b/github/tests/ReplayData/Gist.setUp.txt similarity index 100% rename from test/ReplayData/Gist.setUp.txt rename to github/tests/ReplayData/Gist.setUp.txt diff --git a/test/ReplayData/Gist.testCreateComment.txt b/github/tests/ReplayData/Gist.testCreateComment.txt similarity index 100% rename from test/ReplayData/Gist.testCreateComment.txt rename to github/tests/ReplayData/Gist.testCreateComment.txt diff --git a/test/ReplayData/Gist.testDelete.txt b/github/tests/ReplayData/Gist.testDelete.txt similarity index 100% rename from test/ReplayData/Gist.testDelete.txt rename to github/tests/ReplayData/Gist.testDelete.txt diff --git a/test/ReplayData/Gist.testEditWithAllParameters.txt b/github/tests/ReplayData/Gist.testEditWithAllParameters.txt similarity index 100% rename from test/ReplayData/Gist.testEditWithAllParameters.txt rename to github/tests/ReplayData/Gist.testEditWithAllParameters.txt diff --git a/test/ReplayData/Gist.testEditWithoutParameters.txt b/github/tests/ReplayData/Gist.testEditWithoutParameters.txt similarity index 100% rename from test/ReplayData/Gist.testEditWithoutParameters.txt rename to github/tests/ReplayData/Gist.testEditWithoutParameters.txt diff --git a/test/ReplayData/Gist.testFork.txt b/github/tests/ReplayData/Gist.testFork.txt similarity index 100% rename from test/ReplayData/Gist.testFork.txt rename to github/tests/ReplayData/Gist.testFork.txt diff --git a/test/ReplayData/Gist.testGetComments.txt b/github/tests/ReplayData/Gist.testGetComments.txt similarity index 100% rename from test/ReplayData/Gist.testGetComments.txt rename to github/tests/ReplayData/Gist.testGetComments.txt diff --git a/test/ReplayData/Gist.testStarring.txt b/github/tests/ReplayData/Gist.testStarring.txt similarity index 100% rename from test/ReplayData/Gist.testStarring.txt rename to github/tests/ReplayData/Gist.testStarring.txt diff --git a/test/ReplayData/GistComment.setUp.txt b/github/tests/ReplayData/GistComment.setUp.txt similarity index 100% rename from test/ReplayData/GistComment.setUp.txt rename to github/tests/ReplayData/GistComment.setUp.txt diff --git a/test/ReplayData/GistComment.testDelete.txt b/github/tests/ReplayData/GistComment.testDelete.txt similarity index 100% rename from test/ReplayData/GistComment.testDelete.txt rename to github/tests/ReplayData/GistComment.testDelete.txt diff --git a/test/ReplayData/GistComment.testEdit.txt b/github/tests/ReplayData/GistComment.testEdit.txt similarity index 100% rename from test/ReplayData/GistComment.testEdit.txt rename to github/tests/ReplayData/GistComment.testEdit.txt diff --git a/test/ReplayData/GitBlob.setUp.txt b/github/tests/ReplayData/GitBlob.setUp.txt similarity index 100% rename from test/ReplayData/GitBlob.setUp.txt rename to github/tests/ReplayData/GitBlob.setUp.txt diff --git a/test/ReplayData/GitCommit.setUp.txt b/github/tests/ReplayData/GitCommit.setUp.txt similarity index 100% rename from test/ReplayData/GitCommit.setUp.txt rename to github/tests/ReplayData/GitCommit.setUp.txt diff --git a/test/ReplayData/GitRef.setUp.txt b/github/tests/ReplayData/GitRef.setUp.txt similarity index 100% rename from test/ReplayData/GitRef.setUp.txt rename to github/tests/ReplayData/GitRef.setUp.txt diff --git a/test/ReplayData/GitRef.testDelete.txt b/github/tests/ReplayData/GitRef.testDelete.txt similarity index 100% rename from test/ReplayData/GitRef.testDelete.txt rename to github/tests/ReplayData/GitRef.testDelete.txt diff --git a/test/ReplayData/GitRef.testEdit.txt b/github/tests/ReplayData/GitRef.testEdit.txt similarity index 100% rename from test/ReplayData/GitRef.testEdit.txt rename to github/tests/ReplayData/GitRef.testEdit.txt diff --git a/test/ReplayData/GitRef.testEditWithForce.txt b/github/tests/ReplayData/GitRef.testEditWithForce.txt similarity index 100% rename from test/ReplayData/GitRef.testEditWithForce.txt rename to github/tests/ReplayData/GitRef.testEditWithForce.txt diff --git a/test/ReplayData/GitTag.setUp.txt b/github/tests/ReplayData/GitTag.setUp.txt similarity index 100% rename from test/ReplayData/GitTag.setUp.txt rename to github/tests/ReplayData/GitTag.setUp.txt diff --git a/test/ReplayData/GitTree.setUp.txt b/github/tests/ReplayData/GitTree.setUp.txt similarity index 100% rename from test/ReplayData/GitTree.setUp.txt rename to github/tests/ReplayData/GitTree.setUp.txt diff --git a/test/ReplayData/Github.testGetGists.txt b/github/tests/ReplayData/Github.testGetGists.txt similarity index 100% rename from test/ReplayData/Github.testGetGists.txt rename to github/tests/ReplayData/Github.testGetGists.txt diff --git a/test/ReplayData/Github.testGetHooks.txt b/github/tests/ReplayData/Github.testGetHooks.txt similarity index 100% rename from test/ReplayData/Github.testGetHooks.txt rename to github/tests/ReplayData/Github.testGetHooks.txt diff --git a/test/ReplayData/Github.testLegacySearchRepos.txt b/github/tests/ReplayData/Github.testLegacySearchRepos.txt similarity index 100% rename from test/ReplayData/Github.testLegacySearchRepos.txt rename to github/tests/ReplayData/Github.testLegacySearchRepos.txt diff --git a/test/ReplayData/Github.testLegacySearchReposExplicitPagination.txt b/github/tests/ReplayData/Github.testLegacySearchReposExplicitPagination.txt similarity index 100% rename from test/ReplayData/Github.testLegacySearchReposExplicitPagination.txt rename to github/tests/ReplayData/Github.testLegacySearchReposExplicitPagination.txt diff --git a/test/ReplayData/Github.testLegacySearchReposPagination.txt b/github/tests/ReplayData/Github.testLegacySearchReposPagination.txt similarity index 100% rename from test/ReplayData/Github.testLegacySearchReposPagination.txt rename to github/tests/ReplayData/Github.testLegacySearchReposPagination.txt diff --git a/test/ReplayData/Github.testLegacySearchReposWithLanguage.txt b/github/tests/ReplayData/Github.testLegacySearchReposWithLanguage.txt similarity index 100% rename from test/ReplayData/Github.testLegacySearchReposWithLanguage.txt rename to github/tests/ReplayData/Github.testLegacySearchReposWithLanguage.txt diff --git a/test/ReplayData/Github.testLegacySearchUserByEmail.txt b/github/tests/ReplayData/Github.testLegacySearchUserByEmail.txt similarity index 100% rename from test/ReplayData/Github.testLegacySearchUserByEmail.txt rename to github/tests/ReplayData/Github.testLegacySearchUserByEmail.txt diff --git a/test/ReplayData/Github.testLegacySearchUsers.txt b/github/tests/ReplayData/Github.testLegacySearchUsers.txt similarity index 100% rename from test/ReplayData/Github.testLegacySearchUsers.txt rename to github/tests/ReplayData/Github.testLegacySearchUsers.txt diff --git a/test/ReplayData/Github.testLegacySearchUsersExplicitPagination.txt b/github/tests/ReplayData/Github.testLegacySearchUsersExplicitPagination.txt similarity index 100% rename from test/ReplayData/Github.testLegacySearchUsersExplicitPagination.txt rename to github/tests/ReplayData/Github.testLegacySearchUsersExplicitPagination.txt diff --git a/test/ReplayData/Github.testLegacySearchUsersPagination.txt b/github/tests/ReplayData/Github.testLegacySearchUsersPagination.txt similarity index 100% rename from test/ReplayData/Github.testLegacySearchUsersPagination.txt rename to github/tests/ReplayData/Github.testLegacySearchUsersPagination.txt diff --git a/test/ReplayData/Github.testSearchRepos.txt b/github/tests/ReplayData/Github.testSearchRepos.txt similarity index 100% rename from test/ReplayData/Github.testSearchRepos.txt rename to github/tests/ReplayData/Github.testSearchRepos.txt diff --git a/test/ReplayData/Github.testSearchUserByEmail.txt b/github/tests/ReplayData/Github.testSearchUserByEmail.txt similarity index 100% rename from test/ReplayData/Github.testSearchUserByEmail.txt rename to github/tests/ReplayData/Github.testSearchUserByEmail.txt diff --git a/test/ReplayData/Github.testSearchUsers.txt b/github/tests/ReplayData/Github.testSearchUsers.txt similarity index 100% rename from test/ReplayData/Github.testSearchUsers.txt rename to github/tests/ReplayData/Github.testSearchUsers.txt diff --git a/test/ReplayData/Hook.setUp.txt b/github/tests/ReplayData/Hook.setUp.txt similarity index 100% rename from test/ReplayData/Hook.setUp.txt rename to github/tests/ReplayData/Hook.setUp.txt diff --git a/test/ReplayData/Hook.testDelete.txt b/github/tests/ReplayData/Hook.testDelete.txt similarity index 100% rename from test/ReplayData/Hook.testDelete.txt rename to github/tests/ReplayData/Hook.testDelete.txt diff --git a/test/ReplayData/Hook.testEditWithAllParameters.txt b/github/tests/ReplayData/Hook.testEditWithAllParameters.txt similarity index 100% rename from test/ReplayData/Hook.testEditWithAllParameters.txt rename to github/tests/ReplayData/Hook.testEditWithAllParameters.txt diff --git a/test/ReplayData/Hook.testEditWithMinimalParameters.txt b/github/tests/ReplayData/Hook.testEditWithMinimalParameters.txt similarity index 100% rename from test/ReplayData/Hook.testEditWithMinimalParameters.txt rename to github/tests/ReplayData/Hook.testEditWithMinimalParameters.txt diff --git a/test/ReplayData/Hook.testTest.txt b/github/tests/ReplayData/Hook.testTest.txt similarity index 100% rename from test/ReplayData/Hook.testTest.txt rename to github/tests/ReplayData/Hook.testTest.txt diff --git a/test/ReplayData/Issue.setUp.txt b/github/tests/ReplayData/Issue.setUp.txt similarity index 100% rename from test/ReplayData/Issue.setUp.txt rename to github/tests/ReplayData/Issue.setUp.txt diff --git a/test/ReplayData/Issue.testAddAndRemoveLabels.txt b/github/tests/ReplayData/Issue.testAddAndRemoveLabels.txt similarity index 100% rename from test/ReplayData/Issue.testAddAndRemoveLabels.txt rename to github/tests/ReplayData/Issue.testAddAndRemoveLabels.txt diff --git a/test/ReplayData/Issue.testCreateComment.txt b/github/tests/ReplayData/Issue.testCreateComment.txt similarity index 100% rename from test/ReplayData/Issue.testCreateComment.txt rename to github/tests/ReplayData/Issue.testCreateComment.txt diff --git a/test/ReplayData/Issue.testDeleteAndSetLabels.txt b/github/tests/ReplayData/Issue.testDeleteAndSetLabels.txt similarity index 100% rename from test/ReplayData/Issue.testDeleteAndSetLabels.txt rename to github/tests/ReplayData/Issue.testDeleteAndSetLabels.txt diff --git a/test/ReplayData/Issue.testEditResetAssignee.txt b/github/tests/ReplayData/Issue.testEditResetAssignee.txt similarity index 100% rename from test/ReplayData/Issue.testEditResetAssignee.txt rename to github/tests/ReplayData/Issue.testEditResetAssignee.txt diff --git a/test/ReplayData/Issue.testEditResetMilestone.txt b/github/tests/ReplayData/Issue.testEditResetMilestone.txt similarity index 100% rename from test/ReplayData/Issue.testEditResetMilestone.txt rename to github/tests/ReplayData/Issue.testEditResetMilestone.txt diff --git a/test/ReplayData/Issue.testEditWithAllParameters.txt b/github/tests/ReplayData/Issue.testEditWithAllParameters.txt similarity index 100% rename from test/ReplayData/Issue.testEditWithAllParameters.txt rename to github/tests/ReplayData/Issue.testEditWithAllParameters.txt diff --git a/test/ReplayData/Issue.testEditWithoutParameters.txt b/github/tests/ReplayData/Issue.testEditWithoutParameters.txt similarity index 100% rename from test/ReplayData/Issue.testEditWithoutParameters.txt rename to github/tests/ReplayData/Issue.testEditWithoutParameters.txt diff --git a/test/ReplayData/Issue.testGetComments.txt b/github/tests/ReplayData/Issue.testGetComments.txt similarity index 100% rename from test/ReplayData/Issue.testGetComments.txt rename to github/tests/ReplayData/Issue.testGetComments.txt diff --git a/test/ReplayData/Issue.testGetEvents.txt b/github/tests/ReplayData/Issue.testGetEvents.txt similarity index 100% rename from test/ReplayData/Issue.testGetEvents.txt rename to github/tests/ReplayData/Issue.testGetEvents.txt diff --git a/test/ReplayData/Issue.testGetLabels.txt b/github/tests/ReplayData/Issue.testGetLabels.txt similarity index 100% rename from test/ReplayData/Issue.testGetLabels.txt rename to github/tests/ReplayData/Issue.testGetLabels.txt diff --git a/test/ReplayData/Issue33.setUp.txt b/github/tests/ReplayData/Issue33.setUp.txt similarity index 100% rename from test/ReplayData/Issue33.setUp.txt rename to github/tests/ReplayData/Issue33.setUp.txt diff --git a/test/ReplayData/Issue33.testClosedIssues.txt b/github/tests/ReplayData/Issue33.testClosedIssues.txt similarity index 100% rename from test/ReplayData/Issue33.testClosedIssues.txt rename to github/tests/ReplayData/Issue33.testClosedIssues.txt diff --git a/test/ReplayData/Issue33.testOpenIssues.txt b/github/tests/ReplayData/Issue33.testOpenIssues.txt similarity index 100% rename from test/ReplayData/Issue33.testOpenIssues.txt rename to github/tests/ReplayData/Issue33.testOpenIssues.txt diff --git a/test/ReplayData/Issue50.setUp.txt b/github/tests/ReplayData/Issue50.setUp.txt similarity index 100% rename from test/ReplayData/Issue50.setUp.txt rename to github/tests/ReplayData/Issue50.setUp.txt diff --git a/test/ReplayData/Issue50.testAddLabelToIssue.txt b/github/tests/ReplayData/Issue50.testAddLabelToIssue.txt similarity index 100% rename from test/ReplayData/Issue50.testAddLabelToIssue.txt rename to github/tests/ReplayData/Issue50.testAddLabelToIssue.txt diff --git a/test/ReplayData/Issue50.testCreateIssueWithLabel.txt b/github/tests/ReplayData/Issue50.testCreateIssueWithLabel.txt similarity index 100% rename from test/ReplayData/Issue50.testCreateIssueWithLabel.txt rename to github/tests/ReplayData/Issue50.testCreateIssueWithLabel.txt diff --git a/test/ReplayData/Issue50.testCreateLabel.txt b/github/tests/ReplayData/Issue50.testCreateLabel.txt similarity index 100% rename from test/ReplayData/Issue50.testCreateLabel.txt rename to github/tests/ReplayData/Issue50.testCreateLabel.txt diff --git a/test/ReplayData/Issue50.testGetIssuesWithLabel.txt b/github/tests/ReplayData/Issue50.testGetIssuesWithLabel.txt similarity index 100% rename from test/ReplayData/Issue50.testGetIssuesWithLabel.txt rename to github/tests/ReplayData/Issue50.testGetIssuesWithLabel.txt diff --git a/test/ReplayData/Issue50.testGetLabel.txt b/github/tests/ReplayData/Issue50.testGetLabel.txt similarity index 100% rename from test/ReplayData/Issue50.testGetLabel.txt rename to github/tests/ReplayData/Issue50.testGetLabel.txt diff --git a/test/ReplayData/Issue50.testGetLabels.txt b/github/tests/ReplayData/Issue50.testGetLabels.txt similarity index 100% rename from test/ReplayData/Issue50.testGetLabels.txt rename to github/tests/ReplayData/Issue50.testGetLabels.txt diff --git a/test/ReplayData/Issue50.testIssueGetLabels.txt b/github/tests/ReplayData/Issue50.testIssueGetLabels.txt similarity index 100% rename from test/ReplayData/Issue50.testIssueGetLabels.txt rename to github/tests/ReplayData/Issue50.testIssueGetLabels.txt diff --git a/test/ReplayData/Issue50.testRemoveLabelFromIssue.txt b/github/tests/ReplayData/Issue50.testRemoveLabelFromIssue.txt similarity index 100% rename from test/ReplayData/Issue50.testRemoveLabelFromIssue.txt rename to github/tests/ReplayData/Issue50.testRemoveLabelFromIssue.txt diff --git a/test/ReplayData/Issue50.testSetIssueLabels.txt b/github/tests/ReplayData/Issue50.testSetIssueLabels.txt similarity index 100% rename from test/ReplayData/Issue50.testSetIssueLabels.txt rename to github/tests/ReplayData/Issue50.testSetIssueLabels.txt diff --git a/test/ReplayData/Issue54.setUp.txt b/github/tests/ReplayData/Issue54.setUp.txt similarity index 100% rename from test/ReplayData/Issue54.setUp.txt rename to github/tests/ReplayData/Issue54.setUp.txt diff --git a/test/ReplayData/Issue54.testConversion.txt b/github/tests/ReplayData/Issue54.testConversion.txt similarity index 100% rename from test/ReplayData/Issue54.testConversion.txt rename to github/tests/ReplayData/Issue54.testConversion.txt diff --git a/test/ReplayData/Issue80.testIgnoreHttpsFromGithubEnterprise.txt b/github/tests/ReplayData/Issue80.testIgnoreHttpsFromGithubEnterprise.txt similarity index 100% rename from test/ReplayData/Issue80.testIgnoreHttpsFromGithubEnterprise.txt rename to github/tests/ReplayData/Issue80.testIgnoreHttpsFromGithubEnterprise.txt diff --git a/test/ReplayData/Issue80.testIgnoreHttpsFromGithubEnterpriseWithPort.txt b/github/tests/ReplayData/Issue80.testIgnoreHttpsFromGithubEnterpriseWithPort.txt similarity index 100% rename from test/ReplayData/Issue80.testIgnoreHttpsFromGithubEnterpriseWithPort.txt rename to github/tests/ReplayData/Issue80.testIgnoreHttpsFromGithubEnterpriseWithPort.txt diff --git a/test/ReplayData/IssueComment.setUp.txt b/github/tests/ReplayData/IssueComment.setUp.txt similarity index 100% rename from test/ReplayData/IssueComment.setUp.txt rename to github/tests/ReplayData/IssueComment.setUp.txt diff --git a/test/ReplayData/IssueComment.testDelete.txt b/github/tests/ReplayData/IssueComment.testDelete.txt similarity index 100% rename from test/ReplayData/IssueComment.testDelete.txt rename to github/tests/ReplayData/IssueComment.testDelete.txt diff --git a/test/ReplayData/IssueComment.testEdit.txt b/github/tests/ReplayData/IssueComment.testEdit.txt similarity index 100% rename from test/ReplayData/IssueComment.testEdit.txt rename to github/tests/ReplayData/IssueComment.testEdit.txt diff --git a/test/ReplayData/IssueEvent.setUp.txt b/github/tests/ReplayData/IssueEvent.setUp.txt similarity index 100% rename from test/ReplayData/IssueEvent.setUp.txt rename to github/tests/ReplayData/IssueEvent.setUp.txt diff --git a/test/ReplayData/IssueEvent.testAttributes.txt b/github/tests/ReplayData/IssueEvent.testAttributes.txt similarity index 100% rename from test/ReplayData/IssueEvent.testAttributes.txt rename to github/tests/ReplayData/IssueEvent.testAttributes.txt diff --git a/test/ReplayData/Label.setUp.txt b/github/tests/ReplayData/Label.setUp.txt similarity index 100% rename from test/ReplayData/Label.setUp.txt rename to github/tests/ReplayData/Label.setUp.txt diff --git a/test/ReplayData/Label.testDelete.txt b/github/tests/ReplayData/Label.testDelete.txt similarity index 100% rename from test/ReplayData/Label.testDelete.txt rename to github/tests/ReplayData/Label.testDelete.txt diff --git a/test/ReplayData/Label.testEdit.txt b/github/tests/ReplayData/Label.testEdit.txt similarity index 100% rename from test/ReplayData/Label.testEdit.txt rename to github/tests/ReplayData/Label.testEdit.txt diff --git a/test/ReplayData/Markdown.setUp.txt b/github/tests/ReplayData/Markdown.setUp.txt similarity index 100% rename from test/ReplayData/Markdown.setUp.txt rename to github/tests/ReplayData/Markdown.setUp.txt diff --git a/test/ReplayData/Markdown.testRenderGithubFlavoredMarkdown.txt b/github/tests/ReplayData/Markdown.testRenderGithubFlavoredMarkdown.txt similarity index 100% rename from test/ReplayData/Markdown.testRenderGithubFlavoredMarkdown.txt rename to github/tests/ReplayData/Markdown.testRenderGithubFlavoredMarkdown.txt diff --git a/test/ReplayData/Markdown.testRenderMarkdown.txt b/github/tests/ReplayData/Markdown.testRenderMarkdown.txt similarity index 100% rename from test/ReplayData/Markdown.testRenderMarkdown.txt rename to github/tests/ReplayData/Markdown.testRenderMarkdown.txt diff --git a/test/ReplayData/Milestone.setUp.txt b/github/tests/ReplayData/Milestone.setUp.txt similarity index 100% rename from test/ReplayData/Milestone.setUp.txt rename to github/tests/ReplayData/Milestone.setUp.txt diff --git a/test/ReplayData/Milestone.testDelete.txt b/github/tests/ReplayData/Milestone.testDelete.txt similarity index 100% rename from test/ReplayData/Milestone.testDelete.txt rename to github/tests/ReplayData/Milestone.testDelete.txt diff --git a/test/ReplayData/Milestone.testEditWithAllParameters.txt b/github/tests/ReplayData/Milestone.testEditWithAllParameters.txt similarity index 100% rename from test/ReplayData/Milestone.testEditWithAllParameters.txt rename to github/tests/ReplayData/Milestone.testEditWithAllParameters.txt diff --git a/test/ReplayData/Milestone.testEditWithMinimalParameters.txt b/github/tests/ReplayData/Milestone.testEditWithMinimalParameters.txt similarity index 100% rename from test/ReplayData/Milestone.testEditWithMinimalParameters.txt rename to github/tests/ReplayData/Milestone.testEditWithMinimalParameters.txt diff --git a/test/ReplayData/Milestone.testGetLabels.txt b/github/tests/ReplayData/Milestone.testGetLabels.txt similarity index 100% rename from test/ReplayData/Milestone.testGetLabels.txt rename to github/tests/ReplayData/Milestone.testGetLabels.txt diff --git a/test/ReplayData/NamedUser.setUp.txt b/github/tests/ReplayData/NamedUser.setUp.txt similarity index 100% rename from test/ReplayData/NamedUser.setUp.txt rename to github/tests/ReplayData/NamedUser.setUp.txt diff --git a/test/ReplayData/NamedUser.testAttributesOfOtherUser.txt b/github/tests/ReplayData/NamedUser.testAttributesOfOtherUser.txt similarity index 100% rename from test/ReplayData/NamedUser.testAttributesOfOtherUser.txt rename to github/tests/ReplayData/NamedUser.testAttributesOfOtherUser.txt diff --git a/test/ReplayData/NamedUser.testCreateGist.txt b/github/tests/ReplayData/NamedUser.testCreateGist.txt similarity index 100% rename from test/ReplayData/NamedUser.testCreateGist.txt rename to github/tests/ReplayData/NamedUser.testCreateGist.txt diff --git a/test/ReplayData/NamedUser.testCreateGistWithoutDescription.txt b/github/tests/ReplayData/NamedUser.testCreateGistWithoutDescription.txt similarity index 100% rename from test/ReplayData/NamedUser.testCreateGistWithoutDescription.txt rename to github/tests/ReplayData/NamedUser.testCreateGistWithoutDescription.txt diff --git a/test/ReplayData/NamedUser.testGetEvents.txt b/github/tests/ReplayData/NamedUser.testGetEvents.txt similarity index 100% rename from test/ReplayData/NamedUser.testGetEvents.txt rename to github/tests/ReplayData/NamedUser.testGetEvents.txt diff --git a/test/ReplayData/NamedUser.testGetFollowers.txt b/github/tests/ReplayData/NamedUser.testGetFollowers.txt similarity index 100% rename from test/ReplayData/NamedUser.testGetFollowers.txt rename to github/tests/ReplayData/NamedUser.testGetFollowers.txt diff --git a/test/ReplayData/NamedUser.testGetFollowing.txt b/github/tests/ReplayData/NamedUser.testGetFollowing.txt similarity index 100% rename from test/ReplayData/NamedUser.testGetFollowing.txt rename to github/tests/ReplayData/NamedUser.testGetFollowing.txt diff --git a/test/ReplayData/NamedUser.testGetGists.txt b/github/tests/ReplayData/NamedUser.testGetGists.txt similarity index 100% rename from test/ReplayData/NamedUser.testGetGists.txt rename to github/tests/ReplayData/NamedUser.testGetGists.txt diff --git a/test/ReplayData/NamedUser.testGetOrgs.txt b/github/tests/ReplayData/NamedUser.testGetOrgs.txt similarity index 100% rename from test/ReplayData/NamedUser.testGetOrgs.txt rename to github/tests/ReplayData/NamedUser.testGetOrgs.txt diff --git a/test/ReplayData/NamedUser.testGetPublicEvents.txt b/github/tests/ReplayData/NamedUser.testGetPublicEvents.txt similarity index 100% rename from test/ReplayData/NamedUser.testGetPublicEvents.txt rename to github/tests/ReplayData/NamedUser.testGetPublicEvents.txt diff --git a/test/ReplayData/NamedUser.testGetPublicReceivedEvents.txt b/github/tests/ReplayData/NamedUser.testGetPublicReceivedEvents.txt similarity index 100% rename from test/ReplayData/NamedUser.testGetPublicReceivedEvents.txt rename to github/tests/ReplayData/NamedUser.testGetPublicReceivedEvents.txt diff --git a/test/ReplayData/NamedUser.testGetReceivedEvents.txt b/github/tests/ReplayData/NamedUser.testGetReceivedEvents.txt similarity index 100% rename from test/ReplayData/NamedUser.testGetReceivedEvents.txt rename to github/tests/ReplayData/NamedUser.testGetReceivedEvents.txt diff --git a/test/ReplayData/NamedUser.testGetRepo.txt b/github/tests/ReplayData/NamedUser.testGetRepo.txt similarity index 100% rename from test/ReplayData/NamedUser.testGetRepo.txt rename to github/tests/ReplayData/NamedUser.testGetRepo.txt diff --git a/test/ReplayData/NamedUser.testGetRepos.txt b/github/tests/ReplayData/NamedUser.testGetRepos.txt similarity index 100% rename from test/ReplayData/NamedUser.testGetRepos.txt rename to github/tests/ReplayData/NamedUser.testGetRepos.txt diff --git a/test/ReplayData/NamedUser.testGetReposWithType.txt b/github/tests/ReplayData/NamedUser.testGetReposWithType.txt similarity index 100% rename from test/ReplayData/NamedUser.testGetReposWithType.txt rename to github/tests/ReplayData/NamedUser.testGetReposWithType.txt diff --git a/test/ReplayData/NamedUser.testGetStarred.txt b/github/tests/ReplayData/NamedUser.testGetStarred.txt similarity index 100% rename from test/ReplayData/NamedUser.testGetStarred.txt rename to github/tests/ReplayData/NamedUser.testGetStarred.txt diff --git a/test/ReplayData/NamedUser.testGetSubscriptions.txt b/github/tests/ReplayData/NamedUser.testGetSubscriptions.txt similarity index 100% rename from test/ReplayData/NamedUser.testGetSubscriptions.txt rename to github/tests/ReplayData/NamedUser.testGetSubscriptions.txt diff --git a/test/ReplayData/NamedUser.testGetWatched.txt b/github/tests/ReplayData/NamedUser.testGetWatched.txt similarity index 100% rename from test/ReplayData/NamedUser.testGetWatched.txt rename to github/tests/ReplayData/NamedUser.testGetWatched.txt diff --git a/test/ReplayData/Organization.setUp.txt b/github/tests/ReplayData/Organization.setUp.txt similarity index 100% rename from test/ReplayData/Organization.setUp.txt rename to github/tests/ReplayData/Organization.setUp.txt diff --git a/test/ReplayData/Organization.testCreateFork.txt b/github/tests/ReplayData/Organization.testCreateFork.txt similarity index 100% rename from test/ReplayData/Organization.testCreateFork.txt rename to github/tests/ReplayData/Organization.testCreateFork.txt diff --git a/test/ReplayData/Organization.testCreateRepoWithAllArguments.txt b/github/tests/ReplayData/Organization.testCreateRepoWithAllArguments.txt similarity index 100% rename from test/ReplayData/Organization.testCreateRepoWithAllArguments.txt rename to github/tests/ReplayData/Organization.testCreateRepoWithAllArguments.txt diff --git a/test/ReplayData/Organization.testCreateRepoWithMinimalArguments.txt b/github/tests/ReplayData/Organization.testCreateRepoWithMinimalArguments.txt similarity index 100% rename from test/ReplayData/Organization.testCreateRepoWithMinimalArguments.txt rename to github/tests/ReplayData/Organization.testCreateRepoWithMinimalArguments.txt diff --git a/test/ReplayData/Organization.testCreateTeam.txt b/github/tests/ReplayData/Organization.testCreateTeam.txt similarity index 100% rename from test/ReplayData/Organization.testCreateTeam.txt rename to github/tests/ReplayData/Organization.testCreateTeam.txt diff --git a/test/ReplayData/Organization.testCreateTeamWithAllArguments.txt b/github/tests/ReplayData/Organization.testCreateTeamWithAllArguments.txt similarity index 100% rename from test/ReplayData/Organization.testCreateTeamWithAllArguments.txt rename to github/tests/ReplayData/Organization.testCreateTeamWithAllArguments.txt diff --git a/test/ReplayData/Organization.testEditWithAllArguments.txt b/github/tests/ReplayData/Organization.testEditWithAllArguments.txt similarity index 100% rename from test/ReplayData/Organization.testEditWithAllArguments.txt rename to github/tests/ReplayData/Organization.testEditWithAllArguments.txt diff --git a/test/ReplayData/Organization.testEditWithoutArguments.txt b/github/tests/ReplayData/Organization.testEditWithoutArguments.txt similarity index 100% rename from test/ReplayData/Organization.testEditWithoutArguments.txt rename to github/tests/ReplayData/Organization.testEditWithoutArguments.txt diff --git a/test/ReplayData/Organization.testGetEvents.txt b/github/tests/ReplayData/Organization.testGetEvents.txt similarity index 100% rename from test/ReplayData/Organization.testGetEvents.txt rename to github/tests/ReplayData/Organization.testGetEvents.txt diff --git a/test/ReplayData/Organization.testGetMembers.txt b/github/tests/ReplayData/Organization.testGetMembers.txt similarity index 100% rename from test/ReplayData/Organization.testGetMembers.txt rename to github/tests/ReplayData/Organization.testGetMembers.txt diff --git a/test/ReplayData/Organization.testGetPublicMembers.txt b/github/tests/ReplayData/Organization.testGetPublicMembers.txt similarity index 100% rename from test/ReplayData/Organization.testGetPublicMembers.txt rename to github/tests/ReplayData/Organization.testGetPublicMembers.txt diff --git a/test/ReplayData/Organization.testGetRepos.txt b/github/tests/ReplayData/Organization.testGetRepos.txt similarity index 100% rename from test/ReplayData/Organization.testGetRepos.txt rename to github/tests/ReplayData/Organization.testGetRepos.txt diff --git a/test/ReplayData/Organization.testGetReposWithType.txt b/github/tests/ReplayData/Organization.testGetReposWithType.txt similarity index 100% rename from test/ReplayData/Organization.testGetReposWithType.txt rename to github/tests/ReplayData/Organization.testGetReposWithType.txt diff --git a/test/ReplayData/Organization.testGetTeams.txt b/github/tests/ReplayData/Organization.testGetTeams.txt similarity index 100% rename from test/ReplayData/Organization.testGetTeams.txt rename to github/tests/ReplayData/Organization.testGetTeams.txt diff --git a/test/ReplayData/Organization.testMembers.txt b/github/tests/ReplayData/Organization.testMembers.txt similarity index 100% rename from test/ReplayData/Organization.testMembers.txt rename to github/tests/ReplayData/Organization.testMembers.txt diff --git a/test/ReplayData/Organization.testPublicMembers.txt b/github/tests/ReplayData/Organization.testPublicMembers.txt similarity index 100% rename from test/ReplayData/Organization.testPublicMembers.txt rename to github/tests/ReplayData/Organization.testPublicMembers.txt diff --git a/test/ReplayData/PaginatedList.setUp.txt b/github/tests/ReplayData/PaginatedList.setUp.txt similarity index 100% rename from test/ReplayData/PaginatedList.setUp.txt rename to github/tests/ReplayData/PaginatedList.setUp.txt diff --git a/test/ReplayData/PaginatedList.testGetFirstPage.txt b/github/tests/ReplayData/PaginatedList.testGetFirstPage.txt similarity index 100% rename from test/ReplayData/PaginatedList.testGetFirstPage.txt rename to github/tests/ReplayData/PaginatedList.testGetFirstPage.txt diff --git a/test/ReplayData/PaginatedList.testGetThirdPage.txt b/github/tests/ReplayData/PaginatedList.testGetThirdPage.txt similarity index 100% rename from test/ReplayData/PaginatedList.testGetThirdPage.txt rename to github/tests/ReplayData/PaginatedList.testGetThirdPage.txt diff --git a/test/ReplayData/PaginatedList.testIntIndexingAfterIteration.txt b/github/tests/ReplayData/PaginatedList.testIntIndexingAfterIteration.txt similarity index 100% rename from test/ReplayData/PaginatedList.testIntIndexingAfterIteration.txt rename to github/tests/ReplayData/PaginatedList.testIntIndexingAfterIteration.txt diff --git a/test/ReplayData/PaginatedList.testIntIndexingInFirstPage.txt b/github/tests/ReplayData/PaginatedList.testIntIndexingInFirstPage.txt similarity index 100% rename from test/ReplayData/PaginatedList.testIntIndexingInFirstPage.txt rename to github/tests/ReplayData/PaginatedList.testIntIndexingInFirstPage.txt diff --git a/test/ReplayData/PaginatedList.testIntIndexingInThirdPage.txt b/github/tests/ReplayData/PaginatedList.testIntIndexingInThirdPage.txt similarity index 100% rename from test/ReplayData/PaginatedList.testIntIndexingInThirdPage.txt rename to github/tests/ReplayData/PaginatedList.testIntIndexingInThirdPage.txt diff --git a/test/ReplayData/PaginatedList.testInterruptedIteration.txt b/github/tests/ReplayData/PaginatedList.testInterruptedIteration.txt similarity index 100% rename from test/ReplayData/PaginatedList.testInterruptedIteration.txt rename to github/tests/ReplayData/PaginatedList.testInterruptedIteration.txt diff --git a/test/ReplayData/PaginatedList.testInterruptedIterationInSlice.txt b/github/tests/ReplayData/PaginatedList.testInterruptedIterationInSlice.txt similarity index 100% rename from test/ReplayData/PaginatedList.testInterruptedIterationInSlice.txt rename to github/tests/ReplayData/PaginatedList.testInterruptedIterationInSlice.txt diff --git a/test/ReplayData/PaginatedList.testIteration.txt b/github/tests/ReplayData/PaginatedList.testIteration.txt similarity index 100% rename from test/ReplayData/PaginatedList.testIteration.txt rename to github/tests/ReplayData/PaginatedList.testIteration.txt diff --git a/test/ReplayData/PaginatedList.testSeveralIterations.txt b/github/tests/ReplayData/PaginatedList.testSeveralIterations.txt similarity index 100% rename from test/ReplayData/PaginatedList.testSeveralIterations.txt rename to github/tests/ReplayData/PaginatedList.testSeveralIterations.txt diff --git a/test/ReplayData/PaginatedList.testSliceIndexingInFirstPage.txt b/github/tests/ReplayData/PaginatedList.testSliceIndexingInFirstPage.txt similarity index 100% rename from test/ReplayData/PaginatedList.testSliceIndexingInFirstPage.txt rename to github/tests/ReplayData/PaginatedList.testSliceIndexingInFirstPage.txt diff --git a/test/ReplayData/PaginatedList.testSliceIndexingUntilEnd.txt b/github/tests/ReplayData/PaginatedList.testSliceIndexingUntilEnd.txt similarity index 100% rename from test/ReplayData/PaginatedList.testSliceIndexingUntilEnd.txt rename to github/tests/ReplayData/PaginatedList.testSliceIndexingUntilEnd.txt diff --git a/test/ReplayData/PaginatedList.testSliceIndexingUntilFourthPage.txt b/github/tests/ReplayData/PaginatedList.testSliceIndexingUntilFourthPage.txt similarity index 100% rename from test/ReplayData/PaginatedList.testSliceIndexingUntilFourthPage.txt rename to github/tests/ReplayData/PaginatedList.testSliceIndexingUntilFourthPage.txt diff --git a/test/ReplayData/PullRequest.setUp.txt b/github/tests/ReplayData/PullRequest.setUp.txt similarity index 100% rename from test/ReplayData/PullRequest.setUp.txt rename to github/tests/ReplayData/PullRequest.setUp.txt diff --git a/test/ReplayData/PullRequest.testCreateComment.txt b/github/tests/ReplayData/PullRequest.testCreateComment.txt similarity index 100% rename from test/ReplayData/PullRequest.testCreateComment.txt rename to github/tests/ReplayData/PullRequest.testCreateComment.txt diff --git a/test/ReplayData/PullRequest.testCreateIssueComment.txt b/github/tests/ReplayData/PullRequest.testCreateIssueComment.txt similarity index 100% rename from test/ReplayData/PullRequest.testCreateIssueComment.txt rename to github/tests/ReplayData/PullRequest.testCreateIssueComment.txt diff --git a/test/ReplayData/PullRequest.testEditWithAllArguments.txt b/github/tests/ReplayData/PullRequest.testEditWithAllArguments.txt similarity index 100% rename from test/ReplayData/PullRequest.testEditWithAllArguments.txt rename to github/tests/ReplayData/PullRequest.testEditWithAllArguments.txt diff --git a/test/ReplayData/PullRequest.testEditWithoutArguments.txt b/github/tests/ReplayData/PullRequest.testEditWithoutArguments.txt similarity index 100% rename from test/ReplayData/PullRequest.testEditWithoutArguments.txt rename to github/tests/ReplayData/PullRequest.testEditWithoutArguments.txt diff --git a/test/ReplayData/PullRequest.testGetComments.txt b/github/tests/ReplayData/PullRequest.testGetComments.txt similarity index 100% rename from test/ReplayData/PullRequest.testGetComments.txt rename to github/tests/ReplayData/PullRequest.testGetComments.txt diff --git a/test/ReplayData/PullRequest.testGetCommits.txt b/github/tests/ReplayData/PullRequest.testGetCommits.txt similarity index 100% rename from test/ReplayData/PullRequest.testGetCommits.txt rename to github/tests/ReplayData/PullRequest.testGetCommits.txt diff --git a/test/ReplayData/PullRequest.testGetFiles.txt b/github/tests/ReplayData/PullRequest.testGetFiles.txt similarity index 100% rename from test/ReplayData/PullRequest.testGetFiles.txt rename to github/tests/ReplayData/PullRequest.testGetFiles.txt diff --git a/test/ReplayData/PullRequest.testGetIssueComment.txt b/github/tests/ReplayData/PullRequest.testGetIssueComment.txt similarity index 100% rename from test/ReplayData/PullRequest.testGetIssueComment.txt rename to github/tests/ReplayData/PullRequest.testGetIssueComment.txt diff --git a/test/ReplayData/PullRequest.testGetIssueComments.txt b/github/tests/ReplayData/PullRequest.testGetIssueComments.txt similarity index 100% rename from test/ReplayData/PullRequest.testGetIssueComments.txt rename to github/tests/ReplayData/PullRequest.testGetIssueComments.txt diff --git a/test/ReplayData/PullRequest.testMerge.txt b/github/tests/ReplayData/PullRequest.testMerge.txt similarity index 100% rename from test/ReplayData/PullRequest.testMerge.txt rename to github/tests/ReplayData/PullRequest.testMerge.txt diff --git a/test/ReplayData/PullRequest.testMergeWithCommitMessage.txt b/github/tests/ReplayData/PullRequest.testMergeWithCommitMessage.txt similarity index 100% rename from test/ReplayData/PullRequest.testMergeWithCommitMessage.txt rename to github/tests/ReplayData/PullRequest.testMergeWithCommitMessage.txt diff --git a/test/ReplayData/PullRequestComment.setUp.txt b/github/tests/ReplayData/PullRequestComment.setUp.txt similarity index 100% rename from test/ReplayData/PullRequestComment.setUp.txt rename to github/tests/ReplayData/PullRequestComment.setUp.txt diff --git a/test/ReplayData/PullRequestComment.testDelete.txt b/github/tests/ReplayData/PullRequestComment.testDelete.txt similarity index 100% rename from test/ReplayData/PullRequestComment.testDelete.txt rename to github/tests/ReplayData/PullRequestComment.testDelete.txt diff --git a/test/ReplayData/PullRequestComment.testEdit.txt b/github/tests/ReplayData/PullRequestComment.testEdit.txt similarity index 100% rename from test/ReplayData/PullRequestComment.testEdit.txt rename to github/tests/ReplayData/PullRequestComment.testEdit.txt diff --git a/test/ReplayData/PullRequestFile.setUp.txt b/github/tests/ReplayData/PullRequestFile.setUp.txt similarity index 100% rename from test/ReplayData/PullRequestFile.setUp.txt rename to github/tests/ReplayData/PullRequestFile.setUp.txt diff --git a/test/ReplayData/RateLimiting.testRateLimiting.txt b/github/tests/ReplayData/RateLimiting.testRateLimiting.txt similarity index 100% rename from test/ReplayData/RateLimiting.testRateLimiting.txt rename to github/tests/ReplayData/RateLimiting.testRateLimiting.txt diff --git a/test/ReplayData/Repository.setUp.txt b/github/tests/ReplayData/Repository.setUp.txt similarity index 100% rename from test/ReplayData/Repository.setUp.txt rename to github/tests/ReplayData/Repository.setUp.txt diff --git a/test/ReplayData/Repository.testAssignees.txt b/github/tests/ReplayData/Repository.testAssignees.txt similarity index 100% rename from test/ReplayData/Repository.testAssignees.txt rename to github/tests/ReplayData/Repository.testAssignees.txt diff --git a/test/ReplayData/Repository.testCollaborators.txt b/github/tests/ReplayData/Repository.testCollaborators.txt similarity index 100% rename from test/ReplayData/Repository.testCollaborators.txt rename to github/tests/ReplayData/Repository.testCollaborators.txt diff --git a/test/ReplayData/Repository.testCompare.txt b/github/tests/ReplayData/Repository.testCompare.txt similarity index 100% rename from test/ReplayData/Repository.testCompare.txt rename to github/tests/ReplayData/Repository.testCompare.txt diff --git a/test/ReplayData/Repository.testCreateDownloadWithAllArguments.txt b/github/tests/ReplayData/Repository.testCreateDownloadWithAllArguments.txt similarity index 100% rename from test/ReplayData/Repository.testCreateDownloadWithAllArguments.txt rename to github/tests/ReplayData/Repository.testCreateDownloadWithAllArguments.txt diff --git a/test/ReplayData/Repository.testCreateDownloadWithMinimalArguments.txt b/github/tests/ReplayData/Repository.testCreateDownloadWithMinimalArguments.txt similarity index 100% rename from test/ReplayData/Repository.testCreateDownloadWithMinimalArguments.txt rename to github/tests/ReplayData/Repository.testCreateDownloadWithMinimalArguments.txt diff --git a/test/ReplayData/Repository.testCreateGitBlob.txt b/github/tests/ReplayData/Repository.testCreateGitBlob.txt similarity index 100% rename from test/ReplayData/Repository.testCreateGitBlob.txt rename to github/tests/ReplayData/Repository.testCreateGitBlob.txt diff --git a/test/ReplayData/Repository.testCreateGitCommit.txt b/github/tests/ReplayData/Repository.testCreateGitCommit.txt similarity index 100% rename from test/ReplayData/Repository.testCreateGitCommit.txt rename to github/tests/ReplayData/Repository.testCreateGitCommit.txt diff --git a/test/ReplayData/Repository.testCreateGitCommitWithAllArguments.txt b/github/tests/ReplayData/Repository.testCreateGitCommitWithAllArguments.txt similarity index 100% rename from test/ReplayData/Repository.testCreateGitCommitWithAllArguments.txt rename to github/tests/ReplayData/Repository.testCreateGitCommitWithAllArguments.txt diff --git a/test/ReplayData/Repository.testCreateGitCommitWithParents.txt b/github/tests/ReplayData/Repository.testCreateGitCommitWithParents.txt similarity index 100% rename from test/ReplayData/Repository.testCreateGitCommitWithParents.txt rename to github/tests/ReplayData/Repository.testCreateGitCommitWithParents.txt diff --git a/test/ReplayData/Repository.testCreateGitRef.txt b/github/tests/ReplayData/Repository.testCreateGitRef.txt similarity index 100% rename from test/ReplayData/Repository.testCreateGitRef.txt rename to github/tests/ReplayData/Repository.testCreateGitRef.txt diff --git a/test/ReplayData/Repository.testCreateGitTag.txt b/github/tests/ReplayData/Repository.testCreateGitTag.txt similarity index 100% rename from test/ReplayData/Repository.testCreateGitTag.txt rename to github/tests/ReplayData/Repository.testCreateGitTag.txt diff --git a/test/ReplayData/Repository.testCreateGitTagWithAllArguments.txt b/github/tests/ReplayData/Repository.testCreateGitTagWithAllArguments.txt similarity index 100% rename from test/ReplayData/Repository.testCreateGitTagWithAllArguments.txt rename to github/tests/ReplayData/Repository.testCreateGitTagWithAllArguments.txt diff --git a/test/ReplayData/Repository.testCreateGitTree.txt b/github/tests/ReplayData/Repository.testCreateGitTree.txt similarity index 100% rename from test/ReplayData/Repository.testCreateGitTree.txt rename to github/tests/ReplayData/Repository.testCreateGitTree.txt diff --git a/test/ReplayData/Repository.testCreateGitTreeWithBaseTree.txt b/github/tests/ReplayData/Repository.testCreateGitTreeWithBaseTree.txt similarity index 100% rename from test/ReplayData/Repository.testCreateGitTreeWithBaseTree.txt rename to github/tests/ReplayData/Repository.testCreateGitTreeWithBaseTree.txt diff --git a/test/ReplayData/Repository.testCreateGitTreeWithSha.txt b/github/tests/ReplayData/Repository.testCreateGitTreeWithSha.txt similarity index 100% rename from test/ReplayData/Repository.testCreateGitTreeWithSha.txt rename to github/tests/ReplayData/Repository.testCreateGitTreeWithSha.txt diff --git a/test/ReplayData/Repository.testCreateHookWithAllParameters.txt b/github/tests/ReplayData/Repository.testCreateHookWithAllParameters.txt similarity index 100% rename from test/ReplayData/Repository.testCreateHookWithAllParameters.txt rename to github/tests/ReplayData/Repository.testCreateHookWithAllParameters.txt diff --git a/test/ReplayData/Repository.testCreateHookWithMinimalParameters.txt b/github/tests/ReplayData/Repository.testCreateHookWithMinimalParameters.txt similarity index 100% rename from test/ReplayData/Repository.testCreateHookWithMinimalParameters.txt rename to github/tests/ReplayData/Repository.testCreateHookWithMinimalParameters.txt diff --git a/test/ReplayData/Repository.testCreateIssue.txt b/github/tests/ReplayData/Repository.testCreateIssue.txt similarity index 100% rename from test/ReplayData/Repository.testCreateIssue.txt rename to github/tests/ReplayData/Repository.testCreateIssue.txt diff --git a/test/ReplayData/Repository.testCreateIssueWithAllArguments.txt b/github/tests/ReplayData/Repository.testCreateIssueWithAllArguments.txt similarity index 100% rename from test/ReplayData/Repository.testCreateIssueWithAllArguments.txt rename to github/tests/ReplayData/Repository.testCreateIssueWithAllArguments.txt diff --git a/test/ReplayData/Repository.testCreateKey.txt b/github/tests/ReplayData/Repository.testCreateKey.txt similarity index 100% rename from test/ReplayData/Repository.testCreateKey.txt rename to github/tests/ReplayData/Repository.testCreateKey.txt diff --git a/test/ReplayData/Repository.testCreateLabel.txt b/github/tests/ReplayData/Repository.testCreateLabel.txt similarity index 100% rename from test/ReplayData/Repository.testCreateLabel.txt rename to github/tests/ReplayData/Repository.testCreateLabel.txt diff --git a/test/ReplayData/Repository.testCreateMilestone.txt b/github/tests/ReplayData/Repository.testCreateMilestone.txt similarity index 100% rename from test/ReplayData/Repository.testCreateMilestone.txt rename to github/tests/ReplayData/Repository.testCreateMilestone.txt diff --git a/test/ReplayData/Repository.testCreateMilestoneWithMinimalArguments.txt b/github/tests/ReplayData/Repository.testCreateMilestoneWithMinimalArguments.txt similarity index 100% rename from test/ReplayData/Repository.testCreateMilestoneWithMinimalArguments.txt rename to github/tests/ReplayData/Repository.testCreateMilestoneWithMinimalArguments.txt diff --git a/test/ReplayData/Repository.testCreatePull.txt b/github/tests/ReplayData/Repository.testCreatePull.txt similarity index 100% rename from test/ReplayData/Repository.testCreatePull.txt rename to github/tests/ReplayData/Repository.testCreatePull.txt diff --git a/test/ReplayData/Repository.testCreatePullFromIssue.txt b/github/tests/ReplayData/Repository.testCreatePullFromIssue.txt similarity index 100% rename from test/ReplayData/Repository.testCreatePullFromIssue.txt rename to github/tests/ReplayData/Repository.testCreatePullFromIssue.txt diff --git a/test/ReplayData/Repository.testDelete.txt b/github/tests/ReplayData/Repository.testDelete.txt similarity index 100% rename from test/ReplayData/Repository.testDelete.txt rename to github/tests/ReplayData/Repository.testDelete.txt diff --git a/test/ReplayData/Repository.testEditWithAllArguments.txt b/github/tests/ReplayData/Repository.testEditWithAllArguments.txt similarity index 100% rename from test/ReplayData/Repository.testEditWithAllArguments.txt rename to github/tests/ReplayData/Repository.testEditWithAllArguments.txt diff --git a/test/ReplayData/Repository.testEditWithoutArguments.txt b/github/tests/ReplayData/Repository.testEditWithoutArguments.txt similarity index 100% rename from test/ReplayData/Repository.testEditWithoutArguments.txt rename to github/tests/ReplayData/Repository.testEditWithoutArguments.txt diff --git a/test/ReplayData/Repository.testGetArchiveLink.txt b/github/tests/ReplayData/Repository.testGetArchiveLink.txt similarity index 100% rename from test/ReplayData/Repository.testGetArchiveLink.txt rename to github/tests/ReplayData/Repository.testGetArchiveLink.txt diff --git a/test/ReplayData/Repository.testGetBranch.txt b/github/tests/ReplayData/Repository.testGetBranch.txt similarity index 100% rename from test/ReplayData/Repository.testGetBranch.txt rename to github/tests/ReplayData/Repository.testGetBranch.txt diff --git a/test/ReplayData/Repository.testGetComments.txt b/github/tests/ReplayData/Repository.testGetComments.txt similarity index 100% rename from test/ReplayData/Repository.testGetComments.txt rename to github/tests/ReplayData/Repository.testGetComments.txt diff --git a/test/ReplayData/Repository.testGetCommits.txt b/github/tests/ReplayData/Repository.testGetCommits.txt similarity index 100% rename from test/ReplayData/Repository.testGetCommits.txt rename to github/tests/ReplayData/Repository.testGetCommits.txt diff --git a/test/ReplayData/Repository.testGetCommitsWithArguments.txt b/github/tests/ReplayData/Repository.testGetCommitsWithArguments.txt similarity index 100% rename from test/ReplayData/Repository.testGetCommitsWithArguments.txt rename to github/tests/ReplayData/Repository.testGetCommitsWithArguments.txt diff --git a/test/ReplayData/Repository.testGetContents.txt b/github/tests/ReplayData/Repository.testGetContents.txt similarity index 100% rename from test/ReplayData/Repository.testGetContents.txt rename to github/tests/ReplayData/Repository.testGetContents.txt diff --git a/test/ReplayData/Repository.testGetContributors.txt b/github/tests/ReplayData/Repository.testGetContributors.txt similarity index 100% rename from test/ReplayData/Repository.testGetContributors.txt rename to github/tests/ReplayData/Repository.testGetContributors.txt diff --git a/test/ReplayData/Repository.testGetDownloads.txt b/github/tests/ReplayData/Repository.testGetDownloads.txt similarity index 100% rename from test/ReplayData/Repository.testGetDownloads.txt rename to github/tests/ReplayData/Repository.testGetDownloads.txt diff --git a/test/ReplayData/Repository.testGetEvents.txt b/github/tests/ReplayData/Repository.testGetEvents.txt similarity index 100% rename from test/ReplayData/Repository.testGetEvents.txt rename to github/tests/ReplayData/Repository.testGetEvents.txt diff --git a/test/ReplayData/Repository.testGetForks.txt b/github/tests/ReplayData/Repository.testGetForks.txt similarity index 100% rename from test/ReplayData/Repository.testGetForks.txt rename to github/tests/ReplayData/Repository.testGetForks.txt diff --git a/test/ReplayData/Repository.testGetGitRefs.txt b/github/tests/ReplayData/Repository.testGetGitRefs.txt similarity index 100% rename from test/ReplayData/Repository.testGetGitRefs.txt rename to github/tests/ReplayData/Repository.testGetGitRefs.txt diff --git a/test/ReplayData/Repository.testGetGitTreeWithRecursive.txt b/github/tests/ReplayData/Repository.testGetGitTreeWithRecursive.txt similarity index 100% rename from test/ReplayData/Repository.testGetGitTreeWithRecursive.txt rename to github/tests/ReplayData/Repository.testGetGitTreeWithRecursive.txt diff --git a/test/ReplayData/Repository.testGetHooks.txt b/github/tests/ReplayData/Repository.testGetHooks.txt similarity index 100% rename from test/ReplayData/Repository.testGetHooks.txt rename to github/tests/ReplayData/Repository.testGetHooks.txt diff --git a/test/ReplayData/Repository.testGetIssues.txt b/github/tests/ReplayData/Repository.testGetIssues.txt similarity index 100% rename from test/ReplayData/Repository.testGetIssues.txt rename to github/tests/ReplayData/Repository.testGetIssues.txt diff --git a/test/ReplayData/Repository.testGetIssuesEvents.txt b/github/tests/ReplayData/Repository.testGetIssuesEvents.txt similarity index 100% rename from test/ReplayData/Repository.testGetIssuesEvents.txt rename to github/tests/ReplayData/Repository.testGetIssuesEvents.txt diff --git a/test/ReplayData/Repository.testGetIssuesWithArguments.txt b/github/tests/ReplayData/Repository.testGetIssuesWithArguments.txt similarity index 100% rename from test/ReplayData/Repository.testGetIssuesWithArguments.txt rename to github/tests/ReplayData/Repository.testGetIssuesWithArguments.txt diff --git a/test/ReplayData/Repository.testGetIssuesWithWildcards.txt b/github/tests/ReplayData/Repository.testGetIssuesWithWildcards.txt similarity index 100% rename from test/ReplayData/Repository.testGetIssuesWithWildcards.txt rename to github/tests/ReplayData/Repository.testGetIssuesWithWildcards.txt diff --git a/test/ReplayData/Repository.testGetKeys.txt b/github/tests/ReplayData/Repository.testGetKeys.txt similarity index 100% rename from test/ReplayData/Repository.testGetKeys.txt rename to github/tests/ReplayData/Repository.testGetKeys.txt diff --git a/test/ReplayData/Repository.testGetLabel.txt b/github/tests/ReplayData/Repository.testGetLabel.txt similarity index 100% rename from test/ReplayData/Repository.testGetLabel.txt rename to github/tests/ReplayData/Repository.testGetLabel.txt diff --git a/test/ReplayData/Repository.testGetLabels.txt b/github/tests/ReplayData/Repository.testGetLabels.txt similarity index 100% rename from test/ReplayData/Repository.testGetLabels.txt rename to github/tests/ReplayData/Repository.testGetLabels.txt diff --git a/test/ReplayData/Repository.testGetLanguages.txt b/github/tests/ReplayData/Repository.testGetLanguages.txt similarity index 100% rename from test/ReplayData/Repository.testGetLanguages.txt rename to github/tests/ReplayData/Repository.testGetLanguages.txt diff --git a/test/ReplayData/Repository.testGetMilestones.txt b/github/tests/ReplayData/Repository.testGetMilestones.txt similarity index 100% rename from test/ReplayData/Repository.testGetMilestones.txt rename to github/tests/ReplayData/Repository.testGetMilestones.txt diff --git a/test/ReplayData/Repository.testGetMilestonesWithArguments.txt b/github/tests/ReplayData/Repository.testGetMilestonesWithArguments.txt similarity index 100% rename from test/ReplayData/Repository.testGetMilestonesWithArguments.txt rename to github/tests/ReplayData/Repository.testGetMilestonesWithArguments.txt diff --git a/test/ReplayData/Repository.testGetNetworkEvents.txt b/github/tests/ReplayData/Repository.testGetNetworkEvents.txt similarity index 100% rename from test/ReplayData/Repository.testGetNetworkEvents.txt rename to github/tests/ReplayData/Repository.testGetNetworkEvents.txt diff --git a/test/ReplayData/Repository.testGetPulls.txt b/github/tests/ReplayData/Repository.testGetPulls.txt similarity index 100% rename from test/ReplayData/Repository.testGetPulls.txt rename to github/tests/ReplayData/Repository.testGetPulls.txt diff --git a/test/ReplayData/Repository.testGetPullsWithArguments.txt b/github/tests/ReplayData/Repository.testGetPullsWithArguments.txt similarity index 100% rename from test/ReplayData/Repository.testGetPullsWithArguments.txt rename to github/tests/ReplayData/Repository.testGetPullsWithArguments.txt diff --git a/test/ReplayData/Repository.testGetStargazers.txt b/github/tests/ReplayData/Repository.testGetStargazers.txt similarity index 100% rename from test/ReplayData/Repository.testGetStargazers.txt rename to github/tests/ReplayData/Repository.testGetStargazers.txt diff --git a/test/ReplayData/Repository.testGetSubscribers.txt b/github/tests/ReplayData/Repository.testGetSubscribers.txt similarity index 100% rename from test/ReplayData/Repository.testGetSubscribers.txt rename to github/tests/ReplayData/Repository.testGetSubscribers.txt diff --git a/test/ReplayData/Repository.testGetTeams.txt b/github/tests/ReplayData/Repository.testGetTeams.txt similarity index 100% rename from test/ReplayData/Repository.testGetTeams.txt rename to github/tests/ReplayData/Repository.testGetTeams.txt diff --git a/test/ReplayData/Repository.testGetWatchers.txt b/github/tests/ReplayData/Repository.testGetWatchers.txt similarity index 100% rename from test/ReplayData/Repository.testGetWatchers.txt rename to github/tests/ReplayData/Repository.testGetWatchers.txt diff --git a/test/ReplayData/Repository.testLegacySearchIssues.txt b/github/tests/ReplayData/Repository.testLegacySearchIssues.txt similarity index 100% rename from test/ReplayData/Repository.testLegacySearchIssues.txt rename to github/tests/ReplayData/Repository.testLegacySearchIssues.txt diff --git a/test/ReplayData/Repository.testMergeWithConflict.txt b/github/tests/ReplayData/Repository.testMergeWithConflict.txt similarity index 100% rename from test/ReplayData/Repository.testMergeWithConflict.txt rename to github/tests/ReplayData/Repository.testMergeWithConflict.txt diff --git a/test/ReplayData/Repository.testMergeWithMessage.txt b/github/tests/ReplayData/Repository.testMergeWithMessage.txt similarity index 100% rename from test/ReplayData/Repository.testMergeWithMessage.txt rename to github/tests/ReplayData/Repository.testMergeWithMessage.txt diff --git a/test/ReplayData/Repository.testMergeWithNothingToDo.txt b/github/tests/ReplayData/Repository.testMergeWithNothingToDo.txt similarity index 100% rename from test/ReplayData/Repository.testMergeWithNothingToDo.txt rename to github/tests/ReplayData/Repository.testMergeWithNothingToDo.txt diff --git a/test/ReplayData/Repository.testMergeWithoutMessage.txt b/github/tests/ReplayData/Repository.testMergeWithoutMessage.txt similarity index 100% rename from test/ReplayData/Repository.testMergeWithoutMessage.txt rename to github/tests/ReplayData/Repository.testMergeWithoutMessage.txt diff --git a/test/ReplayData/Repository.testSearchIssues.txt b/github/tests/ReplayData/Repository.testSearchIssues.txt similarity index 100% rename from test/ReplayData/Repository.testSearchIssues.txt rename to github/tests/ReplayData/Repository.testSearchIssues.txt diff --git a/test/ReplayData/RepositoryKey.setUp.txt b/github/tests/ReplayData/RepositoryKey.setUp.txt similarity index 100% rename from test/ReplayData/RepositoryKey.setUp.txt rename to github/tests/ReplayData/RepositoryKey.setUp.txt diff --git a/test/ReplayData/RepositoryKey.testDelete.txt b/github/tests/ReplayData/RepositoryKey.testDelete.txt similarity index 100% rename from test/ReplayData/RepositoryKey.testDelete.txt rename to github/tests/ReplayData/RepositoryKey.testDelete.txt diff --git a/test/ReplayData/RepositoryKey.testEdit.txt b/github/tests/ReplayData/RepositoryKey.testEdit.txt similarity index 100% rename from test/ReplayData/RepositoryKey.testEdit.txt rename to github/tests/ReplayData/RepositoryKey.testEdit.txt diff --git a/test/ReplayData/RepositoryKey.testEditWithoutParameters.txt b/github/tests/ReplayData/RepositoryKey.testEditWithoutParameters.txt similarity index 100% rename from test/ReplayData/RepositoryKey.testEditWithoutParameters.txt rename to github/tests/ReplayData/RepositoryKey.testEditWithoutParameters.txt diff --git a/test/ReplayData/Tag.setUp.txt b/github/tests/ReplayData/Tag.setUp.txt similarity index 100% rename from test/ReplayData/Tag.setUp.txt rename to github/tests/ReplayData/Tag.setUp.txt diff --git a/test/ReplayData/Team.setUp.txt b/github/tests/ReplayData/Team.setUp.txt similarity index 100% rename from test/ReplayData/Team.setUp.txt rename to github/tests/ReplayData/Team.setUp.txt diff --git a/test/ReplayData/Team.testDelete.txt b/github/tests/ReplayData/Team.testDelete.txt similarity index 100% rename from test/ReplayData/Team.testDelete.txt rename to github/tests/ReplayData/Team.testDelete.txt diff --git a/test/ReplayData/Team.testEditWithAllArguments.txt b/github/tests/ReplayData/Team.testEditWithAllArguments.txt similarity index 100% rename from test/ReplayData/Team.testEditWithAllArguments.txt rename to github/tests/ReplayData/Team.testEditWithAllArguments.txt diff --git a/test/ReplayData/Team.testEditWithoutArguments.txt b/github/tests/ReplayData/Team.testEditWithoutArguments.txt similarity index 100% rename from test/ReplayData/Team.testEditWithoutArguments.txt rename to github/tests/ReplayData/Team.testEditWithoutArguments.txt diff --git a/test/ReplayData/Team.testMembers.txt b/github/tests/ReplayData/Team.testMembers.txt similarity index 100% rename from test/ReplayData/Team.testMembers.txt rename to github/tests/ReplayData/Team.testMembers.txt diff --git a/test/ReplayData/Team.testRepos.txt b/github/tests/ReplayData/Team.testRepos.txt similarity index 100% rename from test/ReplayData/Team.testRepos.txt rename to github/tests/ReplayData/Team.testRepos.txt diff --git a/test/ReplayData/UserKey.setUp.txt b/github/tests/ReplayData/UserKey.setUp.txt similarity index 100% rename from test/ReplayData/UserKey.setUp.txt rename to github/tests/ReplayData/UserKey.setUp.txt diff --git a/test/ReplayData/UserKey.testDelete.txt b/github/tests/ReplayData/UserKey.testDelete.txt similarity index 100% rename from test/ReplayData/UserKey.testDelete.txt rename to github/tests/ReplayData/UserKey.testDelete.txt diff --git a/test/ReplayData/UserKey.testEditWithAllArguments.txt b/github/tests/ReplayData/UserKey.testEditWithAllArguments.txt similarity index 100% rename from test/ReplayData/UserKey.testEditWithAllArguments.txt rename to github/tests/ReplayData/UserKey.testEditWithAllArguments.txt diff --git a/test/ReplayData/UserKey.testEditWithoutArguments.txt b/github/tests/ReplayData/UserKey.testEditWithoutArguments.txt similarity index 100% rename from test/ReplayData/UserKey.testEditWithoutArguments.txt rename to github/tests/ReplayData/UserKey.testEditWithoutArguments.txt diff --git a/test/Repository.py b/github/tests/Repository.py similarity index 100% rename from test/Repository.py rename to github/tests/Repository.py diff --git a/test/RepositoryKey.py b/github/tests/RepositoryKey.py similarity index 100% rename from test/RepositoryKey.py rename to github/tests/RepositoryKey.py diff --git a/test/Tag.py b/github/tests/Tag.py similarity index 100% rename from test/Tag.py rename to github/tests/Tag.py diff --git a/test/Team.py b/github/tests/Team.py similarity index 100% rename from test/Team.py rename to github/tests/Team.py diff --git a/test/UserKey.py b/github/tests/UserKey.py similarity index 100% rename from test/UserKey.py rename to github/tests/UserKey.py From c6609fd4dacf7347125fdf3d4cf4ac1afeef7d4d Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Sun, 16 Sep 2012 20:39:00 +0200 Subject: [PATCH 05/62] Fixes for issue #86 --- .gitignore | 2 -- github/tests/AllTests.py | 58 +++++++++++++++++++++++++++++++++++++++ github/tests/Framework.py | 9 ++---- github/tests/__init__.py | 19 +++++++++++++ github/tests/__main__.py | 15 ++++++++++ publish.sh | 2 +- run_tests.sh | 16 ----------- setup.py | 17 ++++++------ 8 files changed, 104 insertions(+), 34 deletions(-) create mode 100644 github/tests/AllTests.py create mode 100644 github/tests/__init__.py create mode 100644 github/tests/__main__.py delete mode 100755 run_tests.sh diff --git a/.gitignore b/.gitignore index 3af5a479..4b032645 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,4 @@ *.pyc GithubCredentials.py -.coverage /dist /MANIFEST -/test/htmlcov/ diff --git a/github/tests/AllTests.py b/github/tests/AllTests.py new file mode 100644 index 00000000..71453e57 --- /dev/null +++ b/github/tests/AllTests.py @@ -0,0 +1,58 @@ +# Copyright 2012 Vincent Jacques +# vincent@vincent-jacques.net + +# This file is part of PyGithub. http://vincent-jacques.net/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 . + +from AuthenticatedUser import * +from Authentication import * +from Authorization import * +from Branch import * +from Commit import * +from CommitComment import * +from CommitStatus import * +from ContentFile import * +from Download import * +from Event import * +from Gist import * +from GistComment import * +from GitBlob import * +from GitCommit import * +from Github import * +from GitRef import * +from GitTag import * +from GitTree import * +from Hook import * +from Issue import * +from IssueComment import * +from IssueEvent import * +from Label import * +from Milestone import * +from NamedUser import * +from Markdown import * +from Organization import * +from PullRequest import * +from PullRequestComment import * +from PullRequestFile import * +from RateLimiting import * +from Repository import * +from RepositoryKey import * +from Tag import * +from Team import * +from UserKey import * + +from PaginatedList import * +from Exceptions import * +from Enterprise import * + +from Issue33 import * +from Issue50 import * +from Issue54 import * +from Issue80 import * diff --git a/github/tests/Framework.py b/github/tests/Framework.py index 597c64e1..cf1dc896 100644 --- a/github/tests/Framework.py +++ b/github/tests/Framework.py @@ -16,9 +16,7 @@ import sys import unittest import httplib import traceback -import itertools -sys.path = [ os.path.join( os.path.dirname( __file__ ), ".." ) ] + sys.path import github class FakeHttpResponse: @@ -175,8 +173,5 @@ class TestCase( BasicTestCase ): BasicTestCase.setUp( self ) self.g = github.Github( self.login, self.password ) -def main(): - if "--record" in sys.argv: - BasicTestCase.recordMode = True - - unittest.main( argv = [ arg for arg in sys.argv if arg != "--record" ] ) +def activateRecordMode(): + BasicTestCase.recordMode = True diff --git a/github/tests/__init__.py b/github/tests/__init__.py new file mode 100644 index 00000000..7e573b50 --- /dev/null +++ b/github/tests/__init__.py @@ -0,0 +1,19 @@ +# Copyright 2012 Vincent Jacques +# vincent@vincent-jacques.net + +# This file is part of PyGithub. http://vincent-jacques.net/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 unittest + +import AllTests + +def run(): + unittest.main( module = AllTests, argv = [ "Dummy Script Name" ] ) diff --git a/github/tests/__main__.py b/github/tests/__main__.py new file mode 100644 index 00000000..494c50c1 --- /dev/null +++ b/github/tests/__main__.py @@ -0,0 +1,15 @@ +import sys +import unittest + +import Framework +import AllTests + +def main( argv ): + if "--record" in argv: + Framework.activateRecordMode() + argv = [ arg for arg in argv if arg != "--record" ] + + unittest.main( module = AllTests, argv = argv ) + +if __name__ == "__main__": + main( sys.argv ) diff --git a/publish.sh b/publish.sh index e48b99c1..8bb6f9da 100755 --- a/publish.sh +++ b/publish.sh @@ -1,6 +1,6 @@ #!/bin/sh -./run_tests.sh +python setup.py test previousVersion=$( grep 'version =' setup.py | sed 's/.*version = \"\(.*\)\".*/\1/' ) echo "Next version number? (previous: '$previousVersion')" diff --git a/run_tests.sh b/run_tests.sh deleted file mode 100755 index 38ad3b7e..00000000 --- a/run_tests.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh - -rm -f $(find . -name "*.pyc") - -cd test - -coverage erase -coverage run --branch IntegrationTest.py - -echo "==============================" -echo "|| Coverage (shall be 100%) ||" -echo "==============================" - -coverage report -m --include=../github/* - -coverage html --include=../github/* diff --git a/setup.py b/setup.py index 52f1c295..69baf89c 100755 --- a/setup.py +++ b/setup.py @@ -16,18 +16,18 @@ from distutils.core import setup, Command import textwrap -class TestCommand( Command ): +class test( Command ): user_options = [] - def initialize_options(self): + def initialize_options( self ): pass - def finalize_options(self): + def finalize_options( self ): pass - def run(self): - import sys, subprocess - raise SystemExit( subprocess.call( [ sys.executable, "test/IntegrationTest.py" ] ) ) + def run( self ): + import github.tests + github.tests.run() setup( name = "PyGithub", @@ -66,9 +66,10 @@ setup( See http://vincent-jacques.net/PyGithub""" ), packages = [ "github", + "github.tests", ], package_data = { - "github": [ "ReadMe.md", "COPYING*", "doc/*.md" ] + "github": [ "ReadMe.md", "COPYING*", "doc/*.md", "tests/ReplayData/*.txt" ] }, classifiers = [ "Development Status :: 5 - Production/Stable", @@ -79,5 +80,5 @@ setup( "Programming Language :: Python", "Topic :: Software Development", ], - cmdclass = { "test": TestCommand }, + cmdclass = { "test": test }, ) From f5e8e6d2a043fef549bc6c3e3b499704cdb16144 Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Sun, 16 Sep 2012 21:51:22 +0200 Subject: [PATCH 06/62] Add a Travis image --- ReadMe.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ReadMe.md b/ReadMe.md index 58b9f0fb..bd316042 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -11,6 +11,8 @@ PyGithub is stable. I will maintain it up to date with the API, and fix bugs if What's new? =========== +[![Build Status](https://secure.travis-ci.org/jacquev6/PyGithub.png)](http://travis-ci.org/jacquev6/PyGithub) + [Next version](https://github.com/jacquev6/PyGithub/issues?milestone=13&state=closed) (???, 2012) ----------------------------------------------------------------------------------------------------------- From 123ee014c1251d5b518676d7612bac4731fa7024 Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Mon, 17 Sep 2012 00:49:23 +0200 Subject: [PATCH 07/62] Gather things that show up when googling PyGithub --- ReadMe.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/ReadMe.md b/ReadMe.md index bd316042..49011411 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -81,3 +81,16 @@ Projects using PyGithub * [Upverter](https://upverter.com) is a web-based schematic capture and PCB layout tool for people who design electronics. Designers can attach a Github project to an Upverter project. * [Tratihubis](http://pypi.python.org/pypi/tratihubis/) converts Trac tickets to Github issues +* https://github.com/CMB/cligh +* https://github.com/natduca/quickopen uses PyGithub to automaticaly create issues +* https://gist.github.com/3433798 +* https://github.com/zsiciarz/aquila-dsp.org +* https://github.com/robcowie/virtualenvwrapper.github + +They talk about PyGithub +======================== + +* http://stackoverflow.com/questions/10625190/most-suitable-python-library-for-github-api-v3 +* http://stackoverflow.com/questions/12379637/django-social-auth-github-authentication +* http://www.freebsd.org/cgi/cvsweb.cgi/ports/devel/py-pygithub/ +* http://oddshocks.com/blog/2012/08/02/developing-charsheet/ From 3b5a5002e15e482abba86223d46efb4180a61f09 Mon Sep 17 00:00:00 2001 From: Andrew Bettison Date: Mon, 17 Sep 2012 17:34:27 +0930 Subject: [PATCH 08/62] Log raw requests using Python logging module --- github/Requester.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/github/Requester.py b/github/Requester.py index fd223b71..942ed5d2 100644 --- a/github/Requester.py +++ b/github/Requester.py @@ -11,6 +11,7 @@ # You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see . +import logging import httplib import base64 import urllib @@ -30,6 +31,10 @@ class Requester: __httpConnectionClass = httplib.HTTPConnection __httpsConnectionClass = httplib.HTTPSConnection + @staticmethod + def __logger(): + return logging.getLogger('github') + @classmethod def injectConnectionClasses( cls, httpConnectionClass, httpsConnectionClass ): cls.__httpConnectionClass = httpConnectionClass @@ -109,7 +114,9 @@ class Requester: if "x-ratelimit-remaining" in headers and "x-ratelimit-limit" in headers: self.rate_limiting = ( int( headers[ "x-ratelimit-remaining" ] ), int( headers[ "x-ratelimit-limit" ] ) ) - # print verb, self.__base_url + url, parameters, input, "==>", status, str( headers ), str( output ) + logger = self.__logger() + if logger.isEnabledFor(logging.DEBUG): + logger.debug(' '.join(map(unicode, [verb, self.__base_url + url, parameters, input, "==>", status, str(headers), str(output)]))) return status, headers, output def __completeUrl( self, url, parameters ): From f9dd406465a5ab9e2d07f04f6ed9b7832418d03f Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Mon, 17 Sep 2012 19:28:29 +0200 Subject: [PATCH 09/62] Test the logging facility --- github/Logging.py | 4 ++ github/Requester.py | 8 ++-- github/__init__.py | 1 + github/tests/AllTests.py | 1 + github/tests/Logging.py | 37 +++++++++++++++++++ .../tests/ReplayData/Logging.testLogging.txt | 5 +++ 6 files changed, 51 insertions(+), 5 deletions(-) create mode 100644 github/Logging.py create mode 100644 github/tests/Logging.py create mode 100644 github/tests/ReplayData/Logging.testLogging.txt diff --git a/github/Logging.py b/github/Logging.py new file mode 100644 index 00000000..043fde0d --- /dev/null +++ b/github/Logging.py @@ -0,0 +1,4 @@ +import logging + +def get_logger(): + return logging.getLogger('github') diff --git a/github/Requester.py b/github/Requester.py index 942ed5d2..e11044b7 100644 --- a/github/Requester.py +++ b/github/Requester.py @@ -26,15 +26,13 @@ else: #pragma no cover import simplejson as json #pragma no cover import GithubException +import Logging + class Requester: __httpConnectionClass = httplib.HTTPConnection __httpsConnectionClass = httplib.HTTPSConnection - @staticmethod - def __logger(): - return logging.getLogger('github') - @classmethod def injectConnectionClasses( cls, httpConnectionClass, httpsConnectionClass ): cls.__httpConnectionClass = httpConnectionClass @@ -114,7 +112,7 @@ class Requester: if "x-ratelimit-remaining" in headers and "x-ratelimit-limit" in headers: self.rate_limiting = ( int( headers[ "x-ratelimit-remaining" ] ), int( headers[ "x-ratelimit-limit" ] ) ) - logger = self.__logger() + logger = Logging.get_logger() if logger.isEnabledFor(logging.DEBUG): logger.debug(' '.join(map(unicode, [verb, self.__base_url + url, parameters, input, "==>", status, str(headers), str(output)]))) return status, headers, output diff --git a/github/__init__.py b/github/__init__.py index ef0a03ab..91c2954c 100644 --- a/github/__init__.py +++ b/github/__init__.py @@ -16,3 +16,4 @@ from GithubException import GithubException from InputFileContent import InputFileContent from InputGitAuthor import InputGitAuthor from InputGitTreeElement import InputGitTreeElement +from Logging import get_logger diff --git a/github/tests/AllTests.py b/github/tests/AllTests.py index 71453e57..dcdc9cdb 100644 --- a/github/tests/AllTests.py +++ b/github/tests/AllTests.py @@ -51,6 +51,7 @@ from UserKey import * from PaginatedList import * from Exceptions import * from Enterprise import * +from Logging import * from Issue33 import * from Issue50 import * diff --git a/github/tests/Logging.py b/github/tests/Logging.py new file mode 100644 index 00000000..8f1b1ee3 --- /dev/null +++ b/github/tests/Logging.py @@ -0,0 +1,37 @@ +# Copyright 2012 Vincent Jacques +# vincent@vincent-jacques.net + +# This file is part of PyGithub. http://vincent-jacques.net/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 logging + +import github + +import Framework + +class Logging( Framework.TestCase ): + class MockHandler: + def __init__( self ): + self.level = logging.DEBUG + self.handled = None + + def handle( self, record ): + self.handled = record.getMessage() + + def testLogging( self ): + self.maxDiff = None + logger = github.get_logger() + logger.setLevel( logging.DEBUG ) + handler = self.MockHandler() + logger.addHandler( handler ) + + self.assertEqual( self.g.get_user().name, "Vincent Jacques" ) + self.assertEqual( handler.handled, u'GET https://api.github.com/user None None ==> 200 {\'status\': \'200 OK\', \'content-length\': \'806\', \'x-github-media-type\': \'github.beta; format=json\', \'x-content-type-options\': \'nosniff\', \'vary\': \'Accept, Authorization, Cookie\', \'x-ratelimit-remaining\': \'4993\', \'server\': \'nginx\', \'last-modified\': \'Fri, 14 Sep 2012 18:47:46 GMT\', \'connection\': \'keep-alive\', \'x-ratelimit-limit\': \'5000\', \'etag\': \'"434dfe5d3f50558fe3cea087cb95c401"\', \'cache-control\': \'private, s-maxage=60, max-age=60\', \'date\': \'Mon, 17 Sep 2012 17:12:32 GMT\', \'content-type\': \'application/json; charset=utf-8\'} {"owned_private_repos":3,"disk_usage":18612,"following":28,"type":"User","public_repos":13,"location":"Paris, France","company":"Criteo","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png","plan":{"space":614400,"private_repos":5,"name":"micro","collaborators":1},"blog":"http://vincent-jacques.net","login":"jacquev6","public_gists":3,"html_url":"https://github.com/jacquev6","hireable":false,"created_at":"2010-07-09T06:10:06Z","private_gists":5,"followers":13,"name":"Vincent Jacques","email":"vincent@vincent-jacques.net","bio":"","total_private_repos":3,"collaborators":0,"gravatar_id":"b68de5ae38616c296fa345d2b9df2225","id":327146,"url":"https://api.github.com/users/jacquev6"}' ) diff --git a/github/tests/ReplayData/Logging.testLogging.txt b/github/tests/ReplayData/Logging.testLogging.txt new file mode 100644 index 00000000..df230319 --- /dev/null +++ b/github/tests/ReplayData/Logging.testLogging.txt @@ -0,0 +1,5 @@ +https GET api.github.com None /user {'Authorization': 'Basic login_and_password_removed'} null +200 +[('status', '200 OK'), ('content-length', '806'), ('x-github-media-type', 'github.beta; format=json'), ('x-content-type-options', 'nosniff'), ('x-ratelimit-limit', '5000'), ('vary', 'Accept, Authorization, Cookie'), ('x-ratelimit-remaining', '4993'), ('server', 'nginx'), ('last-modified', 'Fri, 14 Sep 2012 18:47:46 GMT'), ('connection', 'keep-alive'), ('etag', '"434dfe5d3f50558fe3cea087cb95c401"'), ('cache-control', 'private, s-maxage=60, max-age=60'), ('date', 'Mon, 17 Sep 2012 17:12:32 GMT'), ('content-type', 'application/json; charset=utf-8')] +{"owned_private_repos":3,"disk_usage":18612,"following":28,"type":"User","public_repos":13,"location":"Paris, France","company":"Criteo","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png","plan":{"space":614400,"private_repos":5,"name":"micro","collaborators":1},"blog":"http://vincent-jacques.net","login":"jacquev6","public_gists":3,"html_url":"https://github.com/jacquev6","hireable":false,"created_at":"2010-07-09T06:10:06Z","private_gists":5,"followers":13,"name":"Vincent Jacques","email":"vincent@vincent-jacques.net","bio":"","total_private_repos":3,"collaborators":0,"gravatar_id":"b68de5ae38616c296fa345d2b9df2225","id":327146,"url":"https://api.github.com/users/jacquev6"} + From 2ad48a92068f95da07672fcf60933b25c5c0f7d7 Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Mon, 17 Sep 2012 20:30:28 +0200 Subject: [PATCH 10/62] Fix exception As per commit f9dd406465a5a, some tests ran after Logging.testLogging fail with a unicode-related exception. --- github/Requester.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/github/Requester.py b/github/Requester.py index e11044b7..3b2682cb 100644 --- a/github/Requester.py +++ b/github/Requester.py @@ -114,7 +114,7 @@ class Requester: logger = Logging.get_logger() if logger.isEnabledFor(logging.DEBUG): - logger.debug(' '.join(map(unicode, [verb, self.__base_url + url, parameters, input, "==>", status, str(headers), str(output)]))) + logger.debug(' '.join(map(str, [verb, self.__base_url + url, parameters, input, "==>", status, str(headers), str(output)]))) return status, headers, output def __completeUrl( self, url, parameters ): From 531c3f2d32b3d116d32a547bc5774686d2450d45 Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Mon, 17 Sep 2012 20:34:58 +0200 Subject: [PATCH 11/62] Improve comformance to pep8 (+dos2unix) PyGithub is now a public projects with several public contibutors, I have to abandon my very personal coding conventions. --- github/AuthenticatedUser.py | 535 ++++++++--------- github/Authorization.py | 141 ++--- github/AuthorizationApplication.py | 31 +- github/Branch.py | 27 +- github/Commit.py | 153 ++--- github/CommitComment.py | 147 ++--- github/CommitStats.py | 37 +- github/CommitStatus.py | 77 +-- github/Comparison.py | 159 +++--- github/ContentFile.py | 77 +-- github/Download.py | 249 ++++---- github/Event.py | 87 +-- github/File.py | 97 ++-- github/Gist.py | 239 ++++---- github/GistComment.py | 87 +-- github/GistFile.py | 57 +- github/GistHistoryState.py | 67 +-- github/GitAuthor.py | 37 +- github/GitBlob.py | 67 +-- github/GitCommit.py | 97 ++-- github/GitObject.py | 37 +- github/GitRef.py | 55 +- github/GitTag.py | 79 +-- github/GitTree.py | 49 +- github/GitTreeElement.py | 67 +-- github/Github.py | 68 +-- github/GithubException.py | 11 +- github/GithubObject.py | 39 +- github/Hook.py | 143 ++--- github/HookDescription.py | 47 +- github/HookResponse.py | 37 +- github/InputFileContent.py | 7 +- github/InputGitAuthor.py | 7 +- github/InputGitTreeElement.py | 11 +- github/Issue.py | 295 +++++----- github/IssueComment.py | 87 +-- github/IssueEvent.py | 91 +-- github/IssuePullRequest.py | 37 +- github/Label.py | 57 +- github/Legacy.py | 134 +++-- github/Logging.py | 9 +- github/Milestone.py | 163 +++--- github/NamedUser.py | 369 ++++++------ github/Organization.py | 425 +++++++------- github/PaginatedList.py | 82 +-- github/Permissions.py | 37 +- github/Plan.py | 47 +- github/PullRequest.py | 401 ++++++------- github/PullRequestComment.py | 147 ++--- github/PullRequestMergeStatus.py | 37 +- github/PullRequestPart.py | 57 +- github/Repository.py | 885 +++++++++++++++-------------- github/RepositoryKey.py | 92 +-- github/Requester.py | 68 +-- github/Tag.py | 47 +- github/Team.py | 121 ++-- github/UserKey.py | 81 +-- github/tests/AllTests.py | 118 ++-- github/tests/AuthenticatedUser.py | 257 ++++----- github/tests/Authentication.py | 19 +- github/tests/Authorization.py | 59 +- github/tests/Branch.py | 15 +- github/tests/Commit.py | 117 ++-- github/tests/CommitComment.py | 39 +- github/tests/CommitStatus.py | 69 +-- github/tests/ContentFile.py | 67 +-- github/tests/Download.py | 53 +- github/tests/Enterprise.py | 29 +- github/tests/Event.py | 27 +- github/tests/Exceptions.py | 58 +- github/tests/Framework.py | 149 ++--- github/tests/Gist.py | 111 ++-- github/tests/GistComment.py | 33 +- github/tests/GitBlob.py | 25 +- github/tests/GitCommit.py | 37 +- github/tests/GitRef.py | 31 +- github/tests/GitTag.py | 31 +- github/tests/GitTree.py | 41 +- github/tests/Github.py | 121 ++-- github/tests/Hook.py | 65 +-- github/tests/IntegrationTest.py | 1 + github/tests/Issue.py | 139 ++--- github/tests/Issue33.py | 17 +- github/tests/Issue50.py | 59 +- github/tests/Issue54.py | 17 +- github/tests/Issue80.py | 23 +- github/tests/IssueComment.py | 33 +- github/tests/IssueEvent.py | 25 +- github/tests/Label.py | 29 +- github/tests/Logging.py | 19 +- github/tests/Markdown.py | 17 +- github/tests/Milestone.py | 57 +- github/tests/NamedUser.py | 189 +++--- github/tests/Organization.py | 165 +++--- github/tests/PaginatedList.py | 83 +-- github/tests/PullRequest.py | 137 ++--- github/tests/PullRequestComment.py | 41 +- github/tests/PullRequestFile.py | 29 +- github/tests/RateLimiting.py | 11 +- github/tests/Repository.py | 581 +++++++++---------- github/tests/RepositoryKey.py | 33 +- github/tests/Tag.py | 19 +- github/tests/Team.py | 81 +-- github/tests/UserKey.py | 33 +- github/tests/__init__.py | 3 +- github/tests/__main__.py | 32 +- publish.sh | 1 + 107 files changed, 5245 insertions(+), 5094 deletions(-) diff --git a/github/AuthenticatedUser.py b/github/AuthenticatedUser.py index c67a0005..684c2142 100644 --- a/github/AuthenticatedUser.py +++ b/github/AuthenticatedUser.py @@ -25,134 +25,135 @@ import Issue import Event import Authorization -class AuthenticatedUser( GithubObject.GithubObject ): + +class AuthenticatedUser(GithubObject.GithubObject): @property - def avatar_url( self ): - self._completeIfNotSet( self._avatar_url ) - return self._NoneIfNotSet( self._avatar_url ) + def avatar_url(self): + self._completeIfNotSet(self._avatar_url) + return self._NoneIfNotSet(self._avatar_url) @property - def bio( self ): - self._completeIfNotSet( self._bio ) - return self._NoneIfNotSet( self._bio ) + def bio(self): + self._completeIfNotSet(self._bio) + return self._NoneIfNotSet(self._bio) @property - def blog( self ): - self._completeIfNotSet( self._blog ) - return self._NoneIfNotSet( self._blog ) + def blog(self): + self._completeIfNotSet(self._blog) + return self._NoneIfNotSet(self._blog) @property - def collaborators( self ): - self._completeIfNotSet( self._collaborators ) - return self._NoneIfNotSet( self._collaborators ) + def collaborators(self): + self._completeIfNotSet(self._collaborators) + return self._NoneIfNotSet(self._collaborators) @property - def company( self ): - self._completeIfNotSet( self._company ) - return self._NoneIfNotSet( self._company ) + def company(self): + self._completeIfNotSet(self._company) + return self._NoneIfNotSet(self._company) @property - def created_at( self ): - self._completeIfNotSet( self._created_at ) - return self._NoneIfNotSet( self._created_at ) + def created_at(self): + self._completeIfNotSet(self._created_at) + return self._NoneIfNotSet(self._created_at) @property - def disk_usage( self ): - self._completeIfNotSet( self._disk_usage ) - return self._NoneIfNotSet( self._disk_usage ) + def disk_usage(self): + self._completeIfNotSet(self._disk_usage) + return self._NoneIfNotSet(self._disk_usage) @property - def email( self ): - self._completeIfNotSet( self._email ) - return self._NoneIfNotSet( self._email ) + def email(self): + self._completeIfNotSet(self._email) + return self._NoneIfNotSet(self._email) @property - def followers( self ): - self._completeIfNotSet( self._followers ) - return self._NoneIfNotSet( self._followers ) + def followers(self): + self._completeIfNotSet(self._followers) + return self._NoneIfNotSet(self._followers) @property - def following( self ): - self._completeIfNotSet( self._following ) - return self._NoneIfNotSet( self._following ) + def following(self): + self._completeIfNotSet(self._following) + return self._NoneIfNotSet(self._following) @property - def gravatar_id( self ): - self._completeIfNotSet( self._gravatar_id ) - return self._NoneIfNotSet( self._gravatar_id ) + def gravatar_id(self): + self._completeIfNotSet(self._gravatar_id) + return self._NoneIfNotSet(self._gravatar_id) @property - def hireable( self ): - self._completeIfNotSet( self._hireable ) - return self._NoneIfNotSet( self._hireable ) + def hireable(self): + self._completeIfNotSet(self._hireable) + return self._NoneIfNotSet(self._hireable) @property - def html_url( self ): - self._completeIfNotSet( self._html_url ) - return self._NoneIfNotSet( self._html_url ) + def html_url(self): + self._completeIfNotSet(self._html_url) + return self._NoneIfNotSet(self._html_url) @property - def id( self ): - self._completeIfNotSet( self._id ) - return self._NoneIfNotSet( self._id ) + def id(self): + self._completeIfNotSet(self._id) + return self._NoneIfNotSet(self._id) @property - def location( self ): - self._completeIfNotSet( self._location ) - return self._NoneIfNotSet( self._location ) + def location(self): + self._completeIfNotSet(self._location) + return self._NoneIfNotSet(self._location) @property - def login( self ): - self._completeIfNotSet( self._login ) - return self._NoneIfNotSet( self._login ) + def login(self): + self._completeIfNotSet(self._login) + return self._NoneIfNotSet(self._login) @property - def name( self ): - self._completeIfNotSet( self._name ) - return self._NoneIfNotSet( self._name ) + def name(self): + self._completeIfNotSet(self._name) + return self._NoneIfNotSet(self._name) @property - def owned_private_repos( self ): - self._completeIfNotSet( self._owned_private_repos ) - return self._NoneIfNotSet( self._owned_private_repos ) + def owned_private_repos(self): + self._completeIfNotSet(self._owned_private_repos) + return self._NoneIfNotSet(self._owned_private_repos) @property - def plan( self ): - self._completeIfNotSet( self._plan ) - return self._NoneIfNotSet( self._plan ) + def plan(self): + self._completeIfNotSet(self._plan) + return self._NoneIfNotSet(self._plan) @property - def private_gists( self ): - self._completeIfNotSet( self._private_gists ) - return self._NoneIfNotSet( self._private_gists ) + def private_gists(self): + self._completeIfNotSet(self._private_gists) + return self._NoneIfNotSet(self._private_gists) @property - def public_gists( self ): - self._completeIfNotSet( self._public_gists ) - return self._NoneIfNotSet( self._public_gists ) + def public_gists(self): + self._completeIfNotSet(self._public_gists) + return self._NoneIfNotSet(self._public_gists) @property - def public_repos( self ): - self._completeIfNotSet( self._public_repos ) - return self._NoneIfNotSet( self._public_repos ) + def public_repos(self): + self._completeIfNotSet(self._public_repos) + return self._NoneIfNotSet(self._public_repos) @property - def total_private_repos( self ): - self._completeIfNotSet( self._total_private_repos ) - return self._NoneIfNotSet( self._total_private_repos ) + def total_private_repos(self): + self._completeIfNotSet(self._total_private_repos) + return self._NoneIfNotSet(self._total_private_repos) @property - def type( self ): - self._completeIfNotSet( self._type ) - return self._NoneIfNotSet( self._type ) + def type(self): + self._completeIfNotSet(self._type) + return self._NoneIfNotSet(self._type) @property - def url( self ): - self._completeIfNotSet( self._url ) - return self._NoneIfNotSet( self._url ) + def url(self): + self._completeIfNotSet(self._url) + return self._NoneIfNotSet(self._url) - def add_to_emails( self, *emails ): - assert all( isinstance( element, ( str, unicode ) ) for element in emails ), emails + def add_to_emails(self, *emails): + assert all(isinstance(element, (str, unicode)) for element in emails), emails post_parameters = emails headers, data = self._requester.requestAndCheck( "POST", @@ -161,8 +162,8 @@ class AuthenticatedUser( GithubObject.GithubObject ): post_parameters ) - def add_to_following( self, following ): - assert isinstance( following, NamedUser.NamedUser ), following + def add_to_following(self, following): + assert isinstance(following, NamedUser.NamedUser), following headers, data = self._requester.requestAndCheck( "PUT", "/user/following/" + following._identity, @@ -170,8 +171,8 @@ class AuthenticatedUser( GithubObject.GithubObject ): None ) - def add_to_starred( self, starred ): - assert isinstance( starred, Repository.Repository ), starred + def add_to_starred(self, starred): + assert isinstance(starred, Repository.Repository), starred headers, data = self._requester.requestAndCheck( "PUT", "/user/starred/" + starred._identity, @@ -179,8 +180,8 @@ class AuthenticatedUser( GithubObject.GithubObject ): None ) - def add_to_subscriptions( self, subscription ): - assert isinstance( subscription, Repository.Repository ), subscription + def add_to_subscriptions(self, subscription): + assert isinstance(subscription, Repository.Repository), subscription headers, data = self._requester.requestAndCheck( "PUT", "/user/subscriptions/" + subscription._identity, @@ -188,8 +189,8 @@ class AuthenticatedUser( GithubObject.GithubObject ): None ) - def add_to_watched( self, watched ): - assert isinstance( watched, Repository.Repository ), watched + def add_to_watched(self, watched): + assert isinstance(watched, Repository.Repository), watched headers, data = self._requester.requestAndCheck( "PUT", "/user/watched/" + watched._identity, @@ -197,56 +198,56 @@ class AuthenticatedUser( GithubObject.GithubObject ): None ) - def create_authorization( self, scopes = GithubObject.NotSet, note = GithubObject.NotSet, note_url = GithubObject.NotSet ): - assert scopes is GithubObject.NotSet or all( isinstance( element, ( str, unicode ) ) for element in scopes ), scopes - assert note is GithubObject.NotSet or isinstance( note, ( str, unicode ) ), note - assert note_url is GithubObject.NotSet or isinstance( note_url, ( str, unicode ) ), note_url + def create_authorization(self, scopes=GithubObject.NotSet, note=GithubObject.NotSet, note_url=GithubObject.NotSet): + assert scopes is GithubObject.NotSet or all(isinstance(element, (str, unicode)) for element in scopes), scopes + assert note is GithubObject.NotSet or isinstance(note, (str, unicode)), note + assert note_url is GithubObject.NotSet or isinstance(note_url, (str, unicode)), note_url post_parameters = dict() if scopes is not GithubObject.NotSet: - post_parameters[ "scopes" ] = scopes + post_parameters["scopes"] = scopes if note is not GithubObject.NotSet: - post_parameters[ "note" ] = note + post_parameters["note"] = note if note_url is not GithubObject.NotSet: - post_parameters[ "note_url" ] = note_url + post_parameters["note_url"] = note_url headers, data = self._requester.requestAndCheck( "POST", "/authorizations", None, post_parameters ) - return Authorization.Authorization( self._requester, data, completed = True ) + return Authorization.Authorization(self._requester, data, completed=True) - def create_fork( self, repo ): - assert isinstance( repo, Repository.Repository ), repo + def create_fork(self, repo): + assert isinstance(repo, Repository.Repository), repo headers, data = self._requester.requestAndCheck( "POST", "/repos/" + repo.owner.login + "/" + repo.name + "/forks", None, None ) - return Repository.Repository( self._requester, data, completed = True ) + return Repository.Repository(self._requester, data, completed=True) - def create_gist( self, public, files, description = GithubObject.NotSet ): - assert isinstance( public, bool ), public - assert all( isinstance( element, InputFileContent.InputFileContent ) for element in files.itervalues() ), files - assert description is GithubObject.NotSet or isinstance( description, ( str, unicode ) ), description + def create_gist(self, public, files, description=GithubObject.NotSet): + assert isinstance(public, bool), public + assert all(isinstance(element, InputFileContent.InputFileContent) for element in files.itervalues()), files + assert description is GithubObject.NotSet or isinstance(description, (str, unicode)), description post_parameters = { "public": public, - "files": dict( ( key, value._identity ) for key, value in files.iteritems() ), + "files": dict((key, value._identity) for key, value in files.iteritems()), } if description is not GithubObject.NotSet: - post_parameters[ "description" ] = description + post_parameters["description"] = description headers, data = self._requester.requestAndCheck( "POST", "/gists", None, post_parameters ) - return Gist.Gist( self._requester, data, completed = True ) + return Gist.Gist(self._requester, data, completed=True) - def create_key( self, title, key ): - assert isinstance( title, ( str, unicode ) ), title - assert isinstance( key, ( str, unicode ) ), key + def create_key(self, title, key): + assert isinstance(title, (str, unicode)), title + assert isinstance(key, (str, unicode)), key post_parameters = { "title": title, "key": key, @@ -257,81 +258,81 @@ class AuthenticatedUser( GithubObject.GithubObject ): None, post_parameters ) - return UserKey.UserKey( self._requester, data, completed = True ) + return UserKey.UserKey(self._requester, data, completed=True) - def create_repo( self, name, description = GithubObject.NotSet, homepage = GithubObject.NotSet, private = GithubObject.NotSet, has_issues = GithubObject.NotSet, has_wiki = GithubObject.NotSet, has_downloads = GithubObject.NotSet ): - assert isinstance( name, ( str, unicode ) ), name - assert description is GithubObject.NotSet or isinstance( description, ( str, unicode ) ), description - assert homepage is GithubObject.NotSet or isinstance( homepage, ( str, unicode ) ), homepage - assert private is GithubObject.NotSet or isinstance( private, bool ), private - assert has_issues is GithubObject.NotSet or isinstance( has_issues, bool ), has_issues - assert has_wiki is GithubObject.NotSet or isinstance( has_wiki, bool ), has_wiki - assert has_downloads is GithubObject.NotSet or isinstance( has_downloads, bool ), has_downloads + def create_repo(self, name, description=GithubObject.NotSet, homepage=GithubObject.NotSet, private=GithubObject.NotSet, has_issues=GithubObject.NotSet, has_wiki=GithubObject.NotSet, has_downloads=GithubObject.NotSet): + assert isinstance(name, (str, unicode)), name + assert description is GithubObject.NotSet or isinstance(description, (str, unicode)), description + assert homepage is GithubObject.NotSet or isinstance(homepage, (str, unicode)), homepage + assert private is GithubObject.NotSet or isinstance(private, bool), private + assert has_issues is GithubObject.NotSet or isinstance(has_issues, bool), has_issues + assert has_wiki is GithubObject.NotSet or isinstance(has_wiki, bool), has_wiki + assert has_downloads is GithubObject.NotSet or isinstance(has_downloads, bool), has_downloads post_parameters = { "name": name, } if description is not GithubObject.NotSet: - post_parameters[ "description" ] = description + post_parameters["description"] = description if homepage is not GithubObject.NotSet: - post_parameters[ "homepage" ] = homepage + post_parameters["homepage"] = homepage if private is not GithubObject.NotSet: - post_parameters[ "private" ] = private + post_parameters["private"] = private if has_issues is not GithubObject.NotSet: - post_parameters[ "has_issues" ] = has_issues + post_parameters["has_issues"] = has_issues if has_wiki is not GithubObject.NotSet: - post_parameters[ "has_wiki" ] = has_wiki + post_parameters["has_wiki"] = has_wiki if has_downloads is not GithubObject.NotSet: - post_parameters[ "has_downloads" ] = has_downloads + post_parameters["has_downloads"] = has_downloads headers, data = self._requester.requestAndCheck( "POST", "/user/repos", None, post_parameters ) - return Repository.Repository( self._requester, data, completed = True ) + return Repository.Repository(self._requester, data, completed=True) - def edit( self, name = GithubObject.NotSet, email = GithubObject.NotSet, blog = GithubObject.NotSet, company = GithubObject.NotSet, location = GithubObject.NotSet, hireable = GithubObject.NotSet, bio = GithubObject.NotSet ): - assert name is GithubObject.NotSet or isinstance( name, ( str, unicode ) ), name - assert email is GithubObject.NotSet or isinstance( email, ( str, unicode ) ), email - assert blog is GithubObject.NotSet or isinstance( blog, ( str, unicode ) ), blog - assert company is GithubObject.NotSet or isinstance( company, ( str, unicode ) ), company - assert location is GithubObject.NotSet or isinstance( location, ( str, unicode ) ), location - assert hireable is GithubObject.NotSet or isinstance( hireable, bool ), hireable - assert bio is GithubObject.NotSet or isinstance( bio, ( str, unicode ) ), bio + def edit(self, name=GithubObject.NotSet, email=GithubObject.NotSet, blog=GithubObject.NotSet, company=GithubObject.NotSet, location=GithubObject.NotSet, hireable=GithubObject.NotSet, bio=GithubObject.NotSet): + assert name is GithubObject.NotSet or isinstance(name, (str, unicode)), name + assert email is GithubObject.NotSet or isinstance(email, (str, unicode)), email + assert blog is GithubObject.NotSet or isinstance(blog, (str, unicode)), blog + assert company is GithubObject.NotSet or isinstance(company, (str, unicode)), company + assert location is GithubObject.NotSet or isinstance(location, (str, unicode)), location + assert hireable is GithubObject.NotSet or isinstance(hireable, bool), hireable + assert bio is GithubObject.NotSet or isinstance(bio, (str, unicode)), bio post_parameters = dict() if name is not GithubObject.NotSet: - post_parameters[ "name" ] = name + post_parameters["name"] = name if email is not GithubObject.NotSet: - post_parameters[ "email" ] = email + post_parameters["email"] = email if blog is not GithubObject.NotSet: - post_parameters[ "blog" ] = blog + post_parameters["blog"] = blog if company is not GithubObject.NotSet: - post_parameters[ "company" ] = company + post_parameters["company"] = company if location is not GithubObject.NotSet: - post_parameters[ "location" ] = location + post_parameters["location"] = location if hireable is not GithubObject.NotSet: - post_parameters[ "hireable" ] = hireable + post_parameters["hireable"] = hireable if bio is not GithubObject.NotSet: - post_parameters[ "bio" ] = bio + post_parameters["bio"] = bio headers, data = self._requester.requestAndCheck( "PATCH", "/user", None, post_parameters ) - self._useAttributes( data ) + self._useAttributes(data) - def get_authorization( self, id ): - assert isinstance( id, int ), id + def get_authorization(self, id): + assert isinstance(id, int), id headers, data = self._requester.requestAndCheck( "GET", - "/authorizations/" + str( id ), + "/authorizations/" + str(id), None, None ) - return Authorization.Authorization( self._requester, data, completed = True ) + return Authorization.Authorization(self._requester, data, completed=True) - def get_authorizations( self ): + def get_authorizations(self): return PaginatedList.PaginatedList( Authorization.Authorization, self._requester, @@ -339,7 +340,7 @@ class AuthenticatedUser( GithubObject.GithubObject ): None ) - def get_emails( self ): + def get_emails(self): headers, data = self._requester.requestAndCheck( "GET", "/user/emails", @@ -348,7 +349,7 @@ class AuthenticatedUser( GithubObject.GithubObject ): ) return data - def get_events( self ): + def get_events(self): return PaginatedList.PaginatedList( Event.Event, self._requester, @@ -356,7 +357,7 @@ class AuthenticatedUser( GithubObject.GithubObject ): None ) - def get_followers( self ): + def get_followers(self): return PaginatedList.PaginatedList( NamedUser.NamedUser, self._requester, @@ -364,7 +365,7 @@ class AuthenticatedUser( GithubObject.GithubObject ): None ) - def get_following( self ): + def get_following(self): return PaginatedList.PaginatedList( NamedUser.NamedUser, self._requester, @@ -372,7 +373,7 @@ class AuthenticatedUser( GithubObject.GithubObject ): None ) - def get_gists( self ): + def get_gists(self): return PaginatedList.PaginatedList( Gist.Gist, self._requester, @@ -380,7 +381,7 @@ class AuthenticatedUser( GithubObject.GithubObject ): None ) - def get_issues( self ): + def get_issues(self): return PaginatedList.PaginatedList( Issue.Issue, self._requester, @@ -388,17 +389,17 @@ class AuthenticatedUser( GithubObject.GithubObject ): None ) - def get_key( self, id ): - assert isinstance( id, int ), id + def get_key(self, id): + assert isinstance(id, int), id headers, data = self._requester.requestAndCheck( "GET", - "/user/keys/" + str( id ), + "/user/keys/" + str(id), None, None ) - return UserKey.UserKey( self._requester, data, completed = True ) + return UserKey.UserKey(self._requester, data, completed=True) - def get_keys( self ): + def get_keys(self): return PaginatedList.PaginatedList( UserKey.UserKey, self._requester, @@ -406,8 +407,8 @@ class AuthenticatedUser( GithubObject.GithubObject ): None ) - def get_organization_events( self, org ): - assert isinstance( org, Organization.Organization ), org + def get_organization_events(self, org): + assert isinstance(org, Organization.Organization), org return PaginatedList.PaginatedList( Event.Event, self._requester, @@ -415,7 +416,7 @@ class AuthenticatedUser( GithubObject.GithubObject ): None ) - def get_orgs( self ): + def get_orgs(self): return PaginatedList.PaginatedList( Organization.Organization, self._requester, @@ -423,27 +424,27 @@ class AuthenticatedUser( GithubObject.GithubObject ): None ) - def get_repo( self, name ): - assert isinstance( name, ( str, unicode ) ), name + def get_repo(self, name): + assert isinstance(name, (str, unicode)), name headers, data = self._requester.requestAndCheck( "GET", "/repos/" + self.login + "/" + name, None, None ) - return Repository.Repository( self._requester, data, completed = True ) + return Repository.Repository(self._requester, data, completed=True) - def get_repos( self, type = GithubObject.NotSet, sort = GithubObject.NotSet, direction = GithubObject.NotSet ): - assert type is GithubObject.NotSet or isinstance( type, ( str, unicode ) ), type - assert sort is GithubObject.NotSet or isinstance( sort, ( str, unicode ) ), sort - assert direction is GithubObject.NotSet or isinstance( direction, ( str, unicode ) ), direction + def get_repos(self, type=GithubObject.NotSet, sort=GithubObject.NotSet, direction=GithubObject.NotSet): + assert type is GithubObject.NotSet or isinstance(type, (str, unicode)), type + assert sort is GithubObject.NotSet or isinstance(sort, (str, unicode)), sort + assert direction is GithubObject.NotSet or isinstance(direction, (str, unicode)), direction url_parameters = dict() if type is not GithubObject.NotSet: - url_parameters[ "type" ] = type + url_parameters["type"] = type if sort is not GithubObject.NotSet: - url_parameters[ "sort" ] = sort + url_parameters["sort"] = sort if direction is not GithubObject.NotSet: - url_parameters[ "direction" ] = direction + url_parameters["direction"] = direction return PaginatedList.PaginatedList( Repository.Repository, self._requester, @@ -451,7 +452,7 @@ class AuthenticatedUser( GithubObject.GithubObject ): url_parameters ) - def get_starred( self ): + def get_starred(self): return PaginatedList.PaginatedList( Repository.Repository, self._requester, @@ -459,7 +460,7 @@ class AuthenticatedUser( GithubObject.GithubObject ): None ) - def get_starred_gists( self ): + def get_starred_gists(self): return PaginatedList.PaginatedList( Gist.Gist, self._requester, @@ -467,7 +468,7 @@ class AuthenticatedUser( GithubObject.GithubObject ): None ) - def get_subscriptions( self ): + def get_subscriptions(self): return PaginatedList.PaginatedList( Repository.Repository, self._requester, @@ -475,7 +476,7 @@ class AuthenticatedUser( GithubObject.GithubObject ): None ) - def get_watched( self ): + def get_watched(self): return PaginatedList.PaginatedList( Repository.Repository, self._requester, @@ -483,8 +484,8 @@ class AuthenticatedUser( GithubObject.GithubObject ): None ) - def has_in_following( self, following ): - assert isinstance( following, NamedUser.NamedUser ), following + def has_in_following(self, following): + assert isinstance(following, NamedUser.NamedUser), following status, headers, data = self._requester.requestRaw( "GET", "/user/following/" + following._identity, @@ -493,8 +494,8 @@ class AuthenticatedUser( GithubObject.GithubObject ): ) return status == 204 - def has_in_starred( self, starred ): - assert isinstance( starred, Repository.Repository ), starred + def has_in_starred(self, starred): + assert isinstance(starred, Repository.Repository), starred status, headers, data = self._requester.requestRaw( "GET", "/user/starred/" + starred._identity, @@ -503,8 +504,8 @@ class AuthenticatedUser( GithubObject.GithubObject ): ) return status == 204 - def has_in_subscriptions( self, subscription ): - assert isinstance( subscription, Repository.Repository ), subscription + def has_in_subscriptions(self, subscription): + assert isinstance(subscription, Repository.Repository), subscription status, headers, data = self._requester.requestRaw( "GET", "/user/subscriptions/" + subscription._identity, @@ -513,8 +514,8 @@ class AuthenticatedUser( GithubObject.GithubObject ): ) return status == 204 - def has_in_watched( self, watched ): - assert isinstance( watched, Repository.Repository ), watched + def has_in_watched(self, watched): + assert isinstance(watched, Repository.Repository), watched status, headers, data = self._requester.requestRaw( "GET", "/user/watched/" + watched._identity, @@ -523,8 +524,8 @@ class AuthenticatedUser( GithubObject.GithubObject ): ) return status == 204 - def remove_from_emails( self, *emails ): - assert all( isinstance( element, ( str, unicode ) ) for element in emails ), emails + def remove_from_emails(self, *emails): + assert all(isinstance(element, (str, unicode)) for element in emails), emails post_parameters = emails headers, data = self._requester.requestAndCheck( "DELETE", @@ -533,8 +534,8 @@ class AuthenticatedUser( GithubObject.GithubObject ): post_parameters ) - def remove_from_following( self, following ): - assert isinstance( following, NamedUser.NamedUser ), following + def remove_from_following(self, following): + assert isinstance(following, NamedUser.NamedUser), following headers, data = self._requester.requestAndCheck( "DELETE", "/user/following/" + following._identity, @@ -542,8 +543,8 @@ class AuthenticatedUser( GithubObject.GithubObject ): None ) - def remove_from_starred( self, starred ): - assert isinstance( starred, Repository.Repository ), starred + def remove_from_starred(self, starred): + assert isinstance(starred, Repository.Repository), starred headers, data = self._requester.requestAndCheck( "DELETE", "/user/starred/" + starred._identity, @@ -551,8 +552,8 @@ class AuthenticatedUser( GithubObject.GithubObject ): None ) - def remove_from_subscriptions( self, subscription ): - assert isinstance( subscription, Repository.Repository ), subscription + def remove_from_subscriptions(self, subscription): + assert isinstance(subscription, Repository.Repository), subscription headers, data = self._requester.requestAndCheck( "DELETE", "/user/subscriptions/" + subscription._identity, @@ -560,8 +561,8 @@ class AuthenticatedUser( GithubObject.GithubObject ): None ) - def remove_from_watched( self, watched ): - assert isinstance( watched, Repository.Repository ), watched + def remove_from_watched(self, watched): + assert isinstance(watched, Repository.Repository), watched headers, data = self._requester.requestAndCheck( "DELETE", "/user/watched/" + watched._identity, @@ -569,7 +570,7 @@ class AuthenticatedUser( GithubObject.GithubObject ): None ) - def _initAttributes( self ): + def _initAttributes(self): self._avatar_url = GithubObject.NotSet self._bio = GithubObject.NotSet self._blog = GithubObject.NotSet @@ -596,79 +597,79 @@ class AuthenticatedUser( GithubObject.GithubObject ): self._type = GithubObject.NotSet self._url = GithubObject.NotSet - def _useAttributes( self, attributes ): - if "avatar_url" in attributes: # pragma no branch - assert attributes[ "avatar_url" ] is None or isinstance( attributes[ "avatar_url" ], ( str, unicode ) ), attributes[ "avatar_url" ] - self._avatar_url = attributes[ "avatar_url" ] - if "bio" in attributes: # pragma no branch - assert attributes[ "bio" ] is None or isinstance( attributes[ "bio" ], ( str, unicode ) ), attributes[ "bio" ] - self._bio = attributes[ "bio" ] - if "blog" in attributes: # pragma no branch - assert attributes[ "blog" ] is None or isinstance( attributes[ "blog" ], ( str, unicode ) ), attributes[ "blog" ] - self._blog = attributes[ "blog" ] - if "collaborators" in attributes: # pragma no branch - assert attributes[ "collaborators" ] is None or isinstance( attributes[ "collaborators" ], int ), attributes[ "collaborators" ] - self._collaborators = attributes[ "collaborators" ] - if "company" in attributes: # pragma no branch - assert attributes[ "company" ] is None or isinstance( attributes[ "company" ], ( str, unicode ) ), attributes[ "company" ] - self._company = attributes[ "company" ] - if "created_at" in attributes: # pragma no branch - assert attributes[ "created_at" ] is None or isinstance( attributes[ "created_at" ], ( str, unicode ) ), attributes[ "created_at" ] - self._created_at = self._parseDatetime( attributes[ "created_at" ] ) - if "disk_usage" in attributes: # pragma no branch - assert attributes[ "disk_usage" ] is None or isinstance( attributes[ "disk_usage" ], int ), attributes[ "disk_usage" ] - self._disk_usage = attributes[ "disk_usage" ] - if "email" in attributes: # pragma no branch - assert attributes[ "email" ] is None or isinstance( attributes[ "email" ], ( str, unicode ) ), attributes[ "email" ] - self._email = attributes[ "email" ] - if "followers" in attributes: # pragma no branch - assert attributes[ "followers" ] is None or isinstance( attributes[ "followers" ], int ), attributes[ "followers" ] - self._followers = attributes[ "followers" ] - if "following" in attributes: # pragma no branch - assert attributes[ "following" ] is None or isinstance( attributes[ "following" ], int ), attributes[ "following" ] - self._following = attributes[ "following" ] - if "gravatar_id" in attributes: # pragma no branch - assert attributes[ "gravatar_id" ] is None or isinstance( attributes[ "gravatar_id" ], ( str, unicode ) ), attributes[ "gravatar_id" ] - self._gravatar_id = attributes[ "gravatar_id" ] - if "hireable" in attributes: # pragma no branch - assert attributes[ "hireable" ] is None or isinstance( attributes[ "hireable" ], bool ), attributes[ "hireable" ] - self._hireable = attributes[ "hireable" ] - if "html_url" in attributes: # pragma no branch - assert attributes[ "html_url" ] is None or isinstance( attributes[ "html_url" ], ( str, unicode ) ), attributes[ "html_url" ] - self._html_url = attributes[ "html_url" ] - if "id" in attributes: # pragma no branch - assert attributes[ "id" ] is None or isinstance( attributes[ "id" ], int ), attributes[ "id" ] - self._id = attributes[ "id" ] - if "location" in attributes: # pragma no branch - assert attributes[ "location" ] is None or isinstance( attributes[ "location" ], ( str, unicode ) ), attributes[ "location" ] - self._location = attributes[ "location" ] - if "login" in attributes: # pragma no branch - assert attributes[ "login" ] is None or isinstance( attributes[ "login" ], ( str, unicode ) ), attributes[ "login" ] - self._login = attributes[ "login" ] - if "name" in attributes: # pragma no branch - assert attributes[ "name" ] is None or isinstance( attributes[ "name" ], ( str, unicode ) ), attributes[ "name" ] - self._name = attributes[ "name" ] - if "owned_private_repos" in attributes: # pragma no branch - assert attributes[ "owned_private_repos" ] is None or isinstance( attributes[ "owned_private_repos" ], int ), attributes[ "owned_private_repos" ] - self._owned_private_repos = attributes[ "owned_private_repos" ] - if "plan" in attributes: # pragma no branch - assert attributes[ "plan" ] is None or isinstance( attributes[ "plan" ], dict ), attributes[ "plan" ] - self._plan = None if attributes[ "plan" ] is None else Plan.Plan( self._requester, attributes[ "plan" ], completed = False ) - if "private_gists" in attributes: # pragma no branch - assert attributes[ "private_gists" ] is None or isinstance( attributes[ "private_gists" ], int ), attributes[ "private_gists" ] - self._private_gists = attributes[ "private_gists" ] - if "public_gists" in attributes: # pragma no branch - assert attributes[ "public_gists" ] is None or isinstance( attributes[ "public_gists" ], int ), attributes[ "public_gists" ] - self._public_gists = attributes[ "public_gists" ] - if "public_repos" in attributes: # pragma no branch - assert attributes[ "public_repos" ] is None or isinstance( attributes[ "public_repos" ], int ), attributes[ "public_repos" ] - self._public_repos = attributes[ "public_repos" ] - if "total_private_repos" in attributes: # pragma no branch - assert attributes[ "total_private_repos" ] is None or isinstance( attributes[ "total_private_repos" ], int ), attributes[ "total_private_repos" ] - self._total_private_repos = attributes[ "total_private_repos" ] - if "type" in attributes: # pragma no branch - assert attributes[ "type" ] is None or isinstance( attributes[ "type" ], ( str, unicode ) ), attributes[ "type" ] - self._type = attributes[ "type" ] - if "url" in attributes: # pragma no branch - assert attributes[ "url" ] is None or isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ] - self._url = attributes[ "url" ] + def _useAttributes(self, attributes): + if "avatar_url" in attributes: # pragma no branch + assert attributes["avatar_url"] is None or isinstance(attributes["avatar_url"], (str, unicode)), attributes["avatar_url"] + self._avatar_url = attributes["avatar_url"] + if "bio" in attributes: # pragma no branch + assert attributes["bio"] is None or isinstance(attributes["bio"], (str, unicode)), attributes["bio"] + self._bio = attributes["bio"] + if "blog" in attributes: # pragma no branch + assert attributes["blog"] is None or isinstance(attributes["blog"], (str, unicode)), attributes["blog"] + self._blog = attributes["blog"] + if "collaborators" in attributes: # pragma no branch + assert attributes["collaborators"] is None or isinstance(attributes["collaborators"], int), attributes["collaborators"] + self._collaborators = attributes["collaborators"] + if "company" in attributes: # pragma no branch + assert attributes["company"] is None or isinstance(attributes["company"], (str, unicode)), attributes["company"] + self._company = attributes["company"] + if "created_at" in attributes: # pragma no branch + assert attributes["created_at"] is None or isinstance(attributes["created_at"], (str, unicode)), attributes["created_at"] + self._created_at = self._parseDatetime(attributes["created_at"]) + if "disk_usage" in attributes: # pragma no branch + assert attributes["disk_usage"] is None or isinstance(attributes["disk_usage"], int), attributes["disk_usage"] + self._disk_usage = attributes["disk_usage"] + if "email" in attributes: # pragma no branch + assert attributes["email"] is None or isinstance(attributes["email"], (str, unicode)), attributes["email"] + self._email = attributes["email"] + if "followers" in attributes: # pragma no branch + assert attributes["followers"] is None or isinstance(attributes["followers"], int), attributes["followers"] + self._followers = attributes["followers"] + if "following" in attributes: # pragma no branch + assert attributes["following"] is None or isinstance(attributes["following"], int), attributes["following"] + self._following = attributes["following"] + if "gravatar_id" in attributes: # pragma no branch + assert attributes["gravatar_id"] is None or isinstance(attributes["gravatar_id"], (str, unicode)), attributes["gravatar_id"] + self._gravatar_id = attributes["gravatar_id"] + if "hireable" in attributes: # pragma no branch + assert attributes["hireable"] is None or isinstance(attributes["hireable"], bool), attributes["hireable"] + self._hireable = attributes["hireable"] + if "html_url" in attributes: # pragma no branch + assert attributes["html_url"] is None or isinstance(attributes["html_url"], (str, unicode)), attributes["html_url"] + self._html_url = attributes["html_url"] + if "id" in attributes: # pragma no branch + assert attributes["id"] is None or isinstance(attributes["id"], int), attributes["id"] + self._id = attributes["id"] + if "location" in attributes: # pragma no branch + assert attributes["location"] is None or isinstance(attributes["location"], (str, unicode)), attributes["location"] + self._location = attributes["location"] + if "login" in attributes: # pragma no branch + assert attributes["login"] is None or isinstance(attributes["login"], (str, unicode)), attributes["login"] + self._login = attributes["login"] + if "name" in attributes: # pragma no branch + assert attributes["name"] is None or isinstance(attributes["name"], (str, unicode)), attributes["name"] + self._name = attributes["name"] + if "owned_private_repos" in attributes: # pragma no branch + assert attributes["owned_private_repos"] is None or isinstance(attributes["owned_private_repos"], int), attributes["owned_private_repos"] + self._owned_private_repos = attributes["owned_private_repos"] + if "plan" in attributes: # pragma no branch + assert attributes["plan"] is None or isinstance(attributes["plan"], dict), attributes["plan"] + self._plan = None if attributes["plan"] is None else Plan.Plan(self._requester, attributes["plan"], completed=False) + if "private_gists" in attributes: # pragma no branch + assert attributes["private_gists"] is None or isinstance(attributes["private_gists"], int), attributes["private_gists"] + self._private_gists = attributes["private_gists"] + if "public_gists" in attributes: # pragma no branch + assert attributes["public_gists"] is None or isinstance(attributes["public_gists"], int), attributes["public_gists"] + self._public_gists = attributes["public_gists"] + if "public_repos" in attributes: # pragma no branch + assert attributes["public_repos"] is None or isinstance(attributes["public_repos"], int), attributes["public_repos"] + self._public_repos = attributes["public_repos"] + if "total_private_repos" in attributes: # pragma no branch + assert attributes["total_private_repos"] is None or isinstance(attributes["total_private_repos"], int), attributes["total_private_repos"] + self._total_private_repos = attributes["total_private_repos"] + if "type" in attributes: # pragma no branch + assert attributes["type"] is None or isinstance(attributes["type"], (str, unicode)), attributes["type"] + self._type = attributes["type"] + if "url" in attributes: # pragma no branch + assert attributes["url"] is None or isinstance(attributes["url"], (str, unicode)), attributes["url"] + self._url = attributes["url"] diff --git a/github/Authorization.py b/github/Authorization.py index f437d6ad..1271624c 100644 --- a/github/Authorization.py +++ b/github/Authorization.py @@ -15,53 +15,54 @@ import GithubObject import AuthorizationApplication -class Authorization( GithubObject.GithubObject ): + +class Authorization(GithubObject.GithubObject): @property - def app( self ): - self._completeIfNotSet( self._app ) - return self._NoneIfNotSet( self._app ) + def app(self): + self._completeIfNotSet(self._app) + return self._NoneIfNotSet(self._app) @property - def created_at( self ): - self._completeIfNotSet( self._created_at ) - return self._NoneIfNotSet( self._created_at ) + def created_at(self): + self._completeIfNotSet(self._created_at) + return self._NoneIfNotSet(self._created_at) @property - def id( self ): - self._completeIfNotSet( self._id ) - return self._NoneIfNotSet( self._id ) + def id(self): + self._completeIfNotSet(self._id) + return self._NoneIfNotSet(self._id) @property - def note( self ): - self._completeIfNotSet( self._note ) - return self._NoneIfNotSet( self._note ) + def note(self): + self._completeIfNotSet(self._note) + return self._NoneIfNotSet(self._note) @property - def note_url( self ): - self._completeIfNotSet( self._note_url ) - return self._NoneIfNotSet( self._note_url ) + def note_url(self): + self._completeIfNotSet(self._note_url) + return self._NoneIfNotSet(self._note_url) @property - def scopes( self ): - self._completeIfNotSet( self._scopes ) - return self._NoneIfNotSet( self._scopes ) + def scopes(self): + self._completeIfNotSet(self._scopes) + return self._NoneIfNotSet(self._scopes) @property - def token( self ): - self._completeIfNotSet( self._token ) - return self._NoneIfNotSet( self._token ) + def token(self): + self._completeIfNotSet(self._token) + return self._NoneIfNotSet(self._token) @property - def updated_at( self ): - self._completeIfNotSet( self._updated_at ) - return self._NoneIfNotSet( self._updated_at ) + def updated_at(self): + self._completeIfNotSet(self._updated_at) + return self._NoneIfNotSet(self._updated_at) @property - def url( self ): - self._completeIfNotSet( self._url ) - return self._NoneIfNotSet( self._url ) + def url(self): + self._completeIfNotSet(self._url) + return self._NoneIfNotSet(self._url) - def delete( self ): + def delete(self): headers, data = self._requester.requestAndCheck( "DELETE", self.url, @@ -69,32 +70,32 @@ class Authorization( GithubObject.GithubObject ): None ) - def edit( self, scopes = GithubObject.NotSet, add_scopes = GithubObject.NotSet, remove_scopes = GithubObject.NotSet, note = GithubObject.NotSet, note_url = GithubObject.NotSet ): - assert scopes is GithubObject.NotSet or all( isinstance( element, ( str, unicode ) ) for element in scopes ), scopes - assert add_scopes is GithubObject.NotSet or all( isinstance( element, ( str, unicode ) ) for element in add_scopes ), add_scopes - assert remove_scopes is GithubObject.NotSet or all( isinstance( element, ( str, unicode ) ) for element in remove_scopes ), remove_scopes - assert note is GithubObject.NotSet or isinstance( note, ( str, unicode ) ), note - assert note_url is GithubObject.NotSet or isinstance( note_url, ( str, unicode ) ), note_url + def edit(self, scopes=GithubObject.NotSet, add_scopes=GithubObject.NotSet, remove_scopes=GithubObject.NotSet, note=GithubObject.NotSet, note_url=GithubObject.NotSet): + assert scopes is GithubObject.NotSet or all(isinstance(element, (str, unicode)) for element in scopes), scopes + assert add_scopes is GithubObject.NotSet or all(isinstance(element, (str, unicode)) for element in add_scopes), add_scopes + assert remove_scopes is GithubObject.NotSet or all(isinstance(element, (str, unicode)) for element in remove_scopes), remove_scopes + assert note is GithubObject.NotSet or isinstance(note, (str, unicode)), note + assert note_url is GithubObject.NotSet or isinstance(note_url, (str, unicode)), note_url post_parameters = dict() if scopes is not GithubObject.NotSet: - post_parameters[ "scopes" ] = scopes + post_parameters["scopes"] = scopes if add_scopes is not GithubObject.NotSet: - post_parameters[ "add_scopes" ] = add_scopes + post_parameters["add_scopes"] = add_scopes if remove_scopes is not GithubObject.NotSet: - post_parameters[ "remove_scopes" ] = remove_scopes + post_parameters["remove_scopes"] = remove_scopes if note is not GithubObject.NotSet: - post_parameters[ "note" ] = note + post_parameters["note"] = note if note_url is not GithubObject.NotSet: - post_parameters[ "note_url" ] = note_url + post_parameters["note_url"] = note_url headers, data = self._requester.requestAndCheck( "PATCH", self.url, None, post_parameters ) - self._useAttributes( data ) + self._useAttributes(data) - def _initAttributes( self ): + def _initAttributes(self): self._app = GithubObject.NotSet self._created_at = GithubObject.NotSet self._id = GithubObject.NotSet @@ -105,31 +106,31 @@ class Authorization( GithubObject.GithubObject ): self._updated_at = GithubObject.NotSet self._url = GithubObject.NotSet - def _useAttributes( self, attributes ): - if "app" in attributes: # pragma no branch - assert attributes[ "app" ] is None or isinstance( attributes[ "app" ], dict ), attributes[ "app" ] - self._app = None if attributes[ "app" ] is None else AuthorizationApplication.AuthorizationApplication( self._requester, attributes[ "app" ], completed = False ) - if "created_at" in attributes: # pragma no branch - assert attributes[ "created_at" ] is None or isinstance( attributes[ "created_at" ], ( str, unicode ) ), attributes[ "created_at" ] - self._created_at = self._parseDatetime( attributes[ "created_at" ] ) - if "id" in attributes: # pragma no branch - assert attributes[ "id" ] is None or isinstance( attributes[ "id" ], int ), attributes[ "id" ] - self._id = attributes[ "id" ] - if "note" in attributes: # pragma no branch - assert attributes[ "note" ] is None or isinstance( attributes[ "note" ], ( str, unicode ) ), attributes[ "note" ] - self._note = attributes[ "note" ] - if "note_url" in attributes: # pragma no branch - assert attributes[ "note_url" ] is None or isinstance( attributes[ "note_url" ], ( str, unicode ) ), attributes[ "note_url" ] - self._note_url = attributes[ "note_url" ] - if "scopes" in attributes: # pragma no branch - assert attributes[ "scopes" ] is None or all( isinstance( element, ( str, unicode ) ) for element in attributes[ "scopes" ] ), attributes[ "scopes" ] - self._scopes = attributes[ "scopes" ] - if "token" in attributes: # pragma no branch - assert attributes[ "token" ] is None or isinstance( attributes[ "token" ], ( str, unicode ) ), attributes[ "token" ] - self._token = attributes[ "token" ] - if "updated_at" in attributes: # pragma no branch - assert attributes[ "updated_at" ] is None or isinstance( attributes[ "updated_at" ], ( str, unicode ) ), attributes[ "updated_at" ] - self._updated_at = self._parseDatetime( attributes[ "updated_at" ] ) - if "url" in attributes: # pragma no branch - assert attributes[ "url" ] is None or isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ] - self._url = attributes[ "url" ] + def _useAttributes(self, attributes): + if "app" in attributes: # pragma no branch + assert attributes["app"] is None or isinstance(attributes["app"], dict), attributes["app"] + self._app = None if attributes["app"] is None else AuthorizationApplication.AuthorizationApplication(self._requester, attributes["app"], completed=False) + if "created_at" in attributes: # pragma no branch + assert attributes["created_at"] is None or isinstance(attributes["created_at"], (str, unicode)), attributes["created_at"] + self._created_at = self._parseDatetime(attributes["created_at"]) + if "id" in attributes: # pragma no branch + assert attributes["id"] is None or isinstance(attributes["id"], int), attributes["id"] + self._id = attributes["id"] + if "note" in attributes: # pragma no branch + assert attributes["note"] is None or isinstance(attributes["note"], (str, unicode)), attributes["note"] + self._note = attributes["note"] + if "note_url" in attributes: # pragma no branch + assert attributes["note_url"] is None or isinstance(attributes["note_url"], (str, unicode)), attributes["note_url"] + self._note_url = attributes["note_url"] + if "scopes" in attributes: # pragma no branch + assert attributes["scopes"] is None or all(isinstance(element, (str, unicode)) for element in attributes["scopes"]), attributes["scopes"] + self._scopes = attributes["scopes"] + if "token" in attributes: # pragma no branch + assert attributes["token"] is None or isinstance(attributes["token"], (str, unicode)), attributes["token"] + self._token = attributes["token"] + if "updated_at" in attributes: # pragma no branch + assert attributes["updated_at"] is None or isinstance(attributes["updated_at"], (str, unicode)), attributes["updated_at"] + self._updated_at = self._parseDatetime(attributes["updated_at"]) + if "url" in attributes: # pragma no branch + assert attributes["url"] is None or isinstance(attributes["url"], (str, unicode)), attributes["url"] + self._url = attributes["url"] diff --git a/github/AuthorizationApplication.py b/github/AuthorizationApplication.py index ea79de42..ee23a727 100644 --- a/github/AuthorizationApplication.py +++ b/github/AuthorizationApplication.py @@ -13,25 +13,26 @@ import GithubObject -class AuthorizationApplication( GithubObject.GithubObject ): + +class AuthorizationApplication(GithubObject.GithubObject): @property - def name( self ): - self._completeIfNotSet( self._name ) - return self._NoneIfNotSet( self._name ) + def name(self): + self._completeIfNotSet(self._name) + return self._NoneIfNotSet(self._name) @property - def url( self ): - self._completeIfNotSet( self._url ) - return self._NoneIfNotSet( self._url ) + def url(self): + self._completeIfNotSet(self._url) + return self._NoneIfNotSet(self._url) - def _initAttributes( self ): + def _initAttributes(self): self._name = GithubObject.NotSet self._url = GithubObject.NotSet - def _useAttributes( self, attributes ): - if "name" in attributes: # pragma no branch - assert attributes[ "name" ] is None or isinstance( attributes[ "name" ], ( str, unicode ) ), attributes[ "name" ] - self._name = attributes[ "name" ] - if "url" in attributes: # pragma no branch - assert attributes[ "url" ] is None or isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ] - self._url = attributes[ "url" ] + def _useAttributes(self, attributes): + if "name" in attributes: # pragma no branch + assert attributes["name"] is None or isinstance(attributes["name"], (str, unicode)), attributes["name"] + self._name = attributes["name"] + if "url" in attributes: # pragma no branch + assert attributes["url"] is None or isinstance(attributes["url"], (str, unicode)), attributes["url"] + self._url = attributes["url"] diff --git a/github/Branch.py b/github/Branch.py index f37da93e..4c99ed11 100644 --- a/github/Branch.py +++ b/github/Branch.py @@ -15,23 +15,24 @@ import GithubObject import Commit -class Branch( GithubObject.BasicGithubObject ): + +class Branch(GithubObject.BasicGithubObject): @property - def commit( self ): - return self._NoneIfNotSet( self._commit ) + def commit(self): + return self._NoneIfNotSet(self._commit) @property - def name( self ): - return self._NoneIfNotSet( self._name ) + def name(self): + return self._NoneIfNotSet(self._name) - def _initAttributes( self ): + def _initAttributes(self): self._commit = GithubObject.NotSet self._name = GithubObject.NotSet - def _useAttributes( self, attributes ): - if "commit" in attributes: # pragma no branch - assert attributes[ "commit" ] is None or isinstance( attributes[ "commit" ], dict ), attributes[ "commit" ] - self._commit = None if attributes[ "commit" ] is None else Commit.Commit( self._requester, attributes[ "commit" ], completed = False ) - if "name" in attributes: # pragma no branch - assert attributes[ "name" ] is None or isinstance( attributes[ "name" ], ( str, unicode ) ), attributes[ "name" ] - self._name = attributes[ "name" ] + def _useAttributes(self, attributes): + if "commit" in attributes: # pragma no branch + assert attributes["commit"] is None or isinstance(attributes["commit"], dict), attributes["commit"] + self._commit = None if attributes["commit"] is None else Commit.Commit(self._requester, attributes["commit"], completed=False) + if "name" in attributes: # pragma no branch + assert attributes["name"] is None or isinstance(attributes["name"], (str, unicode)), attributes["name"] + self._name = attributes["name"] diff --git a/github/Commit.py b/github/Commit.py index 7db6a17f..c0e8d075 100644 --- a/github/Commit.py +++ b/github/Commit.py @@ -22,89 +22,90 @@ import CommitStats import Commit import CommitComment -class Commit( GithubObject.GithubObject ): + +class Commit(GithubObject.GithubObject): @property - def author( self ): - self._completeIfNotSet( self._author ) - return self._NoneIfNotSet( self._author ) + def author(self): + self._completeIfNotSet(self._author) + return self._NoneIfNotSet(self._author) @property - def commit( self ): - self._completeIfNotSet( self._commit ) - return self._NoneIfNotSet( self._commit ) + def commit(self): + self._completeIfNotSet(self._commit) + return self._NoneIfNotSet(self._commit) @property - def committer( self ): - self._completeIfNotSet( self._committer ) - return self._NoneIfNotSet( self._committer ) + def committer(self): + self._completeIfNotSet(self._committer) + return self._NoneIfNotSet(self._committer) @property - def files( self ): - self._completeIfNotSet( self._files ) - return self._NoneIfNotSet( self._files ) + def files(self): + self._completeIfNotSet(self._files) + return self._NoneIfNotSet(self._files) @property - def parents( self ): - self._completeIfNotSet( self._parents ) - return self._NoneIfNotSet( self._parents ) + def parents(self): + self._completeIfNotSet(self._parents) + return self._NoneIfNotSet(self._parents) @property - def sha( self ): - self._completeIfNotSet( self._sha ) - return self._NoneIfNotSet( self._sha ) + def sha(self): + self._completeIfNotSet(self._sha) + return self._NoneIfNotSet(self._sha) @property - def stats( self ): - self._completeIfNotSet( self._stats ) - return self._NoneIfNotSet( self._stats ) + def stats(self): + self._completeIfNotSet(self._stats) + return self._NoneIfNotSet(self._stats) @property - def url( self ): - self._completeIfNotSet( self._url ) - return self._NoneIfNotSet( self._url ) + def url(self): + self._completeIfNotSet(self._url) + return self._NoneIfNotSet(self._url) - def create_comment( self, body, line = GithubObject.NotSet, path = GithubObject.NotSet, position = GithubObject.NotSet ): - assert isinstance( body, ( str, unicode ) ), body - assert line is GithubObject.NotSet or isinstance( line, int ), line - assert path is GithubObject.NotSet or isinstance( path, ( str, unicode ) ), path - assert position is GithubObject.NotSet or isinstance( position, int ), position + def create_comment(self, body, line=GithubObject.NotSet, path=GithubObject.NotSet, position=GithubObject.NotSet): + assert isinstance(body, (str, unicode)), body + assert line is GithubObject.NotSet or isinstance(line, int), line + assert path is GithubObject.NotSet or isinstance(path, (str, unicode)), path + assert position is GithubObject.NotSet or isinstance(position, int), position post_parameters = { "body": body, } if line is not GithubObject.NotSet: - post_parameters[ "line" ] = line + post_parameters["line"] = line if path is not GithubObject.NotSet: - post_parameters[ "path" ] = path + post_parameters["path"] = path if position is not GithubObject.NotSet: - post_parameters[ "position" ] = position + post_parameters["position"] = position headers, data = self._requester.requestAndCheck( "POST", self.url + "/comments", None, post_parameters ) - return CommitComment.CommitComment( self._requester, data, completed = True ) + return CommitComment.CommitComment(self._requester, data, completed=True) - def create_status( self, state, target_url = GithubObject.NotSet, description = GithubObject.NotSet ): - assert isinstance( state, ( str, unicode ) ), state - assert target_url is GithubObject.NotSet or isinstance( target_url, ( str, unicode ) ), target_url - assert description is GithubObject.NotSet or isinstance( description, ( str, unicode ) ), description + def create_status(self, state, target_url=GithubObject.NotSet, description=GithubObject.NotSet): + assert isinstance(state, (str, unicode)), state + assert target_url is GithubObject.NotSet or isinstance(target_url, (str, unicode)), target_url + assert description is GithubObject.NotSet or isinstance(description, (str, unicode)), description post_parameters = { "state": state, } if target_url is not GithubObject.NotSet: - post_parameters[ "target_url" ] = target_url + post_parameters["target_url"] = target_url if description is not GithubObject.NotSet: - post_parameters[ "description" ] = description + post_parameters["description"] = description headers, data = self._requester.requestAndCheck( "POST", - self._parentUrl( self._parentUrl( self.url ) ) + "/statuses/" + self.sha, + self._parentUrl(self._parentUrl(self.url)) + "/statuses/" + self.sha, None, post_parameters ) - return CommitStatus.CommitStatus( self._requester, data, completed = True ) + return CommitStatus.CommitStatus(self._requester, data, completed=True) - def get_comments( self ): + def get_comments(self): return PaginatedList.PaginatedList( CommitComment.CommitComment, self._requester, @@ -112,19 +113,19 @@ class Commit( GithubObject.GithubObject ): None ) - def get_statuses( self ): + def get_statuses(self): return PaginatedList.PaginatedList( CommitStatus.CommitStatus, self._requester, - self._parentUrl( self._parentUrl( self.url ) ) + "/statuses/" + self.sha, + self._parentUrl(self._parentUrl(self.url)) + "/statuses/" + self.sha, None ) @property - def _identity( self ): + def _identity(self): return self.sha - def _initAttributes( self ): + def _initAttributes(self): self._author = GithubObject.NotSet self._commit = GithubObject.NotSet self._committer = GithubObject.NotSet @@ -134,34 +135,34 @@ class Commit( GithubObject.GithubObject ): self._stats = GithubObject.NotSet self._url = GithubObject.NotSet - def _useAttributes( self, attributes ): - if "author" in attributes: # pragma no branch - assert attributes[ "author" ] is None or isinstance( attributes[ "author" ], dict ), attributes[ "author" ] - self._author = None if attributes[ "author" ] is None else NamedUser.NamedUser( self._requester, attributes[ "author" ], completed = False ) - if "commit" in attributes: # pragma no branch - assert attributes[ "commit" ] is None or isinstance( attributes[ "commit" ], dict ), attributes[ "commit" ] - self._commit = None if attributes[ "commit" ] is None else GitCommit.GitCommit( self._requester, attributes[ "commit" ], completed = False ) - if "committer" in attributes: # pragma no branch - assert attributes[ "committer" ] is None or isinstance( attributes[ "committer" ], dict ), attributes[ "committer" ] - self._committer = None if attributes[ "committer" ] is None else NamedUser.NamedUser( self._requester, attributes[ "committer" ], completed = False ) - if "files" in attributes: # pragma no branch - assert attributes[ "files" ] is None or all( isinstance( element, dict ) for element in attributes[ "files" ] ), attributes[ "files" ] - self._files = None if attributes[ "files" ] is None else [ - File.File( self._requester, element, completed = False ) - for element in attributes[ "files" ] + def _useAttributes(self, attributes): + if "author" in attributes: # pragma no branch + assert attributes["author"] is None or isinstance(attributes["author"], dict), attributes["author"] + self._author = None if attributes["author"] is None else NamedUser.NamedUser(self._requester, attributes["author"], completed=False) + if "commit" in attributes: # pragma no branch + assert attributes["commit"] is None or isinstance(attributes["commit"], dict), attributes["commit"] + self._commit = None if attributes["commit"] is None else GitCommit.GitCommit(self._requester, attributes["commit"], completed=False) + if "committer" in attributes: # pragma no branch + assert attributes["committer"] is None or isinstance(attributes["committer"], dict), attributes["committer"] + self._committer = None if attributes["committer"] is None else NamedUser.NamedUser(self._requester, attributes["committer"], completed=False) + if "files" in attributes: # pragma no branch + assert attributes["files"] is None or all(isinstance(element, dict) for element in attributes["files"]), attributes["files"] + self._files = None if attributes["files"] is None else [ + File.File(self._requester, element, completed=False) + for element in attributes["files"] ] - if "parents" in attributes: # pragma no branch - assert attributes[ "parents" ] is None or all( isinstance( element, dict ) for element in attributes[ "parents" ] ), attributes[ "parents" ] - self._parents = None if attributes[ "parents" ] is None else [ - Commit( self._requester, element, completed = False ) - for element in attributes[ "parents" ] + if "parents" in attributes: # pragma no branch + assert attributes["parents"] is None or all(isinstance(element, dict) for element in attributes["parents"]), attributes["parents"] + self._parents = None if attributes["parents"] is None else [ + Commit(self._requester, element, completed=False) + for element in attributes["parents"] ] - if "sha" in attributes: # pragma no branch - assert attributes[ "sha" ] is None or isinstance( attributes[ "sha" ], ( str, unicode ) ), attributes[ "sha" ] - self._sha = attributes[ "sha" ] - if "stats" in attributes: # pragma no branch - assert attributes[ "stats" ] is None or isinstance( attributes[ "stats" ], dict ), attributes[ "stats" ] - self._stats = None if attributes[ "stats" ] is None else CommitStats.CommitStats( self._requester, attributes[ "stats" ], completed = False ) - if "url" in attributes: # pragma no branch - assert attributes[ "url" ] is None or isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ] - self._url = attributes[ "url" ] + if "sha" in attributes: # pragma no branch + assert attributes["sha"] is None or isinstance(attributes["sha"], (str, unicode)), attributes["sha"] + self._sha = attributes["sha"] + if "stats" in attributes: # pragma no branch + assert attributes["stats"] is None or isinstance(attributes["stats"], dict), attributes["stats"] + self._stats = None if attributes["stats"] is None else CommitStats.CommitStats(self._requester, attributes["stats"], completed=False) + if "url" in attributes: # pragma no branch + assert attributes["url"] is None or isinstance(attributes["url"], (str, unicode)), attributes["url"] + self._url = attributes["url"] diff --git a/github/CommitComment.py b/github/CommitComment.py index 1e42af84..53c09632 100644 --- a/github/CommitComment.py +++ b/github/CommitComment.py @@ -15,63 +15,64 @@ import GithubObject import NamedUser -class CommitComment( GithubObject.GithubObject ): + +class CommitComment(GithubObject.GithubObject): @property - def body( self ): - self._completeIfNotSet( self._body ) - return self._NoneIfNotSet( self._body ) + def body(self): + self._completeIfNotSet(self._body) + return self._NoneIfNotSet(self._body) @property - def commit_id( self ): - self._completeIfNotSet( self._commit_id ) - return self._NoneIfNotSet( self._commit_id ) + def commit_id(self): + self._completeIfNotSet(self._commit_id) + return self._NoneIfNotSet(self._commit_id) @property - def created_at( self ): - self._completeIfNotSet( self._created_at ) - return self._NoneIfNotSet( self._created_at ) + def created_at(self): + self._completeIfNotSet(self._created_at) + return self._NoneIfNotSet(self._created_at) @property - def html_url( self ): - self._completeIfNotSet( self._html_url ) - return self._NoneIfNotSet( self._html_url ) + def html_url(self): + self._completeIfNotSet(self._html_url) + return self._NoneIfNotSet(self._html_url) @property - def id( self ): - self._completeIfNotSet( self._id ) - return self._NoneIfNotSet( self._id ) + def id(self): + self._completeIfNotSet(self._id) + return self._NoneIfNotSet(self._id) @property - def line( self ): - self._completeIfNotSet( self._line ) - return self._NoneIfNotSet( self._line ) + def line(self): + self._completeIfNotSet(self._line) + return self._NoneIfNotSet(self._line) @property - def path( self ): - self._completeIfNotSet( self._path ) - return self._NoneIfNotSet( self._path ) + def path(self): + self._completeIfNotSet(self._path) + return self._NoneIfNotSet(self._path) @property - def position( self ): - self._completeIfNotSet( self._position ) - return self._NoneIfNotSet( self._position ) + def position(self): + self._completeIfNotSet(self._position) + return self._NoneIfNotSet(self._position) @property - def updated_at( self ): - self._completeIfNotSet( self._updated_at ) - return self._NoneIfNotSet( self._updated_at ) + def updated_at(self): + self._completeIfNotSet(self._updated_at) + return self._NoneIfNotSet(self._updated_at) @property - def url( self ): - self._completeIfNotSet( self._url ) - return self._NoneIfNotSet( self._url ) + def url(self): + self._completeIfNotSet(self._url) + return self._NoneIfNotSet(self._url) @property - def user( self ): - self._completeIfNotSet( self._user ) - return self._NoneIfNotSet( self._user ) + def user(self): + self._completeIfNotSet(self._user) + return self._NoneIfNotSet(self._user) - def delete( self ): + def delete(self): headers, data = self._requester.requestAndCheck( "DELETE", self.url, @@ -79,8 +80,8 @@ class CommitComment( GithubObject.GithubObject ): None ) - def edit( self, body ): - assert isinstance( body, ( str, unicode ) ), body + def edit(self, body): + assert isinstance(body, (str, unicode)), body post_parameters = { "body": body, } @@ -90,9 +91,9 @@ class CommitComment( GithubObject.GithubObject ): None, post_parameters ) - self._useAttributes( data ) + self._useAttributes(data) - def _initAttributes( self ): + def _initAttributes(self): self._body = GithubObject.NotSet self._commit_id = GithubObject.NotSet self._created_at = GithubObject.NotSet @@ -105,37 +106,37 @@ class CommitComment( GithubObject.GithubObject ): self._url = GithubObject.NotSet self._user = GithubObject.NotSet - def _useAttributes( self, attributes ): - if "body" in attributes: # pragma no branch - assert attributes[ "body" ] is None or isinstance( attributes[ "body" ], ( str, unicode ) ), attributes[ "body" ] - self._body = attributes[ "body" ] - if "commit_id" in attributes: # pragma no branch - assert attributes[ "commit_id" ] is None or isinstance( attributes[ "commit_id" ], ( str, unicode ) ), attributes[ "commit_id" ] - self._commit_id = attributes[ "commit_id" ] - if "created_at" in attributes: # pragma no branch - assert attributes[ "created_at" ] is None or isinstance( attributes[ "created_at" ], ( str, unicode ) ), attributes[ "created_at" ] - self._created_at = self._parseDatetime( attributes[ "created_at" ] ) - if "html_url" in attributes: # pragma no branch - assert attributes[ "html_url" ] is None or isinstance( attributes[ "html_url" ], ( str, unicode ) ), attributes[ "html_url" ] - self._html_url = attributes[ "html_url" ] - if "id" in attributes: # pragma no branch - assert attributes[ "id" ] is None or isinstance( attributes[ "id" ], int ), attributes[ "id" ] - self._id = attributes[ "id" ] - if "line" in attributes: # pragma no branch - assert attributes[ "line" ] is None or isinstance( attributes[ "line" ], int ), attributes[ "line" ] - self._line = attributes[ "line" ] - if "path" in attributes: # pragma no branch - assert attributes[ "path" ] is None or isinstance( attributes[ "path" ], ( str, unicode ) ), attributes[ "path" ] - self._path = attributes[ "path" ] - if "position" in attributes: # pragma no branch - assert attributes[ "position" ] is None or isinstance( attributes[ "position" ], int ), attributes[ "position" ] - self._position = attributes[ "position" ] - if "updated_at" in attributes: # pragma no branch - assert attributes[ "updated_at" ] is None or isinstance( attributes[ "updated_at" ], ( str, unicode ) ), attributes[ "updated_at" ] - self._updated_at = self._parseDatetime( attributes[ "updated_at" ] ) - if "url" in attributes: # pragma no branch - assert attributes[ "url" ] is None or isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ] - self._url = attributes[ "url" ] - if "user" in attributes: # pragma no branch - assert attributes[ "user" ] is None or isinstance( attributes[ "user" ], dict ), attributes[ "user" ] - self._user = None if attributes[ "user" ] is None else NamedUser.NamedUser( self._requester, attributes[ "user" ], completed = False ) + def _useAttributes(self, attributes): + if "body" in attributes: # pragma no branch + assert attributes["body"] is None or isinstance(attributes["body"], (str, unicode)), attributes["body"] + self._body = attributes["body"] + if "commit_id" in attributes: # pragma no branch + assert attributes["commit_id"] is None or isinstance(attributes["commit_id"], (str, unicode)), attributes["commit_id"] + self._commit_id = attributes["commit_id"] + if "created_at" in attributes: # pragma no branch + assert attributes["created_at"] is None or isinstance(attributes["created_at"], (str, unicode)), attributes["created_at"] + self._created_at = self._parseDatetime(attributes["created_at"]) + if "html_url" in attributes: # pragma no branch + assert attributes["html_url"] is None or isinstance(attributes["html_url"], (str, unicode)), attributes["html_url"] + self._html_url = attributes["html_url"] + if "id" in attributes: # pragma no branch + assert attributes["id"] is None or isinstance(attributes["id"], int), attributes["id"] + self._id = attributes["id"] + if "line" in attributes: # pragma no branch + assert attributes["line"] is None or isinstance(attributes["line"], int), attributes["line"] + self._line = attributes["line"] + if "path" in attributes: # pragma no branch + assert attributes["path"] is None or isinstance(attributes["path"], (str, unicode)), attributes["path"] + self._path = attributes["path"] + if "position" in attributes: # pragma no branch + assert attributes["position"] is None or isinstance(attributes["position"], int), attributes["position"] + self._position = attributes["position"] + if "updated_at" in attributes: # pragma no branch + assert attributes["updated_at"] is None or isinstance(attributes["updated_at"], (str, unicode)), attributes["updated_at"] + self._updated_at = self._parseDatetime(attributes["updated_at"]) + if "url" in attributes: # pragma no branch + assert attributes["url"] is None or isinstance(attributes["url"], (str, unicode)), attributes["url"] + self._url = attributes["url"] + if "user" in attributes: # pragma no branch + assert attributes["user"] is None or isinstance(attributes["user"], dict), attributes["user"] + self._user = None if attributes["user"] is None else NamedUser.NamedUser(self._requester, attributes["user"], completed=False) diff --git a/github/CommitStats.py b/github/CommitStats.py index c0217975..e5b3b6ba 100644 --- a/github/CommitStats.py +++ b/github/CommitStats.py @@ -13,31 +13,32 @@ import GithubObject -class CommitStats( GithubObject.BasicGithubObject ): + +class CommitStats(GithubObject.BasicGithubObject): @property - def additions( self ): - return self._NoneIfNotSet( self._additions ) + def additions(self): + return self._NoneIfNotSet(self._additions) @property - def deletions( self ): - return self._NoneIfNotSet( self._deletions ) + def deletions(self): + return self._NoneIfNotSet(self._deletions) @property - def total( self ): - return self._NoneIfNotSet( self._total ) + def total(self): + return self._NoneIfNotSet(self._total) - def _initAttributes( self ): + def _initAttributes(self): self._additions = GithubObject.NotSet self._deletions = GithubObject.NotSet self._total = GithubObject.NotSet - def _useAttributes( self, attributes ): - if "additions" in attributes: # pragma no branch - assert attributes[ "additions" ] is None or isinstance( attributes[ "additions" ], int ), attributes[ "additions" ] - self._additions = attributes[ "additions" ] - if "deletions" in attributes: # pragma no branch - assert attributes[ "deletions" ] is None or isinstance( attributes[ "deletions" ], int ), attributes[ "deletions" ] - self._deletions = attributes[ "deletions" ] - if "total" in attributes: # pragma no branch - assert attributes[ "total" ] is None or isinstance( attributes[ "total" ], int ), attributes[ "total" ] - self._total = attributes[ "total" ] + def _useAttributes(self, attributes): + if "additions" in attributes: # pragma no branch + assert attributes["additions"] is None or isinstance(attributes["additions"], int), attributes["additions"] + self._additions = attributes["additions"] + if "deletions" in attributes: # pragma no branch + assert attributes["deletions"] is None or isinstance(attributes["deletions"], int), attributes["deletions"] + self._deletions = attributes["deletions"] + if "total" in attributes: # pragma no branch + assert attributes["total"] is None or isinstance(attributes["total"], int), attributes["total"] + self._total = attributes["total"] diff --git a/github/CommitStatus.py b/github/CommitStatus.py index c6f11679..715ceece 100644 --- a/github/CommitStatus.py +++ b/github/CommitStatus.py @@ -15,36 +15,37 @@ import GithubObject import NamedUser -class CommitStatus( GithubObject.BasicGithubObject ): + +class CommitStatus(GithubObject.BasicGithubObject): @property - def created_at( self ): - return self._NoneIfNotSet( self._created_at ) + def created_at(self): + return self._NoneIfNotSet(self._created_at) @property - def creator( self ): - return self._NoneIfNotSet( self._creator ) + def creator(self): + return self._NoneIfNotSet(self._creator) @property - def description( self ): - return self._NoneIfNotSet( self._description ) + def description(self): + return self._NoneIfNotSet(self._description) @property - def id( self ): - return self._NoneIfNotSet( self._id ) + def id(self): + return self._NoneIfNotSet(self._id) @property - def state( self ): - return self._NoneIfNotSet( self._state ) + def state(self): + return self._NoneIfNotSet(self._state) @property - def target_url( self ): - return self._NoneIfNotSet( self._target_url ) + def target_url(self): + return self._NoneIfNotSet(self._target_url) @property - def updated_at( self ): - return self._NoneIfNotSet( self._updated_at ) + def updated_at(self): + return self._NoneIfNotSet(self._updated_at) - def _initAttributes( self ): + def _initAttributes(self): self._created_at = GithubObject.NotSet self._creator = GithubObject.NotSet self._description = GithubObject.NotSet @@ -53,25 +54,25 @@ class CommitStatus( GithubObject.BasicGithubObject ): self._target_url = GithubObject.NotSet self._updated_at = GithubObject.NotSet - def _useAttributes( self, attributes ): - if "created_at" in attributes: # pragma no branch - assert attributes[ "created_at" ] is None or isinstance( attributes[ "created_at" ], ( str, unicode ) ), attributes[ "created_at" ] - self._created_at = self._parseDatetime( attributes[ "created_at" ] ) - if "creator" in attributes: # pragma no branch - assert attributes[ "creator" ] is None or isinstance( attributes[ "creator" ], dict ), attributes[ "creator" ] - self._creator = None if attributes[ "creator" ] is None else NamedUser.NamedUser( self._requester, attributes[ "creator" ], completed = False ) - if "description" in attributes: # pragma no branch - assert attributes[ "description" ] is None or isinstance( attributes[ "description" ], ( str, unicode ) ), attributes[ "description" ] - self._description = attributes[ "description" ] - if "id" in attributes: # pragma no branch - assert attributes[ "id" ] is None or isinstance( attributes[ "id" ], int ), attributes[ "id" ] - self._id = attributes[ "id" ] - if "state" in attributes: # pragma no branch - assert attributes[ "state" ] is None or isinstance( attributes[ "state" ], ( str, unicode ) ), attributes[ "state" ] - self._state = attributes[ "state" ] - if "target_url" in attributes: # pragma no branch - assert attributes[ "target_url" ] is None or isinstance( attributes[ "target_url" ], ( str, unicode ) ), attributes[ "target_url" ] - self._target_url = attributes[ "target_url" ] - if "updated_at" in attributes: # pragma no branch - assert attributes[ "updated_at" ] is None or isinstance( attributes[ "updated_at" ], ( str, unicode ) ), attributes[ "updated_at" ] - self._updated_at = self._parseDatetime( attributes[ "updated_at" ] ) + def _useAttributes(self, attributes): + if "created_at" in attributes: # pragma no branch + assert attributes["created_at"] is None or isinstance(attributes["created_at"], (str, unicode)), attributes["created_at"] + self._created_at = self._parseDatetime(attributes["created_at"]) + if "creator" in attributes: # pragma no branch + assert attributes["creator"] is None or isinstance(attributes["creator"], dict), attributes["creator"] + self._creator = None if attributes["creator"] is None else NamedUser.NamedUser(self._requester, attributes["creator"], completed=False) + if "description" in attributes: # pragma no branch + assert attributes["description"] is None or isinstance(attributes["description"], (str, unicode)), attributes["description"] + self._description = attributes["description"] + if "id" in attributes: # pragma no branch + assert attributes["id"] is None or isinstance(attributes["id"], int), attributes["id"] + self._id = attributes["id"] + if "state" in attributes: # pragma no branch + assert attributes["state"] is None or isinstance(attributes["state"], (str, unicode)), attributes["state"] + self._state = attributes["state"] + if "target_url" in attributes: # pragma no branch + assert attributes["target_url"] is None or isinstance(attributes["target_url"], (str, unicode)), attributes["target_url"] + self._target_url = attributes["target_url"] + if "updated_at" in attributes: # pragma no branch + assert attributes["updated_at"] is None or isinstance(attributes["updated_at"], (str, unicode)), attributes["updated_at"] + self._updated_at = self._parseDatetime(attributes["updated_at"]) diff --git a/github/Comparison.py b/github/Comparison.py index 0961d60d..fe1622ea 100644 --- a/github/Comparison.py +++ b/github/Comparison.py @@ -16,68 +16,69 @@ import GithubObject import Commit import File -class Comparison( GithubObject.GithubObject ): + +class Comparison(GithubObject.GithubObject): @property - def ahead_by( self ): - self._completeIfNotSet( self._ahead_by ) - return self._NoneIfNotSet( self._ahead_by ) + def ahead_by(self): + self._completeIfNotSet(self._ahead_by) + return self._NoneIfNotSet(self._ahead_by) @property - def base_commit( self ): - self._completeIfNotSet( self._base_commit ) - return self._NoneIfNotSet( self._base_commit ) + def base_commit(self): + self._completeIfNotSet(self._base_commit) + return self._NoneIfNotSet(self._base_commit) @property - def behind_by( self ): - self._completeIfNotSet( self._behind_by ) - return self._NoneIfNotSet( self._behind_by ) + def behind_by(self): + self._completeIfNotSet(self._behind_by) + return self._NoneIfNotSet(self._behind_by) @property - def commits( self ): - self._completeIfNotSet( self._commits ) - return self._NoneIfNotSet( self._commits ) + def commits(self): + self._completeIfNotSet(self._commits) + return self._NoneIfNotSet(self._commits) @property - def diff_url( self ): - self._completeIfNotSet( self._diff_url ) - return self._NoneIfNotSet( self._diff_url ) + def diff_url(self): + self._completeIfNotSet(self._diff_url) + return self._NoneIfNotSet(self._diff_url) @property - def files( self ): - self._completeIfNotSet( self._files ) - return self._NoneIfNotSet( self._files ) + def files(self): + self._completeIfNotSet(self._files) + return self._NoneIfNotSet(self._files) @property - def html_url( self ): - self._completeIfNotSet( self._html_url ) - return self._NoneIfNotSet( self._html_url ) + def html_url(self): + self._completeIfNotSet(self._html_url) + return self._NoneIfNotSet(self._html_url) @property - def patch_url( self ): - self._completeIfNotSet( self._patch_url ) - return self._NoneIfNotSet( self._patch_url ) + def patch_url(self): + self._completeIfNotSet(self._patch_url) + return self._NoneIfNotSet(self._patch_url) @property - def permalink_url( self ): - self._completeIfNotSet( self._permalink_url ) - return self._NoneIfNotSet( self._permalink_url ) + def permalink_url(self): + self._completeIfNotSet(self._permalink_url) + return self._NoneIfNotSet(self._permalink_url) @property - def status( self ): - self._completeIfNotSet( self._status ) - return self._NoneIfNotSet( self._status ) + def status(self): + self._completeIfNotSet(self._status) + return self._NoneIfNotSet(self._status) @property - def total_commits( self ): - self._completeIfNotSet( self._total_commits ) - return self._NoneIfNotSet( self._total_commits ) + def total_commits(self): + self._completeIfNotSet(self._total_commits) + return self._NoneIfNotSet(self._total_commits) @property - def url( self ): - self._completeIfNotSet( self._url ) - return self._NoneIfNotSet( self._url ) + def url(self): + self._completeIfNotSet(self._url) + return self._NoneIfNotSet(self._url) - def _initAttributes( self ): + def _initAttributes(self): self._ahead_by = GithubObject.NotSet self._base_commit = GithubObject.NotSet self._behind_by = GithubObject.NotSet @@ -91,46 +92,46 @@ class Comparison( GithubObject.GithubObject ): self._total_commits = GithubObject.NotSet self._url = GithubObject.NotSet - def _useAttributes( self, attributes ): - if "ahead_by" in attributes: # pragma no branch - assert attributes[ "ahead_by" ] is None or isinstance( attributes[ "ahead_by" ], int ), attributes[ "ahead_by" ] - self._ahead_by = attributes[ "ahead_by" ] - if "base_commit" in attributes: # pragma no branch - assert attributes[ "base_commit" ] is None or isinstance( attributes[ "base_commit" ], dict ), attributes[ "base_commit" ] - self._base_commit = None if attributes[ "base_commit" ] is None else Commit.Commit( self._requester, attributes[ "base_commit" ], completed = False ) - if "behind_by" in attributes: # pragma no branch - assert attributes[ "behind_by" ] is None or isinstance( attributes[ "behind_by" ], int ), attributes[ "behind_by" ] - self._behind_by = attributes[ "behind_by" ] - if "commits" in attributes: # pragma no branch - assert attributes[ "commits" ] is None or all( isinstance( element, dict ) for element in attributes[ "commits" ] ), attributes[ "commits" ] - self._commits = None if attributes[ "commits" ] is None else [ - Commit.Commit( self._requester, element, completed = False ) - for element in attributes[ "commits" ] + def _useAttributes(self, attributes): + if "ahead_by" in attributes: # pragma no branch + assert attributes["ahead_by"] is None or isinstance(attributes["ahead_by"], int), attributes["ahead_by"] + self._ahead_by = attributes["ahead_by"] + if "base_commit" in attributes: # pragma no branch + assert attributes["base_commit"] is None or isinstance(attributes["base_commit"], dict), attributes["base_commit"] + self._base_commit = None if attributes["base_commit"] is None else Commit.Commit(self._requester, attributes["base_commit"], completed=False) + if "behind_by" in attributes: # pragma no branch + assert attributes["behind_by"] is None or isinstance(attributes["behind_by"], int), attributes["behind_by"] + self._behind_by = attributes["behind_by"] + if "commits" in attributes: # pragma no branch + assert attributes["commits"] is None or all(isinstance(element, dict) for element in attributes["commits"]), attributes["commits"] + self._commits = None if attributes["commits"] is None else [ + Commit.Commit(self._requester, element, completed=False) + for element in attributes["commits"] ] - if "diff_url" in attributes: # pragma no branch - assert attributes[ "diff_url" ] is None or isinstance( attributes[ "diff_url" ], ( str, unicode ) ), attributes[ "diff_url" ] - self._diff_url = attributes[ "diff_url" ] - if "files" in attributes: # pragma no branch - assert attributes[ "files" ] is None or all( isinstance( element, dict ) for element in attributes[ "files" ] ), attributes[ "files" ] - self._files = None if attributes[ "files" ] is None else [ - File.File( self._requester, element, completed = False ) - for element in attributes[ "files" ] + if "diff_url" in attributes: # pragma no branch + assert attributes["diff_url"] is None or isinstance(attributes["diff_url"], (str, unicode)), attributes["diff_url"] + self._diff_url = attributes["diff_url"] + if "files" in attributes: # pragma no branch + assert attributes["files"] is None or all(isinstance(element, dict) for element in attributes["files"]), attributes["files"] + self._files = None if attributes["files"] is None else [ + File.File(self._requester, element, completed=False) + for element in attributes["files"] ] - if "html_url" in attributes: # pragma no branch - assert attributes[ "html_url" ] is None or isinstance( attributes[ "html_url" ], ( str, unicode ) ), attributes[ "html_url" ] - self._html_url = attributes[ "html_url" ] - if "patch_url" in attributes: # pragma no branch - assert attributes[ "patch_url" ] is None or isinstance( attributes[ "patch_url" ], ( str, unicode ) ), attributes[ "patch_url" ] - self._patch_url = attributes[ "patch_url" ] - if "permalink_url" in attributes: # pragma no branch - assert attributes[ "permalink_url" ] is None or isinstance( attributes[ "permalink_url" ], ( str, unicode ) ), attributes[ "permalink_url" ] - self._permalink_url = attributes[ "permalink_url" ] - if "status" in attributes: # pragma no branch - assert attributes[ "status" ] is None or isinstance( attributes[ "status" ], ( str, unicode ) ), attributes[ "status" ] - self._status = attributes[ "status" ] - if "total_commits" in attributes: # pragma no branch - assert attributes[ "total_commits" ] is None or isinstance( attributes[ "total_commits" ], int ), attributes[ "total_commits" ] - self._total_commits = attributes[ "total_commits" ] - if "url" in attributes: # pragma no branch - assert attributes[ "url" ] is None or isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ] - self._url = attributes[ "url" ] + if "html_url" in attributes: # pragma no branch + assert attributes["html_url"] is None or isinstance(attributes["html_url"], (str, unicode)), attributes["html_url"] + self._html_url = attributes["html_url"] + if "patch_url" in attributes: # pragma no branch + assert attributes["patch_url"] is None or isinstance(attributes["patch_url"], (str, unicode)), attributes["patch_url"] + self._patch_url = attributes["patch_url"] + if "permalink_url" in attributes: # pragma no branch + assert attributes["permalink_url"] is None or isinstance(attributes["permalink_url"], (str, unicode)), attributes["permalink_url"] + self._permalink_url = attributes["permalink_url"] + if "status" in attributes: # pragma no branch + assert attributes["status"] is None or isinstance(attributes["status"], (str, unicode)), attributes["status"] + self._status = attributes["status"] + if "total_commits" in attributes: # pragma no branch + assert attributes["total_commits"] is None or isinstance(attributes["total_commits"], int), attributes["total_commits"] + self._total_commits = attributes["total_commits"] + if "url" in attributes: # pragma no branch + assert attributes["url"] is None or isinstance(attributes["url"], (str, unicode)), attributes["url"] + self._url = attributes["url"] diff --git a/github/ContentFile.py b/github/ContentFile.py index e1411596..b69b611b 100644 --- a/github/ContentFile.py +++ b/github/ContentFile.py @@ -13,36 +13,37 @@ import GithubObject -class ContentFile( GithubObject.BasicGithubObject ): + +class ContentFile(GithubObject.BasicGithubObject): @property - def content( self ): - return self._NoneIfNotSet( self._content ) + def content(self): + return self._NoneIfNotSet(self._content) @property - def encoding( self ): - return self._NoneIfNotSet( self._encoding ) + def encoding(self): + return self._NoneIfNotSet(self._encoding) @property - def name( self ): - return self._NoneIfNotSet( self._name ) + def name(self): + return self._NoneIfNotSet(self._name) @property - def path( self ): - return self._NoneIfNotSet( self._path ) + def path(self): + return self._NoneIfNotSet(self._path) @property - def sha( self ): - return self._NoneIfNotSet( self._sha ) + def sha(self): + return self._NoneIfNotSet(self._sha) @property - def size( self ): - return self._NoneIfNotSet( self._size ) + def size(self): + return self._NoneIfNotSet(self._size) @property - def type( self ): - return self._NoneIfNotSet( self._type ) + def type(self): + return self._NoneIfNotSet(self._type) - def _initAttributes( self ): + def _initAttributes(self): self._content = GithubObject.NotSet self._encoding = GithubObject.NotSet self._name = GithubObject.NotSet @@ -51,25 +52,25 @@ class ContentFile( GithubObject.BasicGithubObject ): self._size = GithubObject.NotSet self._type = GithubObject.NotSet - def _useAttributes( self, attributes ): - if "content" in attributes: # pragma no branch - assert attributes[ "content" ] is None or isinstance( attributes[ "content" ], ( str, unicode ) ), attributes[ "content" ] - self._content = attributes[ "content" ] - if "encoding" in attributes: # pragma no branch - assert attributes[ "encoding" ] is None or isinstance( attributes[ "encoding" ], ( str, unicode ) ), attributes[ "encoding" ] - self._encoding = attributes[ "encoding" ] - if "name" in attributes: # pragma no branch - assert attributes[ "name" ] is None or isinstance( attributes[ "name" ], ( str, unicode ) ), attributes[ "name" ] - self._name = attributes[ "name" ] - if "path" in attributes: # pragma no branch - assert attributes[ "path" ] is None or isinstance( attributes[ "path" ], ( str, unicode ) ), attributes[ "path" ] - self._path = attributes[ "path" ] - if "sha" in attributes: # pragma no branch - assert attributes[ "sha" ] is None or isinstance( attributes[ "sha" ], ( str, unicode ) ), attributes[ "sha" ] - self._sha = attributes[ "sha" ] - if "size" in attributes: # pragma no branch - assert attributes[ "size" ] is None or isinstance( attributes[ "size" ], int ), attributes[ "size" ] - self._size = attributes[ "size" ] - if "type" in attributes: # pragma no branch - assert attributes[ "type" ] is None or isinstance( attributes[ "type" ], ( str, unicode ) ), attributes[ "type" ] - self._type = attributes[ "type" ] + def _useAttributes(self, attributes): + if "content" in attributes: # pragma no branch + assert attributes["content"] is None or isinstance(attributes["content"], (str, unicode)), attributes["content"] + self._content = attributes["content"] + if "encoding" in attributes: # pragma no branch + assert attributes["encoding"] is None or isinstance(attributes["encoding"], (str, unicode)), attributes["encoding"] + self._encoding = attributes["encoding"] + if "name" in attributes: # pragma no branch + assert attributes["name"] is None or isinstance(attributes["name"], (str, unicode)), attributes["name"] + self._name = attributes["name"] + if "path" in attributes: # pragma no branch + assert attributes["path"] is None or isinstance(attributes["path"], (str, unicode)), attributes["path"] + self._path = attributes["path"] + if "sha" in attributes: # pragma no branch + assert attributes["sha"] is None or isinstance(attributes["sha"], (str, unicode)), attributes["sha"] + self._sha = attributes["sha"] + if "size" in attributes: # pragma no branch + assert attributes["size"] is None or isinstance(attributes["size"], int), attributes["size"] + self._size = attributes["size"] + if "type" in attributes: # pragma no branch + assert attributes["type"] is None or isinstance(attributes["type"], (str, unicode)), attributes["type"] + self._type = attributes["type"] diff --git a/github/Download.py b/github/Download.py index 7cf040fc..8551d9b6 100644 --- a/github/Download.py +++ b/github/Download.py @@ -13,108 +13,109 @@ import GithubObject -class Download( GithubObject.GithubObject ): + +class Download(GithubObject.GithubObject): @property - def accesskeyid( self ): - self._completeIfNotSet( self._accesskeyid ) - return self._NoneIfNotSet( self._accesskeyid ) + def accesskeyid(self): + self._completeIfNotSet(self._accesskeyid) + return self._NoneIfNotSet(self._accesskeyid) @property - def acl( self ): - self._completeIfNotSet( self._acl ) - return self._NoneIfNotSet( self._acl ) + def acl(self): + self._completeIfNotSet(self._acl) + return self._NoneIfNotSet(self._acl) @property - def bucket( self ): - self._completeIfNotSet( self._bucket ) - return self._NoneIfNotSet( self._bucket ) + def bucket(self): + self._completeIfNotSet(self._bucket) + return self._NoneIfNotSet(self._bucket) @property - def content_type( self ): - self._completeIfNotSet( self._content_type ) - return self._NoneIfNotSet( self._content_type ) + def content_type(self): + self._completeIfNotSet(self._content_type) + return self._NoneIfNotSet(self._content_type) @property - def created_at( self ): - self._completeIfNotSet( self._created_at ) - return self._NoneIfNotSet( self._created_at ) + def created_at(self): + self._completeIfNotSet(self._created_at) + return self._NoneIfNotSet(self._created_at) @property - def description( self ): - self._completeIfNotSet( self._description ) - return self._NoneIfNotSet( self._description ) + def description(self): + self._completeIfNotSet(self._description) + return self._NoneIfNotSet(self._description) @property - def download_count( self ): - self._completeIfNotSet( self._download_count ) - return self._NoneIfNotSet( self._download_count ) + def download_count(self): + self._completeIfNotSet(self._download_count) + return self._NoneIfNotSet(self._download_count) @property - def expirationdate( self ): - self._completeIfNotSet( self._expirationdate ) - return self._NoneIfNotSet( self._expirationdate ) + def expirationdate(self): + self._completeIfNotSet(self._expirationdate) + return self._NoneIfNotSet(self._expirationdate) @property - def html_url( self ): - self._completeIfNotSet( self._html_url ) - return self._NoneIfNotSet( self._html_url ) + def html_url(self): + self._completeIfNotSet(self._html_url) + return self._NoneIfNotSet(self._html_url) @property - def id( self ): - self._completeIfNotSet( self._id ) - return self._NoneIfNotSet( self._id ) + def id(self): + self._completeIfNotSet(self._id) + return self._NoneIfNotSet(self._id) @property - def mime_type( self ): - self._completeIfNotSet( self._mime_type ) - return self._NoneIfNotSet( self._mime_type ) + def mime_type(self): + self._completeIfNotSet(self._mime_type) + return self._NoneIfNotSet(self._mime_type) @property - def name( self ): - self._completeIfNotSet( self._name ) - return self._NoneIfNotSet( self._name ) + def name(self): + self._completeIfNotSet(self._name) + return self._NoneIfNotSet(self._name) @property - def path( self ): - self._completeIfNotSet( self._path ) - return self._NoneIfNotSet( self._path ) + def path(self): + self._completeIfNotSet(self._path) + return self._NoneIfNotSet(self._path) @property - def policy( self ): - self._completeIfNotSet( self._policy ) - return self._NoneIfNotSet( self._policy ) + def policy(self): + self._completeIfNotSet(self._policy) + return self._NoneIfNotSet(self._policy) @property - def prefix( self ): - self._completeIfNotSet( self._prefix ) - return self._NoneIfNotSet( self._prefix ) + def prefix(self): + self._completeIfNotSet(self._prefix) + return self._NoneIfNotSet(self._prefix) @property - def redirect( self ): - self._completeIfNotSet( self._redirect ) - return self._NoneIfNotSet( self._redirect ) + def redirect(self): + self._completeIfNotSet(self._redirect) + return self._NoneIfNotSet(self._redirect) @property - def s3_url( self ): - self._completeIfNotSet( self._s3_url ) - return self._NoneIfNotSet( self._s3_url ) + def s3_url(self): + self._completeIfNotSet(self._s3_url) + return self._NoneIfNotSet(self._s3_url) @property - def signature( self ): - self._completeIfNotSet( self._signature ) - return self._NoneIfNotSet( self._signature ) + def signature(self): + self._completeIfNotSet(self._signature) + return self._NoneIfNotSet(self._signature) @property - def size( self ): - self._completeIfNotSet( self._size ) - return self._NoneIfNotSet( self._size ) + def size(self): + self._completeIfNotSet(self._size) + return self._NoneIfNotSet(self._size) @property - def url( self ): - self._completeIfNotSet( self._url ) - return self._NoneIfNotSet( self._url ) + def url(self): + self._completeIfNotSet(self._url) + return self._NoneIfNotSet(self._url) - def delete( self ): + def delete(self): headers, data = self._requester.requestAndCheck( "DELETE", self.url, @@ -122,7 +123,7 @@ class Download( GithubObject.GithubObject ): None ) - def _initAttributes( self ): + def _initAttributes(self): self._accesskeyid = GithubObject.NotSet self._acl = GithubObject.NotSet self._bucket = GithubObject.NotSet @@ -144,64 +145,64 @@ class Download( GithubObject.GithubObject ): self._size = GithubObject.NotSet self._url = GithubObject.NotSet - def _useAttributes( self, attributes ): - if "accesskeyid" in attributes: # pragma no branch - assert attributes[ "accesskeyid" ] is None or isinstance( attributes[ "accesskeyid" ], ( str, unicode ) ), attributes[ "accesskeyid" ] - self._accesskeyid = attributes[ "accesskeyid" ] - if "acl" in attributes: # pragma no branch - assert attributes[ "acl" ] is None or isinstance( attributes[ "acl" ], ( str, unicode ) ), attributes[ "acl" ] - self._acl = attributes[ "acl" ] - if "bucket" in attributes: # pragma no branch - assert attributes[ "bucket" ] is None or isinstance( attributes[ "bucket" ], ( str, unicode ) ), attributes[ "bucket" ] - self._bucket = attributes[ "bucket" ] - if "content_type" in attributes: # pragma no branch - assert attributes[ "content_type" ] is None or isinstance( attributes[ "content_type" ], ( str, unicode ) ), attributes[ "content_type" ] - self._content_type = attributes[ "content_type" ] - if "created_at" in attributes: # pragma no branch - assert attributes[ "created_at" ] is None or isinstance( attributes[ "created_at" ], ( str, unicode ) ), attributes[ "created_at" ] - self._created_at = self._parseDatetime( attributes[ "created_at" ] ) - if "description" in attributes: # pragma no branch - assert attributes[ "description" ] is None or isinstance( attributes[ "description" ], ( str, unicode ) ), attributes[ "description" ] - self._description = attributes[ "description" ] - if "download_count" in attributes: # pragma no branch - assert attributes[ "download_count" ] is None or isinstance( attributes[ "download_count" ], int ), attributes[ "download_count" ] - self._download_count = attributes[ "download_count" ] - if "expirationdate" in attributes: # pragma no branch - assert attributes[ "expirationdate" ] is None or isinstance( attributes[ "expirationdate" ], ( str, unicode ) ), attributes[ "expirationdate" ] - self._expirationdate = self._parseDatetime( attributes[ "expirationdate" ] ) - if "html_url" in attributes: # pragma no branch - assert attributes[ "html_url" ] is None or isinstance( attributes[ "html_url" ], ( str, unicode ) ), attributes[ "html_url" ] - self._html_url = attributes[ "html_url" ] - if "id" in attributes: # pragma no branch - assert attributes[ "id" ] is None or isinstance( attributes[ "id" ], int ), attributes[ "id" ] - self._id = attributes[ "id" ] - if "mime_type" in attributes: # pragma no branch - assert attributes[ "mime_type" ] is None or isinstance( attributes[ "mime_type" ], ( str, unicode ) ), attributes[ "mime_type" ] - self._mime_type = attributes[ "mime_type" ] - if "name" in attributes: # pragma no branch - assert attributes[ "name" ] is None or isinstance( attributes[ "name" ], ( str, unicode ) ), attributes[ "name" ] - self._name = attributes[ "name" ] - if "path" in attributes: # pragma no branch - assert attributes[ "path" ] is None or isinstance( attributes[ "path" ], ( str, unicode ) ), attributes[ "path" ] - self._path = attributes[ "path" ] - if "policy" in attributes: # pragma no branch - assert attributes[ "policy" ] is None or isinstance( attributes[ "policy" ], ( str, unicode ) ), attributes[ "policy" ] - self._policy = attributes[ "policy" ] - if "prefix" in attributes: # pragma no branch - assert attributes[ "prefix" ] is None or isinstance( attributes[ "prefix" ], ( str, unicode ) ), attributes[ "prefix" ] - self._prefix = attributes[ "prefix" ] - if "redirect" in attributes: # pragma no branch - assert attributes[ "redirect" ] is None or isinstance( attributes[ "redirect" ], bool ), attributes[ "redirect" ] - self._redirect = attributes[ "redirect" ] - if "s3_url" in attributes: # pragma no branch - assert attributes[ "s3_url" ] is None or isinstance( attributes[ "s3_url" ], ( str, unicode ) ), attributes[ "s3_url" ] - self._s3_url = attributes[ "s3_url" ] - if "signature" in attributes: # pragma no branch - assert attributes[ "signature" ] is None or isinstance( attributes[ "signature" ], ( str, unicode ) ), attributes[ "signature" ] - self._signature = attributes[ "signature" ] - if "size" in attributes: # pragma no branch - assert attributes[ "size" ] is None or isinstance( attributes[ "size" ], int ), attributes[ "size" ] - self._size = attributes[ "size" ] - if "url" in attributes: # pragma no branch - assert attributes[ "url" ] is None or isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ] - self._url = attributes[ "url" ] + def _useAttributes(self, attributes): + if "accesskeyid" in attributes: # pragma no branch + assert attributes["accesskeyid"] is None or isinstance(attributes["accesskeyid"], (str, unicode)), attributes["accesskeyid"] + self._accesskeyid = attributes["accesskeyid"] + if "acl" in attributes: # pragma no branch + assert attributes["acl"] is None or isinstance(attributes["acl"], (str, unicode)), attributes["acl"] + self._acl = attributes["acl"] + if "bucket" in attributes: # pragma no branch + assert attributes["bucket"] is None or isinstance(attributes["bucket"], (str, unicode)), attributes["bucket"] + self._bucket = attributes["bucket"] + if "content_type" in attributes: # pragma no branch + assert attributes["content_type"] is None or isinstance(attributes["content_type"], (str, unicode)), attributes["content_type"] + self._content_type = attributes["content_type"] + if "created_at" in attributes: # pragma no branch + assert attributes["created_at"] is None or isinstance(attributes["created_at"], (str, unicode)), attributes["created_at"] + self._created_at = self._parseDatetime(attributes["created_at"]) + if "description" in attributes: # pragma no branch + assert attributes["description"] is None or isinstance(attributes["description"], (str, unicode)), attributes["description"] + self._description = attributes["description"] + if "download_count" in attributes: # pragma no branch + assert attributes["download_count"] is None or isinstance(attributes["download_count"], int), attributes["download_count"] + self._download_count = attributes["download_count"] + if "expirationdate" in attributes: # pragma no branch + assert attributes["expirationdate"] is None or isinstance(attributes["expirationdate"], (str, unicode)), attributes["expirationdate"] + self._expirationdate = self._parseDatetime(attributes["expirationdate"]) + if "html_url" in attributes: # pragma no branch + assert attributes["html_url"] is None or isinstance(attributes["html_url"], (str, unicode)), attributes["html_url"] + self._html_url = attributes["html_url"] + if "id" in attributes: # pragma no branch + assert attributes["id"] is None or isinstance(attributes["id"], int), attributes["id"] + self._id = attributes["id"] + if "mime_type" in attributes: # pragma no branch + assert attributes["mime_type"] is None or isinstance(attributes["mime_type"], (str, unicode)), attributes["mime_type"] + self._mime_type = attributes["mime_type"] + if "name" in attributes: # pragma no branch + assert attributes["name"] is None or isinstance(attributes["name"], (str, unicode)), attributes["name"] + self._name = attributes["name"] + if "path" in attributes: # pragma no branch + assert attributes["path"] is None or isinstance(attributes["path"], (str, unicode)), attributes["path"] + self._path = attributes["path"] + if "policy" in attributes: # pragma no branch + assert attributes["policy"] is None or isinstance(attributes["policy"], (str, unicode)), attributes["policy"] + self._policy = attributes["policy"] + if "prefix" in attributes: # pragma no branch + assert attributes["prefix"] is None or isinstance(attributes["prefix"], (str, unicode)), attributes["prefix"] + self._prefix = attributes["prefix"] + if "redirect" in attributes: # pragma no branch + assert attributes["redirect"] is None or isinstance(attributes["redirect"], bool), attributes["redirect"] + self._redirect = attributes["redirect"] + if "s3_url" in attributes: # pragma no branch + assert attributes["s3_url"] is None or isinstance(attributes["s3_url"], (str, unicode)), attributes["s3_url"] + self._s3_url = attributes["s3_url"] + if "signature" in attributes: # pragma no branch + assert attributes["signature"] is None or isinstance(attributes["signature"], (str, unicode)), attributes["signature"] + self._signature = attributes["signature"] + if "size" in attributes: # pragma no branch + assert attributes["size"] is None or isinstance(attributes["size"], int), attributes["size"] + self._size = attributes["size"] + if "url" in attributes: # pragma no branch + assert attributes["url"] is None or isinstance(attributes["url"], (str, unicode)), attributes["url"] + self._url = attributes["url"] diff --git a/github/Event.py b/github/Event.py index c14485d7..496b660c 100644 --- a/github/Event.py +++ b/github/Event.py @@ -17,40 +17,41 @@ import Organization import Repository import NamedUser -class Event( GithubObject.BasicGithubObject ): + +class Event(GithubObject.BasicGithubObject): @property - def actor( self ): - return self._NoneIfNotSet( self._actor ) + def actor(self): + return self._NoneIfNotSet(self._actor) @property - def created_at( self ): - return self._NoneIfNotSet( self._created_at ) + def created_at(self): + return self._NoneIfNotSet(self._created_at) @property - def id( self ): - return self._NoneIfNotSet( self._id ) + def id(self): + return self._NoneIfNotSet(self._id) @property - def org( self ): - return self._NoneIfNotSet( self._org ) + def org(self): + return self._NoneIfNotSet(self._org) @property - def payload( self ): - return self._NoneIfNotSet( self._payload ) + def payload(self): + return self._NoneIfNotSet(self._payload) @property - def public( self ): - return self._NoneIfNotSet( self._public ) + def public(self): + return self._NoneIfNotSet(self._public) @property - def repo( self ): - return self._NoneIfNotSet( self._repo ) + def repo(self): + return self._NoneIfNotSet(self._repo) @property - def type( self ): - return self._NoneIfNotSet( self._type ) + def type(self): + return self._NoneIfNotSet(self._type) - def _initAttributes( self ): + def _initAttributes(self): self._actor = GithubObject.NotSet self._created_at = GithubObject.NotSet self._id = GithubObject.NotSet @@ -60,28 +61,28 @@ class Event( GithubObject.BasicGithubObject ): self._repo = GithubObject.NotSet self._type = GithubObject.NotSet - def _useAttributes( self, attributes ): - if "actor" in attributes: # pragma no branch - assert attributes[ "actor" ] is None or isinstance( attributes[ "actor" ], dict ), attributes[ "actor" ] - self._actor = None if attributes[ "actor" ] is None else NamedUser.NamedUser( self._requester, attributes[ "actor" ], completed = False ) - if "created_at" in attributes: # pragma no branch - assert attributes[ "created_at" ] is None or isinstance( attributes[ "created_at" ], ( str, unicode ) ), attributes[ "created_at" ] - self._created_at = self._parseDatetime( attributes[ "created_at" ] ) - if "id" in attributes: # pragma no branch - assert attributes[ "id" ] is None or isinstance( attributes[ "id" ], ( str, unicode ) ), attributes[ "id" ] - self._id = attributes[ "id" ] - if "org" in attributes: # pragma no branch - assert attributes[ "org" ] is None or isinstance( attributes[ "org" ], dict ), attributes[ "org" ] - self._org = None if attributes[ "org" ] is None else Organization.Organization( self._requester, attributes[ "org" ], completed = False ) - if "payload" in attributes: # pragma no branch - assert attributes[ "payload" ] is None or isinstance( attributes[ "payload" ], dict ), attributes[ "payload" ] - self._payload = attributes[ "payload" ] - if "public" in attributes: # pragma no branch - assert attributes[ "public" ] is None or isinstance( attributes[ "public" ], bool ), attributes[ "public" ] - self._public = attributes[ "public" ] - if "repo" in attributes: # pragma no branch - assert attributes[ "repo" ] is None or isinstance( attributes[ "repo" ], dict ), attributes[ "repo" ] - self._repo = None if attributes[ "repo" ] is None else Repository.Repository( self._requester, attributes[ "repo" ], completed = False ) - if "type" in attributes: # pragma no branch - assert attributes[ "type" ] is None or isinstance( attributes[ "type" ], ( str, unicode ) ), attributes[ "type" ] - self._type = attributes[ "type" ] + def _useAttributes(self, attributes): + if "actor" in attributes: # pragma no branch + assert attributes["actor"] is None or isinstance(attributes["actor"], dict), attributes["actor"] + self._actor = None if attributes["actor"] is None else NamedUser.NamedUser(self._requester, attributes["actor"], completed=False) + if "created_at" in attributes: # pragma no branch + assert attributes["created_at"] is None or isinstance(attributes["created_at"], (str, unicode)), attributes["created_at"] + self._created_at = self._parseDatetime(attributes["created_at"]) + if "id" in attributes: # pragma no branch + assert attributes["id"] is None or isinstance(attributes["id"], (str, unicode)), attributes["id"] + self._id = attributes["id"] + if "org" in attributes: # pragma no branch + assert attributes["org"] is None or isinstance(attributes["org"], dict), attributes["org"] + self._org = None if attributes["org"] is None else Organization.Organization(self._requester, attributes["org"], completed=False) + if "payload" in attributes: # pragma no branch + assert attributes["payload"] is None or isinstance(attributes["payload"], dict), attributes["payload"] + self._payload = attributes["payload"] + if "public" in attributes: # pragma no branch + assert attributes["public"] is None or isinstance(attributes["public"], bool), attributes["public"] + self._public = attributes["public"] + if "repo" in attributes: # pragma no branch + assert attributes["repo"] is None or isinstance(attributes["repo"], dict), attributes["repo"] + self._repo = None if attributes["repo"] is None else Repository.Repository(self._requester, attributes["repo"], completed=False) + if "type" in attributes: # pragma no branch + assert attributes["type"] is None or isinstance(attributes["type"], (str, unicode)), attributes["type"] + self._type = attributes["type"] diff --git a/github/File.py b/github/File.py index 9eb1af92..e3395910 100644 --- a/github/File.py +++ b/github/File.py @@ -13,44 +13,45 @@ import GithubObject -class File( GithubObject.BasicGithubObject ): + +class File(GithubObject.BasicGithubObject): @property - def additions( self ): - return self._NoneIfNotSet( self._additions ) + def additions(self): + return self._NoneIfNotSet(self._additions) @property - def blob_url( self ): - return self._NoneIfNotSet( self._blob_url ) + def blob_url(self): + return self._NoneIfNotSet(self._blob_url) @property - def changes( self ): - return self._NoneIfNotSet( self._changes ) + def changes(self): + return self._NoneIfNotSet(self._changes) @property - def deletions( self ): - return self._NoneIfNotSet( self._deletions ) + def deletions(self): + return self._NoneIfNotSet(self._deletions) @property - def filename( self ): - return self._NoneIfNotSet( self._filename ) + def filename(self): + return self._NoneIfNotSet(self._filename) @property - def patch( self ): - return self._NoneIfNotSet( self._patch ) + def patch(self): + return self._NoneIfNotSet(self._patch) @property - def raw_url( self ): - return self._NoneIfNotSet( self._raw_url ) + def raw_url(self): + return self._NoneIfNotSet(self._raw_url) @property - def sha( self ): - return self._NoneIfNotSet( self._sha ) + def sha(self): + return self._NoneIfNotSet(self._sha) @property - def status( self ): - return self._NoneIfNotSet( self._status ) + def status(self): + return self._NoneIfNotSet(self._status) - def _initAttributes( self ): + def _initAttributes(self): self._additions = GithubObject.NotSet self._blob_url = GithubObject.NotSet self._changes = GithubObject.NotSet @@ -61,31 +62,31 @@ class File( GithubObject.BasicGithubObject ): self._sha = GithubObject.NotSet self._status = GithubObject.NotSet - def _useAttributes( self, attributes ): - if "additions" in attributes: # pragma no branch - assert attributes[ "additions" ] is None or isinstance( attributes[ "additions" ], int ), attributes[ "additions" ] - self._additions = attributes[ "additions" ] - if "blob_url" in attributes: # pragma no branch - assert attributes[ "blob_url" ] is None or isinstance( attributes[ "blob_url" ], ( str, unicode ) ), attributes[ "blob_url" ] - self._blob_url = attributes[ "blob_url" ] - if "changes" in attributes: # pragma no branch - assert attributes[ "changes" ] is None or isinstance( attributes[ "changes" ], int ), attributes[ "changes" ] - self._changes = attributes[ "changes" ] - if "deletions" in attributes: # pragma no branch - assert attributes[ "deletions" ] is None or isinstance( attributes[ "deletions" ], int ), attributes[ "deletions" ] - self._deletions = attributes[ "deletions" ] - if "filename" in attributes: # pragma no branch - assert attributes[ "filename" ] is None or isinstance( attributes[ "filename" ], ( str, unicode ) ), attributes[ "filename" ] - self._filename = attributes[ "filename" ] - if "patch" in attributes: # pragma no branch - assert attributes[ "patch" ] is None or isinstance( attributes[ "patch" ], ( str, unicode ) ), attributes[ "patch" ] - self._patch = attributes[ "patch" ] - if "raw_url" in attributes: # pragma no branch - assert attributes[ "raw_url" ] is None or isinstance( attributes[ "raw_url" ], ( str, unicode ) ), attributes[ "raw_url" ] - self._raw_url = attributes[ "raw_url" ] - if "sha" in attributes: # pragma no branch - assert attributes[ "sha" ] is None or isinstance( attributes[ "sha" ], ( str, unicode ) ), attributes[ "sha" ] - self._sha = attributes[ "sha" ] - if "status" in attributes: # pragma no branch - assert attributes[ "status" ] is None or isinstance( attributes[ "status" ], ( str, unicode ) ), attributes[ "status" ] - self._status = attributes[ "status" ] + def _useAttributes(self, attributes): + if "additions" in attributes: # pragma no branch + assert attributes["additions"] is None or isinstance(attributes["additions"], int), attributes["additions"] + self._additions = attributes["additions"] + if "blob_url" in attributes: # pragma no branch + assert attributes["blob_url"] is None or isinstance(attributes["blob_url"], (str, unicode)), attributes["blob_url"] + self._blob_url = attributes["blob_url"] + if "changes" in attributes: # pragma no branch + assert attributes["changes"] is None or isinstance(attributes["changes"], int), attributes["changes"] + self._changes = attributes["changes"] + if "deletions" in attributes: # pragma no branch + assert attributes["deletions"] is None or isinstance(attributes["deletions"], int), attributes["deletions"] + self._deletions = attributes["deletions"] + if "filename" in attributes: # pragma no branch + assert attributes["filename"] is None or isinstance(attributes["filename"], (str, unicode)), attributes["filename"] + self._filename = attributes["filename"] + if "patch" in attributes: # pragma no branch + assert attributes["patch"] is None or isinstance(attributes["patch"], (str, unicode)), attributes["patch"] + self._patch = attributes["patch"] + if "raw_url" in attributes: # pragma no branch + assert attributes["raw_url"] is None or isinstance(attributes["raw_url"], (str, unicode)), attributes["raw_url"] + self._raw_url = attributes["raw_url"] + if "sha" in attributes: # pragma no branch + assert attributes["sha"] is None or isinstance(attributes["sha"], (str, unicode)), attributes["sha"] + self._sha = attributes["sha"] + if "status" in attributes: # pragma no branch + assert attributes["status"] is None or isinstance(attributes["status"], (str, unicode)), attributes["status"] + self._status = attributes["status"] diff --git a/github/Gist.py b/github/Gist.py index df20199d..c3b382a5 100644 --- a/github/Gist.py +++ b/github/Gist.py @@ -21,84 +21,85 @@ import GistFile import InputFileContent import GistHistoryState -class Gist( GithubObject.GithubObject ): + +class Gist(GithubObject.GithubObject): @property - def comments( self ): - self._completeIfNotSet( self._comments ) - return self._NoneIfNotSet( self._comments ) + def comments(self): + self._completeIfNotSet(self._comments) + return self._NoneIfNotSet(self._comments) @property - def created_at( self ): - self._completeIfNotSet( self._created_at ) - return self._NoneIfNotSet( self._created_at ) + def created_at(self): + self._completeIfNotSet(self._created_at) + return self._NoneIfNotSet(self._created_at) @property - def description( self ): - self._completeIfNotSet( self._description ) - return self._NoneIfNotSet( self._description ) + def description(self): + self._completeIfNotSet(self._description) + return self._NoneIfNotSet(self._description) @property - def files( self ): - self._completeIfNotSet( self._files ) - return self._NoneIfNotSet( self._files ) + def files(self): + self._completeIfNotSet(self._files) + return self._NoneIfNotSet(self._files) @property - def fork_of( self ): - self._completeIfNotSet( self._fork_of ) - return self._NoneIfNotSet( self._fork_of ) + def fork_of(self): + self._completeIfNotSet(self._fork_of) + return self._NoneIfNotSet(self._fork_of) @property - def forks( self ): - self._completeIfNotSet( self._forks ) - return self._NoneIfNotSet( self._forks ) + def forks(self): + self._completeIfNotSet(self._forks) + return self._NoneIfNotSet(self._forks) @property - def git_pull_url( self ): - self._completeIfNotSet( self._git_pull_url ) - return self._NoneIfNotSet( self._git_pull_url ) + def git_pull_url(self): + self._completeIfNotSet(self._git_pull_url) + return self._NoneIfNotSet(self._git_pull_url) @property - def git_push_url( self ): - self._completeIfNotSet( self._git_push_url ) - return self._NoneIfNotSet( self._git_push_url ) + def git_push_url(self): + self._completeIfNotSet(self._git_push_url) + return self._NoneIfNotSet(self._git_push_url) @property - def history( self ): - self._completeIfNotSet( self._history ) - return self._NoneIfNotSet( self._history ) + def history(self): + self._completeIfNotSet(self._history) + return self._NoneIfNotSet(self._history) @property - def html_url( self ): - self._completeIfNotSet( self._html_url ) - return self._NoneIfNotSet( self._html_url ) + def html_url(self): + self._completeIfNotSet(self._html_url) + return self._NoneIfNotSet(self._html_url) @property - def id( self ): - self._completeIfNotSet( self._id ) - return self._NoneIfNotSet( self._id ) + def id(self): + self._completeIfNotSet(self._id) + return self._NoneIfNotSet(self._id) @property - def public( self ): - self._completeIfNotSet( self._public ) - return self._NoneIfNotSet( self._public ) + def public(self): + self._completeIfNotSet(self._public) + return self._NoneIfNotSet(self._public) @property - def updated_at( self ): - self._completeIfNotSet( self._updated_at ) - return self._NoneIfNotSet( self._updated_at ) + def updated_at(self): + self._completeIfNotSet(self._updated_at) + return self._NoneIfNotSet(self._updated_at) @property - def url( self ): - self._completeIfNotSet( self._url ) - return self._NoneIfNotSet( self._url ) + def url(self): + self._completeIfNotSet(self._url) + return self._NoneIfNotSet(self._url) @property - def user( self ): - self._completeIfNotSet( self._user ) - return self._NoneIfNotSet( self._user ) + def user(self): + self._completeIfNotSet(self._user) + return self._NoneIfNotSet(self._user) - def create_comment( self, body ): - assert isinstance( body, ( str, unicode ) ), body + def create_comment(self, body): + assert isinstance(body, (str, unicode)), body post_parameters = { "body": body, } @@ -108,18 +109,18 @@ class Gist( GithubObject.GithubObject ): None, post_parameters ) - return GistComment.GistComment( self._requester, data, completed = True ) + return GistComment.GistComment(self._requester, data, completed=True) - def create_fork( self ): + def create_fork(self): headers, data = self._requester.requestAndCheck( "POST", self.url + "/fork", None, None ) - return Gist( self._requester, data, completed = True ) + return Gist(self._requester, data, completed=True) - def delete( self ): + def delete(self): headers, data = self._requester.requestAndCheck( "DELETE", self.url, @@ -127,33 +128,33 @@ class Gist( GithubObject.GithubObject ): None ) - def edit( self, description = GithubObject.NotSet, files = GithubObject.NotSet ): - assert description is GithubObject.NotSet or isinstance( description, ( str, unicode ) ), description - assert files is GithubObject.NotSet or all( isinstance( element, InputFileContent.InputFileContent ) for element in files.itervalues() ), files + def edit(self, description=GithubObject.NotSet, files=GithubObject.NotSet): + assert description is GithubObject.NotSet or isinstance(description, (str, unicode)), description + assert files is GithubObject.NotSet or all(isinstance(element, InputFileContent.InputFileContent) for element in files.itervalues()), files post_parameters = dict() if description is not GithubObject.NotSet: - post_parameters[ "description" ] = description + post_parameters["description"] = description if files is not GithubObject.NotSet: - post_parameters[ "files" ] = dict( ( key, value._identity ) for key, value in files.iteritems() ) + post_parameters["files"] = dict((key, value._identity) for key, value in files.iteritems()) headers, data = self._requester.requestAndCheck( "PATCH", self.url, None, post_parameters ) - self._useAttributes( data ) + self._useAttributes(data) - def get_comment( self, id ): - assert isinstance( id, int ), id + def get_comment(self, id): + assert isinstance(id, int), id headers, data = self._requester.requestAndCheck( "GET", - "/gists/comments/" + str( id ), + "/gists/comments/" + str(id), None, None ) - return GistComment.GistComment( self._requester, data, completed = True ) + return GistComment.GistComment(self._requester, data, completed=True) - def get_comments( self ): + def get_comments(self): return PaginatedList.PaginatedList( GistComment.GistComment, self._requester, @@ -161,7 +162,7 @@ class Gist( GithubObject.GithubObject ): None ) - def is_starred( self ): + def is_starred(self): status, headers, data = self._requester.requestRaw( "GET", self.url + "/star", @@ -170,7 +171,7 @@ class Gist( GithubObject.GithubObject ): ) return status == 204 - def reset_starred( self ): + def reset_starred(self): headers, data = self._requester.requestAndCheck( "DELETE", self.url + "/star", @@ -178,7 +179,7 @@ class Gist( GithubObject.GithubObject ): None ) - def set_starred( self ): + def set_starred(self): headers, data = self._requester.requestAndCheck( "PUT", self.url + "/star", @@ -186,7 +187,7 @@ class Gist( GithubObject.GithubObject ): None ) - def _initAttributes( self ): + def _initAttributes(self): self._comments = GithubObject.NotSet self._created_at = GithubObject.NotSet self._description = GithubObject.NotSet @@ -203,58 +204,58 @@ class Gist( GithubObject.GithubObject ): self._url = GithubObject.NotSet self._user = GithubObject.NotSet - def _useAttributes( self, attributes ): - if "comments" in attributes: # pragma no branch - assert attributes[ "comments" ] is None or isinstance( attributes[ "comments" ], int ), attributes[ "comments" ] - self._comments = attributes[ "comments" ] - if "created_at" in attributes: # pragma no branch - assert attributes[ "created_at" ] is None or isinstance( attributes[ "created_at" ], ( str, unicode ) ), attributes[ "created_at" ] - self._created_at = self._parseDatetime( attributes[ "created_at" ] ) - if "description" in attributes: # pragma no branch - assert attributes[ "description" ] is None or isinstance( attributes[ "description" ], ( str, unicode ) ), attributes[ "description" ] - self._description = attributes[ "description" ] - if "files" in attributes: # pragma no branch - assert attributes[ "files" ] is None or all( isinstance( element, dict ) for element in attributes[ "files" ].itervalues() ), attributes[ "files" ] - self._files = None if attributes[ "files" ] is None else dict( - ( key, GistFile.GistFile( self._requester, element, completed = False ) ) - for key, element in attributes[ "files" ].iteritems() + def _useAttributes(self, attributes): + if "comments" in attributes: # pragma no branch + assert attributes["comments"] is None or isinstance(attributes["comments"], int), attributes["comments"] + self._comments = attributes["comments"] + if "created_at" in attributes: # pragma no branch + assert attributes["created_at"] is None or isinstance(attributes["created_at"], (str, unicode)), attributes["created_at"] + self._created_at = self._parseDatetime(attributes["created_at"]) + if "description" in attributes: # pragma no branch + assert attributes["description"] is None or isinstance(attributes["description"], (str, unicode)), attributes["description"] + self._description = attributes["description"] + if "files" in attributes: # pragma no branch + assert attributes["files"] is None or all(isinstance(element, dict) for element in attributes["files"].itervalues()), attributes["files"] + self._files = None if attributes["files"] is None else dict( + (key, GistFile.GistFile(self._requester, element, completed=False)) + for key, element in attributes["files"].iteritems() ) - if "fork_of" in attributes: # pragma no branch - assert attributes[ "fork_of" ] is None or isinstance( attributes[ "fork_of" ], dict ), attributes[ "fork_of" ] - self._fork_of = None if attributes[ "fork_of" ] is None else Gist( self._requester, attributes[ "fork_of" ], completed = False ) - if "forks" in attributes: # pragma no branch - assert attributes[ "forks" ] is None or all( isinstance( element, dict ) for element in attributes[ "forks" ] ), attributes[ "forks" ] - self._forks = None if attributes[ "forks" ] is None else [ - Gist( self._requester, element, completed = False ) - for element in attributes[ "forks" ] + if "fork_of" in attributes: # pragma no branch + assert attributes["fork_of"] is None or isinstance(attributes["fork_of"], dict), attributes["fork_of"] + self._fork_of = None if attributes["fork_of"] is None else Gist(self._requester, attributes["fork_of"], completed=False) + if "forks" in attributes: # pragma no branch + assert attributes["forks"] is None or all(isinstance(element, dict) for element in attributes["forks"]), attributes["forks"] + self._forks = None if attributes["forks"] is None else [ + Gist(self._requester, element, completed=False) + for element in attributes["forks"] ] - if "git_pull_url" in attributes: # pragma no branch - assert attributes[ "git_pull_url" ] is None or isinstance( attributes[ "git_pull_url" ], ( str, unicode ) ), attributes[ "git_pull_url" ] - self._git_pull_url = attributes[ "git_pull_url" ] - if "git_push_url" in attributes: # pragma no branch - assert attributes[ "git_push_url" ] is None or isinstance( attributes[ "git_push_url" ], ( str, unicode ) ), attributes[ "git_push_url" ] - self._git_push_url = attributes[ "git_push_url" ] - if "history" in attributes: # pragma no branch - assert attributes[ "history" ] is None or all( isinstance( element, dict ) for element in attributes[ "history" ] ), attributes[ "history" ] - self._history = None if attributes[ "history" ] is None else [ - GistHistoryState.GistHistoryState( self._requester, element, completed = False ) - for element in attributes[ "history" ] + if "git_pull_url" in attributes: # pragma no branch + assert attributes["git_pull_url"] is None or isinstance(attributes["git_pull_url"], (str, unicode)), attributes["git_pull_url"] + self._git_pull_url = attributes["git_pull_url"] + if "git_push_url" in attributes: # pragma no branch + assert attributes["git_push_url"] is None or isinstance(attributes["git_push_url"], (str, unicode)), attributes["git_push_url"] + self._git_push_url = attributes["git_push_url"] + if "history" in attributes: # pragma no branch + assert attributes["history"] is None or all(isinstance(element, dict) for element in attributes["history"]), attributes["history"] + self._history = None if attributes["history"] is None else [ + GistHistoryState.GistHistoryState(self._requester, element, completed=False) + for element in attributes["history"] ] - if "html_url" in attributes: # pragma no branch - assert attributes[ "html_url" ] is None or isinstance( attributes[ "html_url" ], ( str, unicode ) ), attributes[ "html_url" ] - self._html_url = attributes[ "html_url" ] - if "id" in attributes: # pragma no branch - assert attributes[ "id" ] is None or isinstance( attributes[ "id" ], ( str, unicode ) ), attributes[ "id" ] - self._id = attributes[ "id" ] - if "public" in attributes: # pragma no branch - assert attributes[ "public" ] is None or isinstance( attributes[ "public" ], bool ), attributes[ "public" ] - self._public = attributes[ "public" ] - if "updated_at" in attributes: # pragma no branch - assert attributes[ "updated_at" ] is None or isinstance( attributes[ "updated_at" ], ( str, unicode ) ), attributes[ "updated_at" ] - self._updated_at = self._parseDatetime( attributes[ "updated_at" ] ) - if "url" in attributes: # pragma no branch - assert attributes[ "url" ] is None or isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ] - self._url = attributes[ "url" ] - if "user" in attributes: # pragma no branch - assert attributes[ "user" ] is None or isinstance( attributes[ "user" ], dict ), attributes[ "user" ] - self._user = None if attributes[ "user" ] is None else NamedUser.NamedUser( self._requester, attributes[ "user" ], completed = False ) + if "html_url" in attributes: # pragma no branch + assert attributes["html_url"] is None or isinstance(attributes["html_url"], (str, unicode)), attributes["html_url"] + self._html_url = attributes["html_url"] + if "id" in attributes: # pragma no branch + assert attributes["id"] is None or isinstance(attributes["id"], (str, unicode)), attributes["id"] + self._id = attributes["id"] + if "public" in attributes: # pragma no branch + assert attributes["public"] is None or isinstance(attributes["public"], bool), attributes["public"] + self._public = attributes["public"] + if "updated_at" in attributes: # pragma no branch + assert attributes["updated_at"] is None or isinstance(attributes["updated_at"], (str, unicode)), attributes["updated_at"] + self._updated_at = self._parseDatetime(attributes["updated_at"]) + if "url" in attributes: # pragma no branch + assert attributes["url"] is None or isinstance(attributes["url"], (str, unicode)), attributes["url"] + self._url = attributes["url"] + if "user" in attributes: # pragma no branch + assert attributes["user"] is None or isinstance(attributes["user"], dict), attributes["user"] + self._user = None if attributes["user"] is None else NamedUser.NamedUser(self._requester, attributes["user"], completed=False) diff --git a/github/GistComment.py b/github/GistComment.py index bd4d7eaa..4273987b 100644 --- a/github/GistComment.py +++ b/github/GistComment.py @@ -15,38 +15,39 @@ import GithubObject import NamedUser -class GistComment( GithubObject.GithubObject ): + +class GistComment(GithubObject.GithubObject): @property - def body( self ): - self._completeIfNotSet( self._body ) - return self._NoneIfNotSet( self._body ) + def body(self): + self._completeIfNotSet(self._body) + return self._NoneIfNotSet(self._body) @property - def created_at( self ): - self._completeIfNotSet( self._created_at ) - return self._NoneIfNotSet( self._created_at ) + def created_at(self): + self._completeIfNotSet(self._created_at) + return self._NoneIfNotSet(self._created_at) @property - def id( self ): - self._completeIfNotSet( self._id ) - return self._NoneIfNotSet( self._id ) + def id(self): + self._completeIfNotSet(self._id) + return self._NoneIfNotSet(self._id) @property - def updated_at( self ): - self._completeIfNotSet( self._updated_at ) - return self._NoneIfNotSet( self._updated_at ) + def updated_at(self): + self._completeIfNotSet(self._updated_at) + return self._NoneIfNotSet(self._updated_at) @property - def url( self ): - self._completeIfNotSet( self._url ) - return self._NoneIfNotSet( self._url ) + def url(self): + self._completeIfNotSet(self._url) + return self._NoneIfNotSet(self._url) @property - def user( self ): - self._completeIfNotSet( self._user ) - return self._NoneIfNotSet( self._user ) + def user(self): + self._completeIfNotSet(self._user) + return self._NoneIfNotSet(self._user) - def delete( self ): + def delete(self): headers, data = self._requester.requestAndCheck( "DELETE", self.url, @@ -54,8 +55,8 @@ class GistComment( GithubObject.GithubObject ): None ) - def edit( self, body ): - assert isinstance( body, ( str, unicode ) ), body + def edit(self, body): + assert isinstance(body, (str, unicode)), body post_parameters = { "body": body, } @@ -65,9 +66,9 @@ class GistComment( GithubObject.GithubObject ): None, post_parameters ) - self._useAttributes( data ) + self._useAttributes(data) - def _initAttributes( self ): + def _initAttributes(self): self._body = GithubObject.NotSet self._created_at = GithubObject.NotSet self._id = GithubObject.NotSet @@ -75,22 +76,22 @@ class GistComment( GithubObject.GithubObject ): self._url = GithubObject.NotSet self._user = GithubObject.NotSet - def _useAttributes( self, attributes ): - if "body" in attributes: # pragma no branch - assert attributes[ "body" ] is None or isinstance( attributes[ "body" ], ( str, unicode ) ), attributes[ "body" ] - self._body = attributes[ "body" ] - if "created_at" in attributes: # pragma no branch - assert attributes[ "created_at" ] is None or isinstance( attributes[ "created_at" ], ( str, unicode ) ), attributes[ "created_at" ] - self._created_at = self._parseDatetime( attributes[ "created_at" ] ) - if "id" in attributes: # pragma no branch - assert attributes[ "id" ] is None or isinstance( attributes[ "id" ], int ), attributes[ "id" ] - self._id = attributes[ "id" ] - if "updated_at" in attributes: # pragma no branch - assert attributes[ "updated_at" ] is None or isinstance( attributes[ "updated_at" ], ( str, unicode ) ), attributes[ "updated_at" ] - self._updated_at = self._parseDatetime( attributes[ "updated_at" ] ) - if "url" in attributes: # pragma no branch - assert attributes[ "url" ] is None or isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ] - self._url = attributes[ "url" ] - if "user" in attributes: # pragma no branch - assert attributes[ "user" ] is None or isinstance( attributes[ "user" ], dict ), attributes[ "user" ] - self._user = None if attributes[ "user" ] is None else NamedUser.NamedUser( self._requester, attributes[ "user" ], completed = False ) + def _useAttributes(self, attributes): + if "body" in attributes: # pragma no branch + assert attributes["body"] is None or isinstance(attributes["body"], (str, unicode)), attributes["body"] + self._body = attributes["body"] + if "created_at" in attributes: # pragma no branch + assert attributes["created_at"] is None or isinstance(attributes["created_at"], (str, unicode)), attributes["created_at"] + self._created_at = self._parseDatetime(attributes["created_at"]) + if "id" in attributes: # pragma no branch + assert attributes["id"] is None or isinstance(attributes["id"], int), attributes["id"] + self._id = attributes["id"] + if "updated_at" in attributes: # pragma no branch + assert attributes["updated_at"] is None or isinstance(attributes["updated_at"], (str, unicode)), attributes["updated_at"] + self._updated_at = self._parseDatetime(attributes["updated_at"]) + if "url" in attributes: # pragma no branch + assert attributes["url"] is None or isinstance(attributes["url"], (str, unicode)), attributes["url"] + self._url = attributes["url"] + if "user" in attributes: # pragma no branch + assert attributes["user"] is None or isinstance(attributes["user"], dict), attributes["user"] + self._user = None if attributes["user"] is None else NamedUser.NamedUser(self._requester, attributes["user"], completed=False) diff --git a/github/GistFile.py b/github/GistFile.py index 3b4e418b..194f64ed 100644 --- a/github/GistFile.py +++ b/github/GistFile.py @@ -13,47 +13,48 @@ import GithubObject -class GistFile( GithubObject.BasicGithubObject ): + +class GistFile(GithubObject.BasicGithubObject): @property - def content( self ): - return self._NoneIfNotSet( self._content ) + def content(self): + return self._NoneIfNotSet(self._content) @property - def filename( self ): - return self._NoneIfNotSet( self._filename ) + def filename(self): + return self._NoneIfNotSet(self._filename) @property - def language( self ): - return self._NoneIfNotSet( self._language ) + def language(self): + return self._NoneIfNotSet(self._language) @property - def raw_url( self ): - return self._NoneIfNotSet( self._raw_url ) + def raw_url(self): + return self._NoneIfNotSet(self._raw_url) @property - def size( self ): - return self._NoneIfNotSet( self._size ) + def size(self): + return self._NoneIfNotSet(self._size) - def _initAttributes( self ): + def _initAttributes(self): self._content = GithubObject.NotSet self._filename = GithubObject.NotSet self._language = GithubObject.NotSet self._raw_url = GithubObject.NotSet self._size = GithubObject.NotSet - def _useAttributes( self, attributes ): - if "content" in attributes: # pragma no branch - assert attributes[ "content" ] is None or isinstance( attributes[ "content" ], ( str, unicode ) ), attributes[ "content" ] - self._content = attributes[ "content" ] - if "filename" in attributes: # pragma no branch - assert attributes[ "filename" ] is None or isinstance( attributes[ "filename" ], ( str, unicode ) ), attributes[ "filename" ] - self._filename = attributes[ "filename" ] - if "language" in attributes: # pragma no branch - assert attributes[ "language" ] is None or isinstance( attributes[ "language" ], ( str, unicode ) ), attributes[ "language" ] - self._language = attributes[ "language" ] - if "raw_url" in attributes: # pragma no branch - assert attributes[ "raw_url" ] is None or isinstance( attributes[ "raw_url" ], ( str, unicode ) ), attributes[ "raw_url" ] - self._raw_url = attributes[ "raw_url" ] - if "size" in attributes: # pragma no branch - assert attributes[ "size" ] is None or isinstance( attributes[ "size" ], int ), attributes[ "size" ] - self._size = attributes[ "size" ] + def _useAttributes(self, attributes): + if "content" in attributes: # pragma no branch + assert attributes["content"] is None or isinstance(attributes["content"], (str, unicode)), attributes["content"] + self._content = attributes["content"] + if "filename" in attributes: # pragma no branch + assert attributes["filename"] is None or isinstance(attributes["filename"], (str, unicode)), attributes["filename"] + self._filename = attributes["filename"] + if "language" in attributes: # pragma no branch + assert attributes["language"] is None or isinstance(attributes["language"], (str, unicode)), attributes["language"] + self._language = attributes["language"] + if "raw_url" in attributes: # pragma no branch + assert attributes["raw_url"] is None or isinstance(attributes["raw_url"], (str, unicode)), attributes["raw_url"] + self._raw_url = attributes["raw_url"] + if "size" in attributes: # pragma no branch + assert attributes["size"] is None or isinstance(attributes["size"], int), attributes["size"] + self._size = attributes["size"] diff --git a/github/GistHistoryState.py b/github/GistHistoryState.py index 016694a7..19a46abc 100644 --- a/github/GistHistoryState.py +++ b/github/GistHistoryState.py @@ -16,52 +16,53 @@ import GithubObject import NamedUser import CommitStats -class GistHistoryState( GithubObject.GithubObject ): + +class GistHistoryState(GithubObject.GithubObject): @property - def change_status( self ): - self._completeIfNotSet( self._change_status ) - return self._NoneIfNotSet( self._change_status ) + def change_status(self): + self._completeIfNotSet(self._change_status) + return self._NoneIfNotSet(self._change_status) @property - def committed_at( self ): - self._completeIfNotSet( self._committed_at ) - return self._NoneIfNotSet( self._committed_at ) + def committed_at(self): + self._completeIfNotSet(self._committed_at) + return self._NoneIfNotSet(self._committed_at) @property - def url( self ): - self._completeIfNotSet( self._url ) - return self._NoneIfNotSet( self._url ) + def url(self): + self._completeIfNotSet(self._url) + return self._NoneIfNotSet(self._url) @property - def user( self ): - self._completeIfNotSet( self._user ) - return self._NoneIfNotSet( self._user ) + def user(self): + self._completeIfNotSet(self._user) + return self._NoneIfNotSet(self._user) @property - def version( self ): - self._completeIfNotSet( self._version ) - return self._NoneIfNotSet( self._version ) + def version(self): + self._completeIfNotSet(self._version) + return self._NoneIfNotSet(self._version) - def _initAttributes( self ): + def _initAttributes(self): self._change_status = GithubObject.NotSet self._committed_at = GithubObject.NotSet self._url = GithubObject.NotSet self._user = GithubObject.NotSet self._version = GithubObject.NotSet - def _useAttributes( self, attributes ): - if "change_status" in attributes: # pragma no branch - assert attributes[ "change_status" ] is None or isinstance( attributes[ "change_status" ], dict ), attributes[ "change_status" ] - self._change_status = None if attributes[ "change_status" ] is None else CommitStats.CommitStats( self._requester, attributes[ "change_status" ], completed = False ) - if "committed_at" in attributes: # pragma no branch - assert attributes[ "committed_at" ] is None or isinstance( attributes[ "committed_at" ], ( str, unicode ) ), attributes[ "committed_at" ] - self._committed_at = self._parseDatetime( attributes[ "committed_at" ] ) - if "url" in attributes: # pragma no branch - assert attributes[ "url" ] is None or isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ] - self._url = attributes[ "url" ] - if "user" in attributes: # pragma no branch - assert attributes[ "user" ] is None or isinstance( attributes[ "user" ], dict ), attributes[ "user" ] - self._user = None if attributes[ "user" ] is None else NamedUser.NamedUser( self._requester, attributes[ "user" ], completed = False ) - if "version" in attributes: # pragma no branch - assert attributes[ "version" ] is None or isinstance( attributes[ "version" ], ( str, unicode ) ), attributes[ "version" ] - self._version = attributes[ "version" ] + def _useAttributes(self, attributes): + if "change_status" in attributes: # pragma no branch + assert attributes["change_status"] is None or isinstance(attributes["change_status"], dict), attributes["change_status"] + self._change_status = None if attributes["change_status"] is None else CommitStats.CommitStats(self._requester, attributes["change_status"], completed=False) + if "committed_at" in attributes: # pragma no branch + assert attributes["committed_at"] is None or isinstance(attributes["committed_at"], (str, unicode)), attributes["committed_at"] + self._committed_at = self._parseDatetime(attributes["committed_at"]) + if "url" in attributes: # pragma no branch + assert attributes["url"] is None or isinstance(attributes["url"], (str, unicode)), attributes["url"] + self._url = attributes["url"] + if "user" in attributes: # pragma no branch + assert attributes["user"] is None or isinstance(attributes["user"], dict), attributes["user"] + self._user = None if attributes["user"] is None else NamedUser.NamedUser(self._requester, attributes["user"], completed=False) + if "version" in attributes: # pragma no branch + assert attributes["version"] is None or isinstance(attributes["version"], (str, unicode)), attributes["version"] + self._version = attributes["version"] diff --git a/github/GitAuthor.py b/github/GitAuthor.py index 8542229b..4e99645b 100644 --- a/github/GitAuthor.py +++ b/github/GitAuthor.py @@ -13,31 +13,32 @@ import GithubObject -class GitAuthor( GithubObject.BasicGithubObject ): + +class GitAuthor(GithubObject.BasicGithubObject): @property - def date( self ): - return self._NoneIfNotSet( self._date ) + def date(self): + return self._NoneIfNotSet(self._date) @property - def email( self ): - return self._NoneIfNotSet( self._email ) + def email(self): + return self._NoneIfNotSet(self._email) @property - def name( self ): - return self._NoneIfNotSet( self._name ) + def name(self): + return self._NoneIfNotSet(self._name) - def _initAttributes( self ): + def _initAttributes(self): self._date = GithubObject.NotSet self._email = GithubObject.NotSet self._name = GithubObject.NotSet - def _useAttributes( self, attributes ): - if "date" in attributes: # pragma no branch - assert attributes[ "date" ] is None or isinstance( attributes[ "date" ], ( str, unicode ) ), attributes[ "date" ] - self._date = self._parseDatetime( attributes[ "date" ] ) - if "email" in attributes: # pragma no branch - assert attributes[ "email" ] is None or isinstance( attributes[ "email" ], ( str, unicode ) ), attributes[ "email" ] - self._email = attributes[ "email" ] - if "name" in attributes: # pragma no branch - assert attributes[ "name" ] is None or isinstance( attributes[ "name" ], ( str, unicode ) ), attributes[ "name" ] - self._name = attributes[ "name" ] + def _useAttributes(self, attributes): + if "date" in attributes: # pragma no branch + assert attributes["date"] is None or isinstance(attributes["date"], (str, unicode)), attributes["date"] + self._date = self._parseDatetime(attributes["date"]) + if "email" in attributes: # pragma no branch + assert attributes["email"] is None or isinstance(attributes["email"], (str, unicode)), attributes["email"] + self._email = attributes["email"] + if "name" in attributes: # pragma no branch + assert attributes["name"] is None or isinstance(attributes["name"], (str, unicode)), attributes["name"] + self._name = attributes["name"] diff --git a/github/GitBlob.py b/github/GitBlob.py index 1a883c77..6e47584a 100644 --- a/github/GitBlob.py +++ b/github/GitBlob.py @@ -13,52 +13,53 @@ import GithubObject -class GitBlob( GithubObject.GithubObject ): + +class GitBlob(GithubObject.GithubObject): @property - def content( self ): - self._completeIfNotSet( self._content ) - return self._NoneIfNotSet( self._content ) + def content(self): + self._completeIfNotSet(self._content) + return self._NoneIfNotSet(self._content) @property - def encoding( self ): - self._completeIfNotSet( self._encoding ) - return self._NoneIfNotSet( self._encoding ) + def encoding(self): + self._completeIfNotSet(self._encoding) + return self._NoneIfNotSet(self._encoding) @property - def sha( self ): - self._completeIfNotSet( self._sha ) - return self._NoneIfNotSet( self._sha ) + def sha(self): + self._completeIfNotSet(self._sha) + return self._NoneIfNotSet(self._sha) @property - def size( self ): - self._completeIfNotSet( self._size ) - return self._NoneIfNotSet( self._size ) + def size(self): + self._completeIfNotSet(self._size) + return self._NoneIfNotSet(self._size) @property - def url( self ): - self._completeIfNotSet( self._url ) - return self._NoneIfNotSet( self._url ) + def url(self): + self._completeIfNotSet(self._url) + return self._NoneIfNotSet(self._url) - def _initAttributes( self ): + def _initAttributes(self): self._content = GithubObject.NotSet self._encoding = GithubObject.NotSet self._sha = GithubObject.NotSet self._size = GithubObject.NotSet self._url = GithubObject.NotSet - def _useAttributes( self, attributes ): - if "content" in attributes: # pragma no branch - assert attributes[ "content" ] is None or isinstance( attributes[ "content" ], ( str, unicode ) ), attributes[ "content" ] - self._content = attributes[ "content" ] - if "encoding" in attributes: # pragma no branch - assert attributes[ "encoding" ] is None or isinstance( attributes[ "encoding" ], ( str, unicode ) ), attributes[ "encoding" ] - self._encoding = attributes[ "encoding" ] - if "sha" in attributes: # pragma no branch - assert attributes[ "sha" ] is None or isinstance( attributes[ "sha" ], ( str, unicode ) ), attributes[ "sha" ] - self._sha = attributes[ "sha" ] - if "size" in attributes: # pragma no branch - assert attributes[ "size" ] is None or isinstance( attributes[ "size" ], int ), attributes[ "size" ] - self._size = attributes[ "size" ] - if "url" in attributes: # pragma no branch - assert attributes[ "url" ] is None or isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ] - self._url = attributes[ "url" ] + def _useAttributes(self, attributes): + if "content" in attributes: # pragma no branch + assert attributes["content"] is None or isinstance(attributes["content"], (str, unicode)), attributes["content"] + self._content = attributes["content"] + if "encoding" in attributes: # pragma no branch + assert attributes["encoding"] is None or isinstance(attributes["encoding"], (str, unicode)), attributes["encoding"] + self._encoding = attributes["encoding"] + if "sha" in attributes: # pragma no branch + assert attributes["sha"] is None or isinstance(attributes["sha"], (str, unicode)), attributes["sha"] + self._sha = attributes["sha"] + if "size" in attributes: # pragma no branch + assert attributes["size"] is None or isinstance(attributes["size"], int), attributes["size"] + self._size = attributes["size"] + if "url" in attributes: # pragma no branch + assert attributes["url"] is None or isinstance(attributes["url"], (str, unicode)), attributes["url"] + self._url = attributes["url"] diff --git a/github/GitCommit.py b/github/GitCommit.py index 3feb4624..cd3a7057 100644 --- a/github/GitCommit.py +++ b/github/GitCommit.py @@ -17,47 +17,48 @@ import GitAuthor import GitCommit import GitTree -class GitCommit( GithubObject.GithubObject ): + +class GitCommit(GithubObject.GithubObject): @property - def author( self ): - self._completeIfNotSet( self._author ) - return self._NoneIfNotSet( self._author ) + def author(self): + self._completeIfNotSet(self._author) + return self._NoneIfNotSet(self._author) @property - def committer( self ): - self._completeIfNotSet( self._committer ) - return self._NoneIfNotSet( self._committer ) + def committer(self): + self._completeIfNotSet(self._committer) + return self._NoneIfNotSet(self._committer) @property - def message( self ): - self._completeIfNotSet( self._message ) - return self._NoneIfNotSet( self._message ) + def message(self): + self._completeIfNotSet(self._message) + return self._NoneIfNotSet(self._message) @property - def parents( self ): - self._completeIfNotSet( self._parents ) - return self._NoneIfNotSet( self._parents ) + def parents(self): + self._completeIfNotSet(self._parents) + return self._NoneIfNotSet(self._parents) @property - def sha( self ): - self._completeIfNotSet( self._sha ) - return self._NoneIfNotSet( self._sha ) + def sha(self): + self._completeIfNotSet(self._sha) + return self._NoneIfNotSet(self._sha) @property - def tree( self ): - self._completeIfNotSet( self._tree ) - return self._NoneIfNotSet( self._tree ) + def tree(self): + self._completeIfNotSet(self._tree) + return self._NoneIfNotSet(self._tree) @property - def url( self ): - self._completeIfNotSet( self._url ) - return self._NoneIfNotSet( self._url ) + def url(self): + self._completeIfNotSet(self._url) + return self._NoneIfNotSet(self._url) @property - def _identity( self ): + def _identity(self): return self.sha - def _initAttributes( self ): + def _initAttributes(self): self._author = GithubObject.NotSet self._committer = GithubObject.NotSet self._message = GithubObject.NotSet @@ -66,28 +67,28 @@ class GitCommit( GithubObject.GithubObject ): self._tree = GithubObject.NotSet self._url = GithubObject.NotSet - def _useAttributes( self, attributes ): - if "author" in attributes: # pragma no branch - assert attributes[ "author" ] is None or isinstance( attributes[ "author" ], dict ), attributes[ "author" ] - self._author = None if attributes[ "author" ] is None else GitAuthor.GitAuthor( self._requester, attributes[ "author" ], completed = False ) - if "committer" in attributes: # pragma no branch - assert attributes[ "committer" ] is None or isinstance( attributes[ "committer" ], dict ), attributes[ "committer" ] - self._committer = None if attributes[ "committer" ] is None else GitAuthor.GitAuthor( self._requester, attributes[ "committer" ], completed = False ) - if "message" in attributes: # pragma no branch - assert attributes[ "message" ] is None or isinstance( attributes[ "message" ], ( str, unicode ) ), attributes[ "message" ] - self._message = attributes[ "message" ] - if "parents" in attributes: # pragma no branch - assert attributes[ "parents" ] is None or all( isinstance( element, dict ) for element in attributes[ "parents" ] ), attributes[ "parents" ] - self._parents = None if attributes[ "parents" ] is None else [ - GitCommit( self._requester, element, completed = False ) - for element in attributes[ "parents" ] + def _useAttributes(self, attributes): + if "author" in attributes: # pragma no branch + assert attributes["author"] is None or isinstance(attributes["author"], dict), attributes["author"] + self._author = None if attributes["author"] is None else GitAuthor.GitAuthor(self._requester, attributes["author"], completed=False) + if "committer" in attributes: # pragma no branch + assert attributes["committer"] is None or isinstance(attributes["committer"], dict), attributes["committer"] + self._committer = None if attributes["committer"] is None else GitAuthor.GitAuthor(self._requester, attributes["committer"], completed=False) + if "message" in attributes: # pragma no branch + assert attributes["message"] is None or isinstance(attributes["message"], (str, unicode)), attributes["message"] + self._message = attributes["message"] + if "parents" in attributes: # pragma no branch + assert attributes["parents"] is None or all(isinstance(element, dict) for element in attributes["parents"]), attributes["parents"] + self._parents = None if attributes["parents"] is None else [ + GitCommit(self._requester, element, completed=False) + for element in attributes["parents"] ] - if "sha" in attributes: # pragma no branch - assert attributes[ "sha" ] is None or isinstance( attributes[ "sha" ], ( str, unicode ) ), attributes[ "sha" ] - self._sha = attributes[ "sha" ] - if "tree" in attributes: # pragma no branch - assert attributes[ "tree" ] is None or isinstance( attributes[ "tree" ], dict ), attributes[ "tree" ] - self._tree = None if attributes[ "tree" ] is None else GitTree.GitTree( self._requester, attributes[ "tree" ], completed = False ) - if "url" in attributes: # pragma no branch - assert attributes[ "url" ] is None or isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ] - self._url = attributes[ "url" ] + if "sha" in attributes: # pragma no branch + assert attributes["sha"] is None or isinstance(attributes["sha"], (str, unicode)), attributes["sha"] + self._sha = attributes["sha"] + if "tree" in attributes: # pragma no branch + assert attributes["tree"] is None or isinstance(attributes["tree"], dict), attributes["tree"] + self._tree = None if attributes["tree"] is None else GitTree.GitTree(self._requester, attributes["tree"], completed=False) + if "url" in attributes: # pragma no branch + assert attributes["url"] is None or isinstance(attributes["url"], (str, unicode)), attributes["url"] + self._url = attributes["url"] diff --git a/github/GitObject.py b/github/GitObject.py index 8e5126a0..15ed92b5 100644 --- a/github/GitObject.py +++ b/github/GitObject.py @@ -13,31 +13,32 @@ import GithubObject -class GitObject( GithubObject.BasicGithubObject ): + +class GitObject(GithubObject.BasicGithubObject): @property - def sha( self ): - return self._NoneIfNotSet( self._sha ) + def sha(self): + return self._NoneIfNotSet(self._sha) @property - def type( self ): - return self._NoneIfNotSet( self._type ) + def type(self): + return self._NoneIfNotSet(self._type) @property - def url( self ): - return self._NoneIfNotSet( self._url ) + def url(self): + return self._NoneIfNotSet(self._url) - def _initAttributes( self ): + def _initAttributes(self): self._sha = GithubObject.NotSet self._type = GithubObject.NotSet self._url = GithubObject.NotSet - def _useAttributes( self, attributes ): - if "sha" in attributes: # pragma no branch - assert attributes[ "sha" ] is None or isinstance( attributes[ "sha" ], ( str, unicode ) ), attributes[ "sha" ] - self._sha = attributes[ "sha" ] - if "type" in attributes: # pragma no branch - assert attributes[ "type" ] is None or isinstance( attributes[ "type" ], ( str, unicode ) ), attributes[ "type" ] - self._type = attributes[ "type" ] - if "url" in attributes: # pragma no branch - assert attributes[ "url" ] is None or isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ] - self._url = attributes[ "url" ] + def _useAttributes(self, attributes): + if "sha" in attributes: # pragma no branch + assert attributes["sha"] is None or isinstance(attributes["sha"], (str, unicode)), attributes["sha"] + self._sha = attributes["sha"] + if "type" in attributes: # pragma no branch + assert attributes["type"] is None or isinstance(attributes["type"], (str, unicode)), attributes["type"] + self._type = attributes["type"] + if "url" in attributes: # pragma no branch + assert attributes["url"] is None or isinstance(attributes["url"], (str, unicode)), attributes["url"] + self._url = attributes["url"] diff --git a/github/GitRef.py b/github/GitRef.py index b9cfee0c..eab64cc8 100644 --- a/github/GitRef.py +++ b/github/GitRef.py @@ -15,23 +15,24 @@ import GithubObject import GitObject -class GitRef( GithubObject.GithubObject ): + +class GitRef(GithubObject.GithubObject): @property - def object( self ): - self._completeIfNotSet( self._object ) - return self._NoneIfNotSet( self._object ) + def object(self): + self._completeIfNotSet(self._object) + return self._NoneIfNotSet(self._object) @property - def ref( self ): - self._completeIfNotSet( self._ref ) - return self._NoneIfNotSet( self._ref ) + def ref(self): + self._completeIfNotSet(self._ref) + return self._NoneIfNotSet(self._ref) @property - def url( self ): - self._completeIfNotSet( self._url ) - return self._NoneIfNotSet( self._url ) + def url(self): + self._completeIfNotSet(self._url) + return self._NoneIfNotSet(self._url) - def delete( self ): + def delete(self): headers, data = self._requester.requestAndCheck( "DELETE", self.url, @@ -39,34 +40,34 @@ class GitRef( GithubObject.GithubObject ): None ) - def edit( self, sha, force = GithubObject.NotSet ): - assert isinstance( sha, ( str, unicode ) ), sha - assert force is GithubObject.NotSet or isinstance( force, bool ), force + def edit(self, sha, force=GithubObject.NotSet): + assert isinstance(sha, (str, unicode)), sha + assert force is GithubObject.NotSet or isinstance(force, bool), force post_parameters = { "sha": sha, } if force is not GithubObject.NotSet: - post_parameters[ "force" ] = force + post_parameters["force"] = force headers, data = self._requester.requestAndCheck( "PATCH", self.url, None, post_parameters ) - self._useAttributes( data ) + self._useAttributes(data) - def _initAttributes( self ): + def _initAttributes(self): self._object = GithubObject.NotSet self._ref = GithubObject.NotSet self._url = GithubObject.NotSet - def _useAttributes( self, attributes ): - if "object" in attributes: # pragma no branch - assert attributes[ "object" ] is None or isinstance( attributes[ "object" ], dict ), attributes[ "object" ] - self._object = None if attributes[ "object" ] is None else GitObject.GitObject( self._requester, attributes[ "object" ], completed = False ) - if "ref" in attributes: # pragma no branch - assert attributes[ "ref" ] is None or isinstance( attributes[ "ref" ], ( str, unicode ) ), attributes[ "ref" ] - self._ref = attributes[ "ref" ] - if "url" in attributes: # pragma no branch - assert attributes[ "url" ] is None or isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ] - self._url = attributes[ "url" ] + def _useAttributes(self, attributes): + if "object" in attributes: # pragma no branch + assert attributes["object"] is None or isinstance(attributes["object"], dict), attributes["object"] + self._object = None if attributes["object"] is None else GitObject.GitObject(self._requester, attributes["object"], completed=False) + if "ref" in attributes: # pragma no branch + assert attributes["ref"] is None or isinstance(attributes["ref"], (str, unicode)), attributes["ref"] + self._ref = attributes["ref"] + if "url" in attributes: # pragma no branch + assert attributes["url"] is None or isinstance(attributes["url"], (str, unicode)), attributes["url"] + self._url = attributes["url"] diff --git a/github/GitTag.py b/github/GitTag.py index 01594b33..e8a030b1 100644 --- a/github/GitTag.py +++ b/github/GitTag.py @@ -16,38 +16,39 @@ import GithubObject import GitAuthor import GitObject -class GitTag( GithubObject.GithubObject ): + +class GitTag(GithubObject.GithubObject): @property - def message( self ): - self._completeIfNotSet( self._message ) - return self._NoneIfNotSet( self._message ) + def message(self): + self._completeIfNotSet(self._message) + return self._NoneIfNotSet(self._message) @property - def object( self ): - self._completeIfNotSet( self._object ) - return self._NoneIfNotSet( self._object ) + def object(self): + self._completeIfNotSet(self._object) + return self._NoneIfNotSet(self._object) @property - def sha( self ): - self._completeIfNotSet( self._sha ) - return self._NoneIfNotSet( self._sha ) + def sha(self): + self._completeIfNotSet(self._sha) + return self._NoneIfNotSet(self._sha) @property - def tag( self ): - self._completeIfNotSet( self._tag ) - return self._NoneIfNotSet( self._tag ) + def tag(self): + self._completeIfNotSet(self._tag) + return self._NoneIfNotSet(self._tag) @property - def tagger( self ): - self._completeIfNotSet( self._tagger ) - return self._NoneIfNotSet( self._tagger ) + def tagger(self): + self._completeIfNotSet(self._tagger) + return self._NoneIfNotSet(self._tagger) @property - def url( self ): - self._completeIfNotSet( self._url ) - return self._NoneIfNotSet( self._url ) + def url(self): + self._completeIfNotSet(self._url) + return self._NoneIfNotSet(self._url) - def _initAttributes( self ): + def _initAttributes(self): self._message = GithubObject.NotSet self._object = GithubObject.NotSet self._sha = GithubObject.NotSet @@ -55,22 +56,22 @@ class GitTag( GithubObject.GithubObject ): self._tagger = GithubObject.NotSet self._url = GithubObject.NotSet - def _useAttributes( self, attributes ): - if "message" in attributes: # pragma no branch - assert attributes[ "message" ] is None or isinstance( attributes[ "message" ], ( str, unicode ) ), attributes[ "message" ] - self._message = attributes[ "message" ] - if "object" in attributes: # pragma no branch - assert attributes[ "object" ] is None or isinstance( attributes[ "object" ], dict ), attributes[ "object" ] - self._object = None if attributes[ "object" ] is None else GitObject.GitObject( self._requester, attributes[ "object" ], completed = False ) - if "sha" in attributes: # pragma no branch - assert attributes[ "sha" ] is None or isinstance( attributes[ "sha" ], ( str, unicode ) ), attributes[ "sha" ] - self._sha = attributes[ "sha" ] - if "tag" in attributes: # pragma no branch - assert attributes[ "tag" ] is None or isinstance( attributes[ "tag" ], ( str, unicode ) ), attributes[ "tag" ] - self._tag = attributes[ "tag" ] - if "tagger" in attributes: # pragma no branch - assert attributes[ "tagger" ] is None or isinstance( attributes[ "tagger" ], dict ), attributes[ "tagger" ] - self._tagger = None if attributes[ "tagger" ] is None else GitAuthor.GitAuthor( self._requester, attributes[ "tagger" ], completed = False ) - if "url" in attributes: # pragma no branch - assert attributes[ "url" ] is None or isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ] - self._url = attributes[ "url" ] + def _useAttributes(self, attributes): + if "message" in attributes: # pragma no branch + assert attributes["message"] is None or isinstance(attributes["message"], (str, unicode)), attributes["message"] + self._message = attributes["message"] + if "object" in attributes: # pragma no branch + assert attributes["object"] is None or isinstance(attributes["object"], dict), attributes["object"] + self._object = None if attributes["object"] is None else GitObject.GitObject(self._requester, attributes["object"], completed=False) + if "sha" in attributes: # pragma no branch + assert attributes["sha"] is None or isinstance(attributes["sha"], (str, unicode)), attributes["sha"] + self._sha = attributes["sha"] + if "tag" in attributes: # pragma no branch + assert attributes["tag"] is None or isinstance(attributes["tag"], (str, unicode)), attributes["tag"] + self._tag = attributes["tag"] + if "tagger" in attributes: # pragma no branch + assert attributes["tagger"] is None or isinstance(attributes["tagger"], dict), attributes["tagger"] + self._tagger = None if attributes["tagger"] is None else GitAuthor.GitAuthor(self._requester, attributes["tagger"], completed=False) + if "url" in attributes: # pragma no branch + assert attributes["url"] is None or isinstance(attributes["url"], (str, unicode)), attributes["url"] + self._url = attributes["url"] diff --git a/github/GitTree.py b/github/GitTree.py index 690cb6c7..70c5b64e 100644 --- a/github/GitTree.py +++ b/github/GitTree.py @@ -15,41 +15,42 @@ import GithubObject import GitTreeElement -class GitTree( GithubObject.GithubObject ): + +class GitTree(GithubObject.GithubObject): @property - def sha( self ): - self._completeIfNotSet( self._sha ) - return self._NoneIfNotSet( self._sha ) + def sha(self): + self._completeIfNotSet(self._sha) + return self._NoneIfNotSet(self._sha) @property - def tree( self ): - self._completeIfNotSet( self._tree ) - return self._NoneIfNotSet( self._tree ) + def tree(self): + self._completeIfNotSet(self._tree) + return self._NoneIfNotSet(self._tree) @property - def url( self ): - self._completeIfNotSet( self._url ) - return self._NoneIfNotSet( self._url ) + def url(self): + self._completeIfNotSet(self._url) + return self._NoneIfNotSet(self._url) @property - def _identity( self ): + def _identity(self): return self.sha - def _initAttributes( self ): + def _initAttributes(self): self._sha = GithubObject.NotSet self._tree = GithubObject.NotSet self._url = GithubObject.NotSet - def _useAttributes( self, attributes ): - if "sha" in attributes: # pragma no branch - assert attributes[ "sha" ] is None or isinstance( attributes[ "sha" ], ( str, unicode ) ), attributes[ "sha" ] - self._sha = attributes[ "sha" ] - if "tree" in attributes: # pragma no branch - assert attributes[ "tree" ] is None or all( isinstance( element, dict ) for element in attributes[ "tree" ] ), attributes[ "tree" ] - self._tree = None if attributes[ "tree" ] is None else [ - GitTreeElement.GitTreeElement( self._requester, element, completed = False ) - for element in attributes[ "tree" ] + def _useAttributes(self, attributes): + if "sha" in attributes: # pragma no branch + assert attributes["sha"] is None or isinstance(attributes["sha"], (str, unicode)), attributes["sha"] + self._sha = attributes["sha"] + if "tree" in attributes: # pragma no branch + assert attributes["tree"] is None or all(isinstance(element, dict) for element in attributes["tree"]), attributes["tree"] + self._tree = None if attributes["tree"] is None else [ + GitTreeElement.GitTreeElement(self._requester, element, completed=False) + for element in attributes["tree"] ] - if "url" in attributes: # pragma no branch - assert attributes[ "url" ] is None or isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ] - self._url = attributes[ "url" ] + if "url" in attributes: # pragma no branch + assert attributes["url"] is None or isinstance(attributes["url"], (str, unicode)), attributes["url"] + self._url = attributes["url"] diff --git a/github/GitTreeElement.py b/github/GitTreeElement.py index bb075cd3..6c5c463b 100644 --- a/github/GitTreeElement.py +++ b/github/GitTreeElement.py @@ -13,32 +13,33 @@ import GithubObject -class GitTreeElement( GithubObject.BasicGithubObject ): + +class GitTreeElement(GithubObject.BasicGithubObject): @property - def mode( self ): - return self._NoneIfNotSet( self._mode ) + def mode(self): + return self._NoneIfNotSet(self._mode) @property - def path( self ): - return self._NoneIfNotSet( self._path ) + def path(self): + return self._NoneIfNotSet(self._path) @property - def sha( self ): - return self._NoneIfNotSet( self._sha ) + def sha(self): + return self._NoneIfNotSet(self._sha) @property - def size( self ): - return self._NoneIfNotSet( self._size ) + def size(self): + return self._NoneIfNotSet(self._size) @property - def type( self ): - return self._NoneIfNotSet( self._type ) + def type(self): + return self._NoneIfNotSet(self._type) @property - def url( self ): - return self._NoneIfNotSet( self._url ) + def url(self): + return self._NoneIfNotSet(self._url) - def _initAttributes( self ): + def _initAttributes(self): self._mode = GithubObject.NotSet self._path = GithubObject.NotSet self._sha = GithubObject.NotSet @@ -46,22 +47,22 @@ class GitTreeElement( GithubObject.BasicGithubObject ): self._type = GithubObject.NotSet self._url = GithubObject.NotSet - def _useAttributes( self, attributes ): - if "mode" in attributes: # pragma no branch - assert attributes[ "mode" ] is None or isinstance( attributes[ "mode" ], ( str, unicode ) ), attributes[ "mode" ] - self._mode = attributes[ "mode" ] - if "path" in attributes: # pragma no branch - assert attributes[ "path" ] is None or isinstance( attributes[ "path" ], ( str, unicode ) ), attributes[ "path" ] - self._path = attributes[ "path" ] - if "sha" in attributes: # pragma no branch - assert attributes[ "sha" ] is None or isinstance( attributes[ "sha" ], ( str, unicode ) ), attributes[ "sha" ] - self._sha = attributes[ "sha" ] - if "size" in attributes: # pragma no branch - assert attributes[ "size" ] is None or isinstance( attributes[ "size" ], int ), attributes[ "size" ] - self._size = attributes[ "size" ] - if "type" in attributes: # pragma no branch - assert attributes[ "type" ] is None or isinstance( attributes[ "type" ], ( str, unicode ) ), attributes[ "type" ] - self._type = attributes[ "type" ] - if "url" in attributes: # pragma no branch - assert attributes[ "url" ] is None or isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ] - self._url = attributes[ "url" ] + def _useAttributes(self, attributes): + if "mode" in attributes: # pragma no branch + assert attributes["mode"] is None or isinstance(attributes["mode"], (str, unicode)), attributes["mode"] + self._mode = attributes["mode"] + if "path" in attributes: # pragma no branch + assert attributes["path"] is None or isinstance(attributes["path"], (str, unicode)), attributes["path"] + self._path = attributes["path"] + if "sha" in attributes: # pragma no branch + assert attributes["sha"] is None or isinstance(attributes["sha"], (str, unicode)), attributes["sha"] + self._sha = attributes["sha"] + if "size" in attributes: # pragma no branch + assert attributes["size"] is None or isinstance(attributes["size"], int), attributes["size"] + self._size = attributes["size"] + if "type" in attributes: # pragma no branch + assert attributes["type"] is None or isinstance(attributes["type"], (str, unicode)), attributes["type"] + self._type = attributes["type"] + if "url" in attributes: # pragma no branch + assert attributes["url"] is None or isinstance(attributes["url"], (str, unicode)), attributes["url"] + self._url = attributes["url"] diff --git a/github/Github.py b/github/Github.py index fa8b63e7..4ae6c60a 100644 --- a/github/Github.py +++ b/github/Github.py @@ -24,21 +24,23 @@ import Legacy import GithubObject import HookDescription + DEFAULT_BASE_URL = "https://api.github.com" DEFAULT_TIMEOUT = 10 -class Github( object ): - def __init__( self, login_or_token = None, password = None, base_url = DEFAULT_BASE_URL, timeout = DEFAULT_TIMEOUT): - self.__requester = Requester( login_or_token, password, base_url, timeout ) + +class Github(object): + def __init__(self, login_or_token=None, password=None, base_url=DEFAULT_BASE_URL, timeout=DEFAULT_TIMEOUT): + self.__requester = Requester(login_or_token, password, base_url, timeout) @property - def rate_limiting( self ): + def rate_limiting(self): return self.__requester.rate_limiting - def get_user( self, login = GithubObject.NotSet ): - assert login is GithubObject.NotSet or isinstance( login, ( str, unicode ) ), login + def get_user(self, login=GithubObject.NotSet): + assert login is GithubObject.NotSet or isinstance(login, (str, unicode)), login if login is GithubObject.NotSet: - return AuthenticatedUser.AuthenticatedUser( self.__requester, { "url": "/user" }, completed = False ) + return AuthenticatedUser.AuthenticatedUser(self.__requester, {"url": "/user"}, completed=False) else: headers, data = self.__requester.requestAndCheck( "GET", @@ -46,29 +48,29 @@ class Github( object ): None, None ) - return NamedUser.NamedUser( self.__requester, data, completed = True ) + return NamedUser.NamedUser(self.__requester, data, completed=True) - def get_organization( self, login ): - assert isinstance( login, ( str, unicode ) ), login + def get_organization(self, login): + assert isinstance(login, (str, unicode)), login headers, data = self.__requester.requestAndCheck( "GET", "/orgs/" + login, None, None ) - return Organization.Organization( self.__requester, data, completed = True ) + return Organization.Organization(self.__requester, data, completed=True) - def get_gist( self, id ): - assert isinstance( id, ( str, unicode ) ), id + def get_gist(self, id): + assert isinstance(id, (str, unicode)), id headers, data = self.__requester.requestAndCheck( "GET", "/gists/" + id, None, None ) - return Gist.Gist( self.__requester, data, completed = True ) + return Gist.Gist(self.__requester, data, completed=True) - def get_gists( self ): + def get_gists(self): return PaginatedList.PaginatedList( Gist.Gist, self.__requester, @@ -76,12 +78,12 @@ class Github( object ): None ) - def legacy_search_repos( self, keyword, language = GithubObject.NotSet ): - assert isinstance( keyword, ( str, unicode ) ), keyword - assert language is GithubObject.NotSet or isinstance( language, ( str, unicode ) ), language - args = {} if language is GithubObject.NotSet else { "language": language } + def legacy_search_repos(self, keyword, language=GithubObject.NotSet): + assert isinstance(keyword, (str, unicode)), keyword + assert language is GithubObject.NotSet or isinstance(language, (str, unicode)), language + args = {} if language is GithubObject.NotSet else {"language": language} return Legacy.PaginatedList( - "/legacy/repos/search/" + urllib.quote( keyword ), + "/legacy/repos/search/" + urllib.quote(keyword), args, self.__requester, "repositories", @@ -89,10 +91,10 @@ class Github( object ): Repository.Repository, ) - def legacy_search_users( self, keyword ): - assert isinstance( keyword, ( str, unicode ) ), keyword + def legacy_search_users(self, keyword): + assert isinstance(keyword, (str, unicode)), keyword return Legacy.PaginatedList( - "/legacy/user/search/" + urllib.quote( keyword ), + "/legacy/user/search/" + urllib.quote(keyword), {}, self.__requester, "users", @@ -100,25 +102,25 @@ class Github( object ): NamedUser.NamedUser, ) - def legacy_search_user_by_email( self, email ): - assert isinstance( email, ( str, unicode ) ), email + def legacy_search_user_by_email(self, email): + assert isinstance(email, (str, unicode)), email headers, data = self.__requester.requestAndCheck( "GET", "/legacy/user/email/" + email, None, None ) - return NamedUser.NamedUser( self.__requester, Legacy.convertUser( data[ "user" ] ), completed = False ) + return NamedUser.NamedUser(self.__requester, Legacy.convertUser(data["user"]), completed=False) - def render_markdown( self, text, context = GithubObject.NotSet ): - assert isinstance( text, ( str, unicode ) ), text - assert context is GithubObject.NotSet or isinstance( context, Repository.Repository ), context + def render_markdown(self, text, context=GithubObject.NotSet): + assert isinstance(text, (str, unicode)), text + assert context is GithubObject.NotSet or isinstance(context, Repository.Repository), context post_parameters = { "text": text } if context is not GithubObject.NotSet: - post_parameters[ "mode" ] = "gfm" - post_parameters[ "context" ] = context._identity + post_parameters["mode"] = "gfm" + post_parameters["context"] = context._identity status, headers, data = self.__requester.requestRaw( "POST", "/markdown", @@ -127,11 +129,11 @@ class Github( object ): ) return data - def get_hooks( self ): + def get_hooks(self): headers, data = self.__requester.requestAndCheck( "GET", "/hooks", None, None ) - return [ HookDescription.HookDescription( self.__requester, attributes, completed = True ) for attributes in data ] + return [HookDescription.HookDescription(self.__requester, attributes, completed=True) for attributes in data] diff --git a/github/GithubException.py b/github/GithubException.py index daeb6463..626ab238 100644 --- a/github/GithubException.py +++ b/github/GithubException.py @@ -11,11 +11,12 @@ # You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see . -class GithubException( Exception ): - def __init__( self, status, data ): - Exception.__init__( self ) + +class GithubException(Exception): + def __init__(self, status, data): + Exception.__init__(self) self.status = status self.data = data - def __str__( self ): - return str( self.status ) + " " + str( self.data ) + def __str__(self): + return str(self.status) + " " + str(self.data) diff --git a/github/GithubObject.py b/github/GithubObject.py index 10d2f789..8448e70d 100644 --- a/github/GithubObject.py +++ b/github/GithubObject.py @@ -15,53 +15,56 @@ import datetime import GithubException + class _NotSetType: pass NotSet = _NotSetType() -class BasicGithubObject( object ): - def __init__( self, requester, attributes, completed ): ### 'completed' may be removed if I find a way + +class BasicGithubObject(object): + def __init__(self, requester, attributes, completed): # 'completed' may be removed if I find a way self._requester = requester self._initAttributes() - self._useAttributes( attributes ) + self._useAttributes(attributes) @staticmethod - def _parentUrl( url ): - return "/".join( url.split( "/" )[ : -1 ] ) + def _parentUrl(url): + return "/".join(url.split("/")[: -1]) @staticmethod - def _NoneIfNotSet( value ): + def _NoneIfNotSet(value): if value is NotSet: return None else: return value @staticmethod - def _parseDatetime( s ): + def _parseDatetime(s): if s is None: return None - elif len( s ) == 24: - return datetime.datetime.strptime( s, "%Y-%m-%dT%H:%M:%S.000Z" ) - elif len( s ) == 25: - return datetime.datetime.strptime( s[ : 19 ], "%Y-%m-%dT%H:%M:%S" ) + ( 1 if s[ 19 ] == '-' else -1 ) * datetime.timedelta( hours = int( s[ 20 : 22 ] ), minutes = int( s[ 23 : 25 ] ) ) + elif len(s) == 24: + return datetime.datetime.strptime(s, "%Y-%m-%dT%H:%M:%S.000Z") + elif len(s) == 25: + return datetime.datetime.strptime(s[:19], "%Y-%m-%dT%H:%M:%S") + (1 if s[19] == '-' else -1) * datetime.timedelta(hours=int(s[20:22]), minutes=int(s[23:25])) else: - return datetime.datetime.strptime( s, "%Y-%m-%dT%H:%M:%SZ" ) + return datetime.datetime.strptime(s, "%Y-%m-%dT%H:%M:%SZ") -class GithubObject( BasicGithubObject ): - def __init__( self, requester, attributes, completed ): - BasicGithubObject.__init__( self, requester, attributes, completed ) + +class GithubObject(BasicGithubObject): + def __init__(self, requester, attributes, completed): + BasicGithubObject.__init__(self, requester, attributes, completed) self.__completed = completed - def _completeIfNotSet( self, value ): + def _completeIfNotSet(self, value): if not self.__completed and value is NotSet: self.__complete() - def __complete( self ): + def __complete(self): headers, data = self._requester.requestAndCheck( "GET", self._url, None, None ) - self._useAttributes( data ) + self._useAttributes(data) self._completed = True diff --git a/github/Hook.py b/github/Hook.py index ad7f49f2..cabc5f5a 100644 --- a/github/Hook.py +++ b/github/Hook.py @@ -15,53 +15,54 @@ import GithubObject import HookResponse -class Hook( GithubObject.GithubObject ): + +class Hook(GithubObject.GithubObject): @property - def active( self ): - self._completeIfNotSet( self._active ) - return self._NoneIfNotSet( self._active ) + def active(self): + self._completeIfNotSet(self._active) + return self._NoneIfNotSet(self._active) @property - def config( self ): - self._completeIfNotSet( self._config ) - return self._NoneIfNotSet( self._config ) + def config(self): + self._completeIfNotSet(self._config) + return self._NoneIfNotSet(self._config) @property - def created_at( self ): - self._completeIfNotSet( self._created_at ) - return self._NoneIfNotSet( self._created_at ) + def created_at(self): + self._completeIfNotSet(self._created_at) + return self._NoneIfNotSet(self._created_at) @property - def events( self ): - self._completeIfNotSet( self._events ) - return self._NoneIfNotSet( self._events ) + def events(self): + self._completeIfNotSet(self._events) + return self._NoneIfNotSet(self._events) @property - def id( self ): - self._completeIfNotSet( self._id ) - return self._NoneIfNotSet( self._id ) + def id(self): + self._completeIfNotSet(self._id) + return self._NoneIfNotSet(self._id) @property - def last_response( self ): - self._completeIfNotSet( self._last_response ) - return self._NoneIfNotSet( self._last_response ) + def last_response(self): + self._completeIfNotSet(self._last_response) + return self._NoneIfNotSet(self._last_response) @property - def name( self ): - self._completeIfNotSet( self._name ) - return self._NoneIfNotSet( self._name ) + def name(self): + self._completeIfNotSet(self._name) + return self._NoneIfNotSet(self._name) @property - def updated_at( self ): - self._completeIfNotSet( self._updated_at ) - return self._NoneIfNotSet( self._updated_at ) + def updated_at(self): + self._completeIfNotSet(self._updated_at) + return self._NoneIfNotSet(self._updated_at) @property - def url( self ): - self._completeIfNotSet( self._url ) - return self._NoneIfNotSet( self._url ) + def url(self): + self._completeIfNotSet(self._url) + return self._NoneIfNotSet(self._url) - def delete( self ): + def delete(self): headers, data = self._requester.requestAndCheck( "DELETE", self.url, @@ -69,34 +70,34 @@ class Hook( GithubObject.GithubObject ): None ) - def edit( self, name, config, events = GithubObject.NotSet, add_events = GithubObject.NotSet, remove_events = GithubObject.NotSet, active = GithubObject.NotSet ): - assert isinstance( name, ( str, unicode ) ), name - assert isinstance( config, dict ), config - assert events is GithubObject.NotSet or all( isinstance( element, ( str, unicode ) ) for element in events ), events - assert add_events is GithubObject.NotSet or all( isinstance( element, ( str, unicode ) ) for element in add_events ), add_events - assert remove_events is GithubObject.NotSet or all( isinstance( element, ( str, unicode ) ) for element in remove_events ), remove_events - assert active is GithubObject.NotSet or isinstance( active, bool ), active + def edit(self, name, config, events=GithubObject.NotSet, add_events=GithubObject.NotSet, remove_events=GithubObject.NotSet, active=GithubObject.NotSet): + assert isinstance(name, (str, unicode)), name + assert isinstance(config, dict), config + assert events is GithubObject.NotSet or all(isinstance(element, (str, unicode)) for element in events), events + assert add_events is GithubObject.NotSet or all(isinstance(element, (str, unicode)) for element in add_events), add_events + assert remove_events is GithubObject.NotSet or all(isinstance(element, (str, unicode)) for element in remove_events), remove_events + assert active is GithubObject.NotSet or isinstance(active, bool), active post_parameters = { "name": name, "config": config, } if events is not GithubObject.NotSet: - post_parameters[ "events" ] = events + post_parameters["events"] = events if add_events is not GithubObject.NotSet: - post_parameters[ "add_events" ] = add_events + post_parameters["add_events"] = add_events if remove_events is not GithubObject.NotSet: - post_parameters[ "remove_events" ] = remove_events + post_parameters["remove_events"] = remove_events if active is not GithubObject.NotSet: - post_parameters[ "active" ] = active + post_parameters["active"] = active headers, data = self._requester.requestAndCheck( "PATCH", self.url, None, post_parameters ) - self._useAttributes( data ) + self._useAttributes(data) - def test( self ): + def test(self): headers, data = self._requester.requestAndCheck( "POST", self.url + "/test", @@ -104,7 +105,7 @@ class Hook( GithubObject.GithubObject ): None ) - def _initAttributes( self ): + def _initAttributes(self): self._active = GithubObject.NotSet self._config = GithubObject.NotSet self._created_at = GithubObject.NotSet @@ -115,31 +116,31 @@ class Hook( GithubObject.GithubObject ): self._updated_at = GithubObject.NotSet self._url = GithubObject.NotSet - def _useAttributes( self, attributes ): - if "active" in attributes: # pragma no branch - assert attributes[ "active" ] is None or isinstance( attributes[ "active" ], bool ), attributes[ "active" ] - self._active = attributes[ "active" ] - if "config" in attributes: # pragma no branch - assert attributes[ "config" ] is None or isinstance( attributes[ "config" ], dict ), attributes[ "config" ] - self._config = attributes[ "config" ] - if "created_at" in attributes: # pragma no branch - assert attributes[ "created_at" ] is None or isinstance( attributes[ "created_at" ], ( str, unicode ) ), attributes[ "created_at" ] - self._created_at = self._parseDatetime( attributes[ "created_at" ] ) - if "events" in attributes: # pragma no branch - assert attributes[ "events" ] is None or all( isinstance( element, ( str, unicode ) ) for element in attributes[ "events" ] ), attributes[ "events" ] - self._events = attributes[ "events" ] - if "id" in attributes: # pragma no branch - assert attributes[ "id" ] is None or isinstance( attributes[ "id" ], int ), attributes[ "id" ] - self._id = attributes[ "id" ] - if "last_response" in attributes: # pragma no branch - assert attributes[ "last_response" ] is None or isinstance( attributes[ "last_response" ], dict ), attributes[ "last_response" ] - self._last_response = None if attributes[ "last_response" ] is None else HookResponse.HookResponse( self._requester, attributes[ "last_response" ], completed = False ) - if "name" in attributes: # pragma no branch - assert attributes[ "name" ] is None or isinstance( attributes[ "name" ], ( str, unicode ) ), attributes[ "name" ] - self._name = attributes[ "name" ] - if "updated_at" in attributes: # pragma no branch - assert attributes[ "updated_at" ] is None or isinstance( attributes[ "updated_at" ], ( str, unicode ) ), attributes[ "updated_at" ] - self._updated_at = self._parseDatetime( attributes[ "updated_at" ] ) - if "url" in attributes: # pragma no branch - assert attributes[ "url" ] is None or isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ] - self._url = attributes[ "url" ] + def _useAttributes(self, attributes): + if "active" in attributes: # pragma no branch + assert attributes["active"] is None or isinstance(attributes["active"], bool), attributes["active"] + self._active = attributes["active"] + if "config" in attributes: # pragma no branch + assert attributes["config"] is None or isinstance(attributes["config"], dict), attributes["config"] + self._config = attributes["config"] + if "created_at" in attributes: # pragma no branch + assert attributes["created_at"] is None or isinstance(attributes["created_at"], (str, unicode)), attributes["created_at"] + self._created_at = self._parseDatetime(attributes["created_at"]) + if "events" in attributes: # pragma no branch + assert attributes["events"] is None or all(isinstance(element, (str, unicode)) for element in attributes["events"]), attributes["events"] + self._events = attributes["events"] + if "id" in attributes: # pragma no branch + assert attributes["id"] is None or isinstance(attributes["id"], int), attributes["id"] + self._id = attributes["id"] + if "last_response" in attributes: # pragma no branch + assert attributes["last_response"] is None or isinstance(attributes["last_response"], dict), attributes["last_response"] + self._last_response = None if attributes["last_response"] is None else HookResponse.HookResponse(self._requester, attributes["last_response"], completed=False) + if "name" in attributes: # pragma no branch + assert attributes["name"] is None or isinstance(attributes["name"], (str, unicode)), attributes["name"] + self._name = attributes["name"] + if "updated_at" in attributes: # pragma no branch + assert attributes["updated_at"] is None or isinstance(attributes["updated_at"], (str, unicode)), attributes["updated_at"] + self._updated_at = self._parseDatetime(attributes["updated_at"]) + if "url" in attributes: # pragma no branch + assert attributes["url"] is None or isinstance(attributes["url"], (str, unicode)), attributes["url"] + self._url = attributes["url"] diff --git a/github/HookDescription.py b/github/HookDescription.py index eb329fd4..6dd0d143 100644 --- a/github/HookDescription.py +++ b/github/HookDescription.py @@ -13,39 +13,40 @@ import GithubObject -class HookDescription( GithubObject.BasicGithubObject ): + +class HookDescription(GithubObject.BasicGithubObject): @property - def events( self ): - return self._NoneIfNotSet( self._events ) + def events(self): + return self._NoneIfNotSet(self._events) @property - def name( self ): - return self._NoneIfNotSet( self._name ) + def name(self): + return self._NoneIfNotSet(self._name) @property - def schema( self ): - return self._NoneIfNotSet( self._schema ) + def schema(self): + return self._NoneIfNotSet(self._schema) @property - def supported_events( self ): - return self._NoneIfNotSet( self._supported_events ) + def supported_events(self): + return self._NoneIfNotSet(self._supported_events) - def _initAttributes( self ): + def _initAttributes(self): self._events = GithubObject.NotSet self._name = GithubObject.NotSet self._schema = GithubObject.NotSet self._supported_events = GithubObject.NotSet - def _useAttributes( self, attributes ): - if "events" in attributes: # pragma no branch - assert attributes[ "events" ] is None or all( isinstance( element, ( str, unicode ) ) for element in attributes[ "events" ] ), attributes[ "events" ] - self._events = attributes[ "events" ] - if "name" in attributes: # pragma no branch - assert attributes[ "name" ] is None or isinstance( attributes[ "name" ], ( str, unicode ) ), attributes[ "name" ] - self._name = attributes[ "name" ] - if "schema" in attributes: # pragma no branch - assert attributes[ "schema" ] is None or all( isinstance( element, list ) for element in attributes[ "schema" ] ), attributes[ "schema" ] - self._schema = attributes[ "schema" ] - if "supported_events" in attributes: # pragma no branch - assert attributes[ "supported_events" ] is None or all( isinstance( element, ( str, unicode ) ) for element in attributes[ "supported_events" ] ), attributes[ "supported_events" ] - self._supported_events = attributes[ "supported_events" ] + def _useAttributes(self, attributes): + if "events" in attributes: # pragma no branch + assert attributes["events"] is None or all(isinstance(element, (str, unicode)) for element in attributes["events"]), attributes["events"] + self._events = attributes["events"] + if "name" in attributes: # pragma no branch + assert attributes["name"] is None or isinstance(attributes["name"], (str, unicode)), attributes["name"] + self._name = attributes["name"] + if "schema" in attributes: # pragma no branch + assert attributes["schema"] is None or all(isinstance(element, list) for element in attributes["schema"]), attributes["schema"] + self._schema = attributes["schema"] + if "supported_events" in attributes: # pragma no branch + assert attributes["supported_events"] is None or all(isinstance(element, (str, unicode)) for element in attributes["supported_events"]), attributes["supported_events"] + self._supported_events = attributes["supported_events"] diff --git a/github/HookResponse.py b/github/HookResponse.py index 158bfb85..c09cfc86 100644 --- a/github/HookResponse.py +++ b/github/HookResponse.py @@ -13,31 +13,32 @@ import GithubObject -class HookResponse( GithubObject.BasicGithubObject ): + +class HookResponse(GithubObject.BasicGithubObject): @property - def code( self ): - return self._NoneIfNotSet( self._code ) + def code(self): + return self._NoneIfNotSet(self._code) @property - def message( self ): - return self._NoneIfNotSet( self._message ) + def message(self): + return self._NoneIfNotSet(self._message) @property - def status( self ): - return self._NoneIfNotSet( self._status ) + def status(self): + return self._NoneIfNotSet(self._status) - def _initAttributes( self ): + def _initAttributes(self): self._code = GithubObject.NotSet self._message = GithubObject.NotSet self._status = GithubObject.NotSet - def _useAttributes( self, attributes ): - if "code" in attributes: # pragma no branch - assert attributes[ "code" ] is None or isinstance( attributes[ "code" ], int ), attributes[ "code" ] - self._code = attributes[ "code" ] - if "message" in attributes: # pragma no branch - assert attributes[ "message" ] is None or isinstance( attributes[ "message" ], ( str, unicode ) ), attributes[ "message" ] - self._message = attributes[ "message" ] - if "status" in attributes: # pragma no branch - assert attributes[ "status" ] is None or isinstance( attributes[ "status" ], ( str, unicode ) ), attributes[ "status" ] - self._status = attributes[ "status" ] + def _useAttributes(self, attributes): + if "code" in attributes: # pragma no branch + assert attributes["code"] is None or isinstance(attributes["code"], int), attributes["code"] + self._code = attributes["code"] + if "message" in attributes: # pragma no branch + assert attributes["message"] is None or isinstance(attributes["message"], (str, unicode)), attributes["message"] + self._message = attributes["message"] + if "status" in attributes: # pragma no branch + assert attributes["status"] is None or isinstance(attributes["status"], (str, unicode)), attributes["status"] + self._status = attributes["status"] diff --git a/github/InputFileContent.py b/github/InputFileContent.py index 2977b2fa..f46ab975 100644 --- a/github/InputFileContent.py +++ b/github/InputFileContent.py @@ -11,12 +11,13 @@ # You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see . -class InputFileContent( object ): - def __init__( self, content ): + +class InputFileContent(object): + def __init__(self, content): self.__content = content @property - def _identity( self ): + def _identity(self): return { "content": self.__content, } diff --git a/github/InputGitAuthor.py b/github/InputGitAuthor.py index 24e340fd..c2cf8d9d 100644 --- a/github/InputGitAuthor.py +++ b/github/InputGitAuthor.py @@ -11,14 +11,15 @@ # You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see . -class InputGitAuthor( object ): - def __init__( self, name, email, date ): + +class InputGitAuthor(object): + def __init__(self, name, email, date): self.__name = name self.__email = email self.__date = date @property - def _identity( self ): + def _identity(self): return { "name": self.__name, "email": self.__email, diff --git a/github/InputGitTreeElement.py b/github/InputGitTreeElement.py index 96274487..290d3793 100644 --- a/github/InputGitTreeElement.py +++ b/github/InputGitTreeElement.py @@ -13,8 +13,9 @@ import GithubObject -class InputGitTreeElement( object ): - def __init__( self, path, mode, type, content = GithubObject.NotSet, sha = GithubObject.NotSet ): + +class InputGitTreeElement(object): + def __init__(self, path, mode, type, content=GithubObject.NotSet, sha=GithubObject.NotSet): self.__path = path self.__mode = mode self.__type = type @@ -22,14 +23,14 @@ class InputGitTreeElement( object ): self.__sha = sha @property - def _identity( self ): + def _identity(self): identity = { "path": self.__path, "mode": self.__mode, "type": self.__type, } if self.__sha is not GithubObject.NotSet: - identity[ "sha" ] = self.__sha + identity["sha"] = self.__sha if self.__content is not GithubObject.NotSet: - identity[ "content" ] = self.__content + identity["content"] = self.__content return identity diff --git a/github/Issue.py b/github/Issue.py index 0a6288cb..859c8097 100644 --- a/github/Issue.py +++ b/github/Issue.py @@ -22,100 +22,101 @@ import Milestone import IssueComment import IssuePullRequest -class Issue( GithubObject.GithubObject ): + +class Issue(GithubObject.GithubObject): @property - def assignee( self ): - self._completeIfNotSet( self._assignee ) - return self._NoneIfNotSet( self._assignee ) + def assignee(self): + self._completeIfNotSet(self._assignee) + return self._NoneIfNotSet(self._assignee) @property - def body( self ): - self._completeIfNotSet( self._body ) - return self._NoneIfNotSet( self._body ) + def body(self): + self._completeIfNotSet(self._body) + return self._NoneIfNotSet(self._body) @property - def closed_at( self ): - self._completeIfNotSet( self._closed_at ) - return self._NoneIfNotSet( self._closed_at ) + def closed_at(self): + self._completeIfNotSet(self._closed_at) + return self._NoneIfNotSet(self._closed_at) @property - def closed_by( self ): - self._completeIfNotSet( self._closed_by ) - return self._NoneIfNotSet( self._closed_by ) + def closed_by(self): + self._completeIfNotSet(self._closed_by) + return self._NoneIfNotSet(self._closed_by) @property - def comments( self ): - self._completeIfNotSet( self._comments ) - return self._NoneIfNotSet( self._comments ) + def comments(self): + self._completeIfNotSet(self._comments) + return self._NoneIfNotSet(self._comments) @property - def created_at( self ): - self._completeIfNotSet( self._created_at ) - return self._NoneIfNotSet( self._created_at ) + def created_at(self): + self._completeIfNotSet(self._created_at) + return self._NoneIfNotSet(self._created_at) @property - def html_url( self ): - self._completeIfNotSet( self._html_url ) - return self._NoneIfNotSet( self._html_url ) + def html_url(self): + self._completeIfNotSet(self._html_url) + return self._NoneIfNotSet(self._html_url) @property - def id( self ): - self._completeIfNotSet( self._id ) - return self._NoneIfNotSet( self._id ) + def id(self): + self._completeIfNotSet(self._id) + return self._NoneIfNotSet(self._id) @property - def labels( self ): - self._completeIfNotSet( self._labels ) - return self._NoneIfNotSet( self._labels ) + def labels(self): + self._completeIfNotSet(self._labels) + return self._NoneIfNotSet(self._labels) @property - def milestone( self ): - self._completeIfNotSet( self._milestone ) - return self._NoneIfNotSet( self._milestone ) + def milestone(self): + self._completeIfNotSet(self._milestone) + return self._NoneIfNotSet(self._milestone) @property - def number( self ): - self._completeIfNotSet( self._number ) - return self._NoneIfNotSet( self._number ) + def number(self): + self._completeIfNotSet(self._number) + return self._NoneIfNotSet(self._number) @property - def pull_request( self ): - self._completeIfNotSet( self._pull_request ) - return self._NoneIfNotSet( self._pull_request ) + def pull_request(self): + self._completeIfNotSet(self._pull_request) + return self._NoneIfNotSet(self._pull_request) @property - def repository( self ): - self._completeIfNotSet( self._repository ) - return self._NoneIfNotSet( self._repository ) + def repository(self): + self._completeIfNotSet(self._repository) + return self._NoneIfNotSet(self._repository) @property - def state( self ): - self._completeIfNotSet( self._state ) - return self._NoneIfNotSet( self._state ) + def state(self): + self._completeIfNotSet(self._state) + return self._NoneIfNotSet(self._state) @property - def title( self ): - self._completeIfNotSet( self._title ) - return self._NoneIfNotSet( self._title ) + def title(self): + self._completeIfNotSet(self._title) + return self._NoneIfNotSet(self._title) @property - def updated_at( self ): - self._completeIfNotSet( self._updated_at ) - return self._NoneIfNotSet( self._updated_at ) + def updated_at(self): + self._completeIfNotSet(self._updated_at) + return self._NoneIfNotSet(self._updated_at) @property - def url( self ): - self._completeIfNotSet( self._url ) - return self._NoneIfNotSet( self._url ) + def url(self): + self._completeIfNotSet(self._url) + return self._NoneIfNotSet(self._url) @property - def user( self ): - self._completeIfNotSet( self._user ) - return self._NoneIfNotSet( self._user ) + def user(self): + self._completeIfNotSet(self._user) + return self._NoneIfNotSet(self._user) - def add_to_labels( self, *labels ): - assert all( isinstance( element, Label.Label ) for element in labels ), labels - post_parameters = [ label.name for label in labels ] + def add_to_labels(self, *labels): + assert all(isinstance(element, Label.Label) for element in labels), labels + post_parameters = [label.name for label in labels] headers, data = self._requester.requestAndCheck( "POST", self.url + "/labels", @@ -123,8 +124,8 @@ class Issue( GithubObject.GithubObject ): post_parameters ) - def create_comment( self, body ): - assert isinstance( body, ( str, unicode ) ), body + def create_comment(self, body): + assert isinstance(body, (str, unicode)), body post_parameters = { "body": body, } @@ -134,9 +135,9 @@ class Issue( GithubObject.GithubObject ): None, post_parameters ) - return IssueComment.IssueComment( self._requester, data, completed = True ) + return IssueComment.IssueComment(self._requester, data, completed=True) - def delete_labels( self ): + def delete_labels(self): headers, data = self._requester.requestAndCheck( "DELETE", self.url + "/labels", @@ -144,45 +145,45 @@ class Issue( GithubObject.GithubObject ): None ) - def edit( self, title = GithubObject.NotSet, body = GithubObject.NotSet, assignee = GithubObject.NotSet, state = GithubObject.NotSet, milestone = GithubObject.NotSet, labels = GithubObject.NotSet ): - assert title is GithubObject.NotSet or isinstance( title, ( str, unicode ) ), title - assert body is GithubObject.NotSet or isinstance( body, ( str, unicode ) ), body - assert assignee is GithubObject.NotSet or assignee is None or isinstance( assignee, NamedUser.NamedUser ), assignee - assert state is GithubObject.NotSet or isinstance( state, ( str, unicode ) ), state - assert milestone is GithubObject.NotSet or milestone is None or isinstance( milestone, Milestone.Milestone ), milestone - assert labels is GithubObject.NotSet or all( isinstance( element, ( str, unicode ) ) for element in labels ), labels + def edit(self, title=GithubObject.NotSet, body=GithubObject.NotSet, assignee=GithubObject.NotSet, state=GithubObject.NotSet, milestone=GithubObject.NotSet, labels=GithubObject.NotSet): + assert title is GithubObject.NotSet or isinstance(title, (str, unicode)), title + assert body is GithubObject.NotSet or isinstance(body, (str, unicode)), body + assert assignee is GithubObject.NotSet or assignee is None or isinstance(assignee, NamedUser.NamedUser), assignee + assert state is GithubObject.NotSet or isinstance(state, (str, unicode)), state + assert milestone is GithubObject.NotSet or milestone is None or isinstance(milestone, Milestone.Milestone), milestone + assert labels is GithubObject.NotSet or all(isinstance(element, (str, unicode)) for element in labels), labels post_parameters = dict() if title is not GithubObject.NotSet: - post_parameters[ "title" ] = title + post_parameters["title"] = title if body is not GithubObject.NotSet: - post_parameters[ "body" ] = body + post_parameters["body"] = body if assignee is not GithubObject.NotSet: - post_parameters[ "assignee" ] = assignee._identity if assignee else '' + post_parameters["assignee"] = assignee._identity if assignee else '' if state is not GithubObject.NotSet: - post_parameters[ "state" ] = state + post_parameters["state"] = state if milestone is not GithubObject.NotSet: - post_parameters[ "milestone" ] = milestone._identity if milestone else '' + post_parameters["milestone"] = milestone._identity if milestone else '' if labels is not GithubObject.NotSet: - post_parameters[ "labels" ] = labels + post_parameters["labels"] = labels headers, data = self._requester.requestAndCheck( "PATCH", self.url, None, post_parameters ) - self._useAttributes( data ) + self._useAttributes(data) - def get_comment( self, id ): - assert isinstance( id, int ), id + def get_comment(self, id): + assert isinstance(id, int), id headers, data = self._requester.requestAndCheck( "GET", - self._parentUrl( self.url ) + "/comments/" + str( id ), + self._parentUrl(self.url) + "/comments/" + str(id), None, None ) - return IssueComment.IssueComment( self._requester, data, completed = True ) + return IssueComment.IssueComment(self._requester, data, completed=True) - def get_comments( self ): + def get_comments(self): return PaginatedList.PaginatedList( IssueComment.IssueComment, self._requester, @@ -190,7 +191,7 @@ class Issue( GithubObject.GithubObject ): None ) - def get_events( self ): + def get_events(self): return PaginatedList.PaginatedList( IssueEvent.IssueEvent, self._requester, @@ -198,7 +199,7 @@ class Issue( GithubObject.GithubObject ): None ) - def get_labels( self ): + def get_labels(self): return PaginatedList.PaginatedList( Label.Label, self._requester, @@ -206,8 +207,8 @@ class Issue( GithubObject.GithubObject ): None ) - def remove_from_labels( self, label ): - assert isinstance( label, Label.Label ), label + def remove_from_labels(self, label): + assert isinstance(label, Label.Label), label headers, data = self._requester.requestAndCheck( "DELETE", self.url + "/labels/" + label._identity, @@ -215,9 +216,9 @@ class Issue( GithubObject.GithubObject ): None ) - def set_labels( self, *labels ): - assert all( isinstance( element, Label.Label ) for element in labels ), labels - post_parameters = [ label.name for label in labels ] + def set_labels(self, *labels): + assert all(isinstance(element, Label.Label) for element in labels), labels + post_parameters = [label.name for label in labels] headers, data = self._requester.requestAndCheck( "PUT", self.url + "/labels", @@ -226,10 +227,10 @@ class Issue( GithubObject.GithubObject ): ) @property - def _identity( self ): + def _identity(self): return self.number - def _initAttributes( self ): + def _initAttributes(self): self._assignee = GithubObject.NotSet self._body = GithubObject.NotSet self._closed_at = GithubObject.NotSet @@ -249,61 +250,61 @@ class Issue( GithubObject.GithubObject ): self._url = GithubObject.NotSet self._user = GithubObject.NotSet - def _useAttributes( self, attributes ): - if "assignee" in attributes: # pragma no branch - assert attributes[ "assignee" ] is None or isinstance( attributes[ "assignee" ], dict ), attributes[ "assignee" ] - self._assignee = None if attributes[ "assignee" ] is None else NamedUser.NamedUser( self._requester, attributes[ "assignee" ], completed = False ) - if "body" in attributes: # pragma no branch - assert attributes[ "body" ] is None or isinstance( attributes[ "body" ], ( str, unicode ) ), attributes[ "body" ] - self._body = attributes[ "body" ] - if "closed_at" in attributes: # pragma no branch - assert attributes[ "closed_at" ] is None or isinstance( attributes[ "closed_at" ], ( str, unicode ) ), attributes[ "closed_at" ] - self._closed_at = self._parseDatetime( attributes[ "closed_at" ] ) - if "closed_by" in attributes: # pragma no branch - assert attributes[ "closed_by" ] is None or isinstance( attributes[ "closed_by" ], dict ), attributes[ "closed_by" ] - self._closed_by = None if attributes[ "closed_by" ] is None else NamedUser.NamedUser( self._requester, attributes[ "closed_by" ], completed = False ) - if "comments" in attributes: # pragma no branch - assert attributes[ "comments" ] is None or isinstance( attributes[ "comments" ], int ), attributes[ "comments" ] - self._comments = attributes[ "comments" ] - if "created_at" in attributes: # pragma no branch - assert attributes[ "created_at" ] is None or isinstance( attributes[ "created_at" ], ( str, unicode ) ), attributes[ "created_at" ] - self._created_at = self._parseDatetime( attributes[ "created_at" ] ) - if "html_url" in attributes: # pragma no branch - assert attributes[ "html_url" ] is None or isinstance( attributes[ "html_url" ], ( str, unicode ) ), attributes[ "html_url" ] - self._html_url = attributes[ "html_url" ] - if "id" in attributes: # pragma no branch - assert attributes[ "id" ] is None or isinstance( attributes[ "id" ], int ), attributes[ "id" ] - self._id = attributes[ "id" ] - if "labels" in attributes: # pragma no branch - assert attributes[ "labels" ] is None or all( isinstance( element, dict ) for element in attributes[ "labels" ] ), attributes[ "labels" ] - self._labels = None if attributes[ "labels" ] is None else [ - Label.Label( self._requester, element, completed = False ) - for element in attributes[ "labels" ] + def _useAttributes(self, attributes): + if "assignee" in attributes: # pragma no branch + assert attributes["assignee"] is None or isinstance(attributes["assignee"], dict), attributes["assignee"] + self._assignee = None if attributes["assignee"] is None else NamedUser.NamedUser(self._requester, attributes["assignee"], completed=False) + if "body" in attributes: # pragma no branch + assert attributes["body"] is None or isinstance(attributes["body"], (str, unicode)), attributes["body"] + self._body = attributes["body"] + if "closed_at" in attributes: # pragma no branch + assert attributes["closed_at"] is None or isinstance(attributes["closed_at"], (str, unicode)), attributes["closed_at"] + self._closed_at = self._parseDatetime(attributes["closed_at"]) + if "closed_by" in attributes: # pragma no branch + assert attributes["closed_by"] is None or isinstance(attributes["closed_by"], dict), attributes["closed_by"] + self._closed_by = None if attributes["closed_by"] is None else NamedUser.NamedUser(self._requester, attributes["closed_by"], completed=False) + if "comments" in attributes: # pragma no branch + assert attributes["comments"] is None or isinstance(attributes["comments"], int), attributes["comments"] + self._comments = attributes["comments"] + if "created_at" in attributes: # pragma no branch + assert attributes["created_at"] is None or isinstance(attributes["created_at"], (str, unicode)), attributes["created_at"] + self._created_at = self._parseDatetime(attributes["created_at"]) + if "html_url" in attributes: # pragma no branch + assert attributes["html_url"] is None or isinstance(attributes["html_url"], (str, unicode)), attributes["html_url"] + self._html_url = attributes["html_url"] + if "id" in attributes: # pragma no branch + assert attributes["id"] is None or isinstance(attributes["id"], int), attributes["id"] + self._id = attributes["id"] + if "labels" in attributes: # pragma no branch + assert attributes["labels"] is None or all(isinstance(element, dict) for element in attributes["labels"]), attributes["labels"] + self._labels = None if attributes["labels"] is None else [ + Label.Label(self._requester, element, completed=False) + for element in attributes["labels"] ] - if "milestone" in attributes: # pragma no branch - assert attributes[ "milestone" ] is None or isinstance( attributes[ "milestone" ], dict ), attributes[ "milestone" ] - self._milestone = None if attributes[ "milestone" ] is None else Milestone.Milestone( self._requester, attributes[ "milestone" ], completed = False ) - if "number" in attributes: # pragma no branch - assert attributes[ "number" ] is None or isinstance( attributes[ "number" ], int ), attributes[ "number" ] - self._number = attributes[ "number" ] - if "pull_request" in attributes: # pragma no branch - assert attributes[ "pull_request" ] is None or isinstance( attributes[ "pull_request" ], dict ), attributes[ "pull_request" ] - self._pull_request = None if attributes[ "pull_request" ] is None else IssuePullRequest.IssuePullRequest( self._requester, attributes[ "pull_request" ], completed = False ) - if "repository" in attributes: # pragma no branch - assert attributes[ "repository" ] is None or isinstance( attributes[ "repository" ], dict ), attributes[ "repository" ] - self._repository = None if attributes[ "repository" ] is None else Repository.Repository( self._requester, attributes[ "repository" ], completed = False ) - if "state" in attributes: # pragma no branch - assert attributes[ "state" ] is None or isinstance( attributes[ "state" ], ( str, unicode ) ), attributes[ "state" ] - self._state = attributes[ "state" ] - if "title" in attributes: # pragma no branch - assert attributes[ "title" ] is None or isinstance( attributes[ "title" ], ( str, unicode ) ), attributes[ "title" ] - self._title = attributes[ "title" ] - if "updated_at" in attributes: # pragma no branch - assert attributes[ "updated_at" ] is None or isinstance( attributes[ "updated_at" ], ( str, unicode ) ), attributes[ "updated_at" ] - self._updated_at = self._parseDatetime( attributes[ "updated_at" ] ) - if "url" in attributes: # pragma no branch - assert attributes[ "url" ] is None or isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ] - self._url = attributes[ "url" ] - if "user" in attributes: # pragma no branch - assert attributes[ "user" ] is None or isinstance( attributes[ "user" ], dict ), attributes[ "user" ] - self._user = None if attributes[ "user" ] is None else NamedUser.NamedUser( self._requester, attributes[ "user" ], completed = False ) + if "milestone" in attributes: # pragma no branch + assert attributes["milestone"] is None or isinstance(attributes["milestone"], dict), attributes["milestone"] + self._milestone = None if attributes["milestone"] is None else Milestone.Milestone(self._requester, attributes["milestone"], completed=False) + if "number" in attributes: # pragma no branch + assert attributes["number"] is None or isinstance(attributes["number"], int), attributes["number"] + self._number = attributes["number"] + if "pull_request" in attributes: # pragma no branch + assert attributes["pull_request"] is None or isinstance(attributes["pull_request"], dict), attributes["pull_request"] + self._pull_request = None if attributes["pull_request"] is None else IssuePullRequest.IssuePullRequest(self._requester, attributes["pull_request"], completed=False) + if "repository" in attributes: # pragma no branch + assert attributes["repository"] is None or isinstance(attributes["repository"], dict), attributes["repository"] + self._repository = None if attributes["repository"] is None else Repository.Repository(self._requester, attributes["repository"], completed=False) + if "state" in attributes: # pragma no branch + assert attributes["state"] is None or isinstance(attributes["state"], (str, unicode)), attributes["state"] + self._state = attributes["state"] + if "title" in attributes: # pragma no branch + assert attributes["title"] is None or isinstance(attributes["title"], (str, unicode)), attributes["title"] + self._title = attributes["title"] + if "updated_at" in attributes: # pragma no branch + assert attributes["updated_at"] is None or isinstance(attributes["updated_at"], (str, unicode)), attributes["updated_at"] + self._updated_at = self._parseDatetime(attributes["updated_at"]) + if "url" in attributes: # pragma no branch + assert attributes["url"] is None or isinstance(attributes["url"], (str, unicode)), attributes["url"] + self._url = attributes["url"] + if "user" in attributes: # pragma no branch + assert attributes["user"] is None or isinstance(attributes["user"], dict), attributes["user"] + self._user = None if attributes["user"] is None else NamedUser.NamedUser(self._requester, attributes["user"], completed=False) diff --git a/github/IssueComment.py b/github/IssueComment.py index d94e7d14..18f72557 100644 --- a/github/IssueComment.py +++ b/github/IssueComment.py @@ -15,38 +15,39 @@ import GithubObject import NamedUser -class IssueComment( GithubObject.GithubObject ): + +class IssueComment(GithubObject.GithubObject): @property - def body( self ): - self._completeIfNotSet( self._body ) - return self._NoneIfNotSet( self._body ) + def body(self): + self._completeIfNotSet(self._body) + return self._NoneIfNotSet(self._body) @property - def created_at( self ): - self._completeIfNotSet( self._created_at ) - return self._NoneIfNotSet( self._created_at ) + def created_at(self): + self._completeIfNotSet(self._created_at) + return self._NoneIfNotSet(self._created_at) @property - def id( self ): - self._completeIfNotSet( self._id ) - return self._NoneIfNotSet( self._id ) + def id(self): + self._completeIfNotSet(self._id) + return self._NoneIfNotSet(self._id) @property - def updated_at( self ): - self._completeIfNotSet( self._updated_at ) - return self._NoneIfNotSet( self._updated_at ) + def updated_at(self): + self._completeIfNotSet(self._updated_at) + return self._NoneIfNotSet(self._updated_at) @property - def url( self ): - self._completeIfNotSet( self._url ) - return self._NoneIfNotSet( self._url ) + def url(self): + self._completeIfNotSet(self._url) + return self._NoneIfNotSet(self._url) @property - def user( self ): - self._completeIfNotSet( self._user ) - return self._NoneIfNotSet( self._user ) + def user(self): + self._completeIfNotSet(self._user) + return self._NoneIfNotSet(self._user) - def delete( self ): + def delete(self): headers, data = self._requester.requestAndCheck( "DELETE", self.url, @@ -54,8 +55,8 @@ class IssueComment( GithubObject.GithubObject ): None ) - def edit( self, body ): - assert isinstance( body, ( str, unicode ) ), body + def edit(self, body): + assert isinstance(body, (str, unicode)), body post_parameters = { "body": body, } @@ -65,9 +66,9 @@ class IssueComment( GithubObject.GithubObject ): None, post_parameters ) - self._useAttributes( data ) + self._useAttributes(data) - def _initAttributes( self ): + def _initAttributes(self): self._body = GithubObject.NotSet self._created_at = GithubObject.NotSet self._id = GithubObject.NotSet @@ -75,22 +76,22 @@ class IssueComment( GithubObject.GithubObject ): self._url = GithubObject.NotSet self._user = GithubObject.NotSet - def _useAttributes( self, attributes ): - if "body" in attributes: # pragma no branch - assert attributes[ "body" ] is None or isinstance( attributes[ "body" ], ( str, unicode ) ), attributes[ "body" ] - self._body = attributes[ "body" ] - if "created_at" in attributes: # pragma no branch - assert attributes[ "created_at" ] is None or isinstance( attributes[ "created_at" ], ( str, unicode ) ), attributes[ "created_at" ] - self._created_at = self._parseDatetime( attributes[ "created_at" ] ) - if "id" in attributes: # pragma no branch - assert attributes[ "id" ] is None or isinstance( attributes[ "id" ], int ), attributes[ "id" ] - self._id = attributes[ "id" ] - if "updated_at" in attributes: # pragma no branch - assert attributes[ "updated_at" ] is None or isinstance( attributes[ "updated_at" ], ( str, unicode ) ), attributes[ "updated_at" ] - self._updated_at = self._parseDatetime( attributes[ "updated_at" ] ) - if "url" in attributes: # pragma no branch - assert attributes[ "url" ] is None or isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ] - self._url = attributes[ "url" ] - if "user" in attributes: # pragma no branch - assert attributes[ "user" ] is None or isinstance( attributes[ "user" ], dict ), attributes[ "user" ] - self._user = None if attributes[ "user" ] is None else NamedUser.NamedUser( self._requester, attributes[ "user" ], completed = False ) + def _useAttributes(self, attributes): + if "body" in attributes: # pragma no branch + assert attributes["body"] is None or isinstance(attributes["body"], (str, unicode)), attributes["body"] + self._body = attributes["body"] + if "created_at" in attributes: # pragma no branch + assert attributes["created_at"] is None or isinstance(attributes["created_at"], (str, unicode)), attributes["created_at"] + self._created_at = self._parseDatetime(attributes["created_at"]) + if "id" in attributes: # pragma no branch + assert attributes["id"] is None or isinstance(attributes["id"], int), attributes["id"] + self._id = attributes["id"] + if "updated_at" in attributes: # pragma no branch + assert attributes["updated_at"] is None or isinstance(attributes["updated_at"], (str, unicode)), attributes["updated_at"] + self._updated_at = self._parseDatetime(attributes["updated_at"]) + if "url" in attributes: # pragma no branch + assert attributes["url"] is None or isinstance(attributes["url"], (str, unicode)), attributes["url"] + self._url = attributes["url"] + if "user" in attributes: # pragma no branch + assert attributes["user"] is None or isinstance(attributes["user"], dict), attributes["user"] + self._user = None if attributes["user"] is None else NamedUser.NamedUser(self._requester, attributes["user"], completed=False) diff --git a/github/IssueEvent.py b/github/IssueEvent.py index c95b28e1..ba658efd 100644 --- a/github/IssueEvent.py +++ b/github/IssueEvent.py @@ -16,43 +16,44 @@ import GithubObject import Issue import NamedUser -class IssueEvent( GithubObject.GithubObject ): + +class IssueEvent(GithubObject.GithubObject): @property - def actor( self ): - self._completeIfNotSet( self._actor ) - return self._NoneIfNotSet( self._actor ) + def actor(self): + self._completeIfNotSet(self._actor) + return self._NoneIfNotSet(self._actor) @property - def commit_id( self ): - self._completeIfNotSet( self._commit_id ) - return self._NoneIfNotSet( self._commit_id ) + def commit_id(self): + self._completeIfNotSet(self._commit_id) + return self._NoneIfNotSet(self._commit_id) @property - def created_at( self ): - self._completeIfNotSet( self._created_at ) - return self._NoneIfNotSet( self._created_at ) + def created_at(self): + self._completeIfNotSet(self._created_at) + return self._NoneIfNotSet(self._created_at) @property - def event( self ): - self._completeIfNotSet( self._event ) - return self._NoneIfNotSet( self._event ) + def event(self): + self._completeIfNotSet(self._event) + return self._NoneIfNotSet(self._event) @property - def id( self ): - self._completeIfNotSet( self._id ) - return self._NoneIfNotSet( self._id ) + def id(self): + self._completeIfNotSet(self._id) + return self._NoneIfNotSet(self._id) @property - def issue( self ): - self._completeIfNotSet( self._issue ) - return self._NoneIfNotSet( self._issue ) + def issue(self): + self._completeIfNotSet(self._issue) + return self._NoneIfNotSet(self._issue) @property - def url( self ): - self._completeIfNotSet( self._url ) - return self._NoneIfNotSet( self._url ) + def url(self): + self._completeIfNotSet(self._url) + return self._NoneIfNotSet(self._url) - def _initAttributes( self ): + def _initAttributes(self): self._actor = GithubObject.NotSet self._commit_id = GithubObject.NotSet self._created_at = GithubObject.NotSet @@ -61,25 +62,25 @@ class IssueEvent( GithubObject.GithubObject ): self._issue = GithubObject.NotSet self._url = GithubObject.NotSet - def _useAttributes( self, attributes ): - if "actor" in attributes: # pragma no branch - assert attributes[ "actor" ] is None or isinstance( attributes[ "actor" ], dict ), attributes[ "actor" ] - self._actor = None if attributes[ "actor" ] is None else NamedUser.NamedUser( self._requester, attributes[ "actor" ], completed = False ) - if "commit_id" in attributes: # pragma no branch - assert attributes[ "commit_id" ] is None or isinstance( attributes[ "commit_id" ], ( str, unicode ) ), attributes[ "commit_id" ] - self._commit_id = attributes[ "commit_id" ] - if "created_at" in attributes: # pragma no branch - assert attributes[ "created_at" ] is None or isinstance( attributes[ "created_at" ], ( str, unicode ) ), attributes[ "created_at" ] - self._created_at = self._parseDatetime( attributes[ "created_at" ] ) - if "event" in attributes: # pragma no branch - assert attributes[ "event" ] is None or isinstance( attributes[ "event" ], ( str, unicode ) ), attributes[ "event" ] - self._event = attributes[ "event" ] - if "id" in attributes: # pragma no branch - assert attributes[ "id" ] is None or isinstance( attributes[ "id" ], int ), attributes[ "id" ] - self._id = attributes[ "id" ] - if "issue" in attributes: # pragma no branch - assert attributes[ "issue" ] is None or isinstance( attributes[ "issue" ], dict ), attributes[ "issue" ] - self._issue = None if attributes[ "issue" ] is None else Issue.Issue( self._requester, attributes[ "issue" ], completed = False ) - if "url" in attributes: # pragma no branch - assert attributes[ "url" ] is None or isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ] - self._url = attributes[ "url" ] + def _useAttributes(self, attributes): + if "actor" in attributes: # pragma no branch + assert attributes["actor"] is None or isinstance(attributes["actor"], dict), attributes["actor"] + self._actor = None if attributes["actor"] is None else NamedUser.NamedUser(self._requester, attributes["actor"], completed=False) + if "commit_id" in attributes: # pragma no branch + assert attributes["commit_id"] is None or isinstance(attributes["commit_id"], (str, unicode)), attributes["commit_id"] + self._commit_id = attributes["commit_id"] + if "created_at" in attributes: # pragma no branch + assert attributes["created_at"] is None or isinstance(attributes["created_at"], (str, unicode)), attributes["created_at"] + self._created_at = self._parseDatetime(attributes["created_at"]) + if "event" in attributes: # pragma no branch + assert attributes["event"] is None or isinstance(attributes["event"], (str, unicode)), attributes["event"] + self._event = attributes["event"] + if "id" in attributes: # pragma no branch + assert attributes["id"] is None or isinstance(attributes["id"], int), attributes["id"] + self._id = attributes["id"] + if "issue" in attributes: # pragma no branch + assert attributes["issue"] is None or isinstance(attributes["issue"], dict), attributes["issue"] + self._issue = None if attributes["issue"] is None else Issue.Issue(self._requester, attributes["issue"], completed=False) + if "url" in attributes: # pragma no branch + assert attributes["url"] is None or isinstance(attributes["url"], (str, unicode)), attributes["url"] + self._url = attributes["url"] diff --git a/github/IssuePullRequest.py b/github/IssuePullRequest.py index 2228e2a9..6f94cb23 100644 --- a/github/IssuePullRequest.py +++ b/github/IssuePullRequest.py @@ -13,31 +13,32 @@ import GithubObject -class IssuePullRequest( GithubObject.BasicGithubObject ): + +class IssuePullRequest(GithubObject.BasicGithubObject): @property - def diff_url( self ): - return self._NoneIfNotSet( self._diff_url ) + def diff_url(self): + return self._NoneIfNotSet(self._diff_url) @property - def html_url( self ): - return self._NoneIfNotSet( self._html_url ) + def html_url(self): + return self._NoneIfNotSet(self._html_url) @property - def patch_url( self ): - return self._NoneIfNotSet( self._patch_url ) + def patch_url(self): + return self._NoneIfNotSet(self._patch_url) - def _initAttributes( self ): + def _initAttributes(self): self._diff_url = GithubObject.NotSet self._html_url = GithubObject.NotSet self._patch_url = GithubObject.NotSet - def _useAttributes( self, attributes ): - if "diff_url" in attributes: # pragma no branch - assert attributes[ "diff_url" ] is None or isinstance( attributes[ "diff_url" ], ( str, unicode ) ), attributes[ "diff_url" ] - self._diff_url = attributes[ "diff_url" ] - if "html_url" in attributes: # pragma no branch - assert attributes[ "html_url" ] is None or isinstance( attributes[ "html_url" ], ( str, unicode ) ), attributes[ "html_url" ] - self._html_url = attributes[ "html_url" ] - if "patch_url" in attributes: # pragma no branch - assert attributes[ "patch_url" ] is None or isinstance( attributes[ "patch_url" ], ( str, unicode ) ), attributes[ "patch_url" ] - self._patch_url = attributes[ "patch_url" ] + def _useAttributes(self, attributes): + if "diff_url" in attributes: # pragma no branch + assert attributes["diff_url"] is None or isinstance(attributes["diff_url"], (str, unicode)), attributes["diff_url"] + self._diff_url = attributes["diff_url"] + if "html_url" in attributes: # pragma no branch + assert attributes["html_url"] is None or isinstance(attributes["html_url"], (str, unicode)), attributes["html_url"] + self._html_url = attributes["html_url"] + if "patch_url" in attributes: # pragma no branch + assert attributes["patch_url"] is None or isinstance(attributes["patch_url"], (str, unicode)), attributes["patch_url"] + self._patch_url = attributes["patch_url"] diff --git a/github/Label.py b/github/Label.py index c3baf858..3dcc0d5a 100644 --- a/github/Label.py +++ b/github/Label.py @@ -15,23 +15,24 @@ import urllib import GithubObject -class Label( GithubObject.GithubObject ): + +class Label(GithubObject.GithubObject): @property - def color( self ): - self._completeIfNotSet( self._color ) - return self._NoneIfNotSet( self._color ) + def color(self): + self._completeIfNotSet(self._color) + return self._NoneIfNotSet(self._color) @property - def name( self ): - self._completeIfNotSet( self._name ) - return self._NoneIfNotSet( self._name ) + def name(self): + self._completeIfNotSet(self._name) + return self._NoneIfNotSet(self._name) @property - def url( self ): - self._completeIfNotSet( self._url ) - return self._NoneIfNotSet( self._url ) + def url(self): + self._completeIfNotSet(self._url) + return self._NoneIfNotSet(self._url) - def delete( self ): + def delete(self): headers, data = self._requester.requestAndCheck( "DELETE", self.url, @@ -39,9 +40,9 @@ class Label( GithubObject.GithubObject ): None ) - def edit( self, name, color ): - assert isinstance( name, ( str, unicode ) ), name - assert isinstance( color, ( str, unicode ) ), color + def edit(self, name, color): + assert isinstance(name, (str, unicode)), name + assert isinstance(color, (str, unicode)), color post_parameters = { "name": name, "color": color, @@ -52,24 +53,24 @@ class Label( GithubObject.GithubObject ): None, post_parameters ) - self._useAttributes( data ) + self._useAttributes(data) @property - def _identity( self ): - return urllib.quote( self.name ) + def _identity(self): + return urllib.quote(self.name) - def _initAttributes( self ): + def _initAttributes(self): self._color = GithubObject.NotSet self._name = GithubObject.NotSet self._url = GithubObject.NotSet - def _useAttributes( self, attributes ): - if "color" in attributes: # pragma no branch - assert attributes[ "color" ] is None or isinstance( attributes[ "color" ], ( str, unicode ) ), attributes[ "color" ] - self._color = attributes[ "color" ] - if "name" in attributes: # pragma no branch - assert attributes[ "name" ] is None or isinstance( attributes[ "name" ], ( str, unicode ) ), attributes[ "name" ] - self._name = attributes[ "name" ] - if "url" in attributes: # pragma no branch - assert attributes[ "url" ] is None or isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ] - self._url = attributes[ "url" ] + def _useAttributes(self, attributes): + if "color" in attributes: # pragma no branch + assert attributes["color"] is None or isinstance(attributes["color"], (str, unicode)), attributes["color"] + self._color = attributes["color"] + if "name" in attributes: # pragma no branch + assert attributes["name"] is None or isinstance(attributes["name"], (str, unicode)), attributes["name"] + self._name = attributes["name"] + if "url" in attributes: # pragma no branch + assert attributes["url"] is None or isinstance(attributes["url"], (str, unicode)), attributes["url"] + self._url = attributes["url"] diff --git a/github/Legacy.py b/github/Legacy.py index c266c3d2..de55eb61 100644 --- a/github/Legacy.py +++ b/github/Legacy.py @@ -15,9 +15,10 @@ import urlparse from PaginatedList import PaginatedListBase -class PaginatedList( PaginatedListBase ): - def __init__( self, url, args, requester, key, convert, contentClass ): - PaginatedListBase.__init__( self ) + +class PaginatedList(PaginatedListBase): + def __init__(self, url, args, requester, key, convert, contentClass): + PaginatedListBase.__init__(self) self.__url = url self.__args = args self.__requester = requester @@ -27,77 +28,108 @@ class PaginatedList( PaginatedListBase ): self.__nextPage = 0 self.__continue = True - def _couldGrow( self ): + def _couldGrow(self): return self.__continue - def _fetchNextPage( self ): + def _fetchNextPage(self): page = self.__nextPage self.__nextPage += 1 - return self.get_page( page ) + return self.get_page(page) - def get_page( self, page ): - assert isinstance( page, int ), page - args = dict( self.__args ) + def get_page(self, page): + assert isinstance(page, int), page + args = dict(self.__args) if page != 0: - args[ "start_page" ] = page + 1 + args["start_page"] = page + 1 headers, data = self.__requester.requestAndCheck( "GET", self.__url, args, None ) - self.__continue = len( data[ self.__key ] ) > 0 + self.__continue = len(data[self.__key]) > 0 return [ - self.__contentClass( self.__requester, self.__convert( element ), completed = False ) - for element in data[ self.__key ] + self.__contentClass(self.__requester, self.__convert(element), completed=False) + for element in data[self.__key] ] -def convertUser( attributes ): + +def convertUser(attributes): convertedAttributes = { - "login": attributes[ "login" ], - "url": "/users/" + attributes[ "login" ], + "login": attributes["login"], + "url": "/users/" + attributes["login"], } - if "gravatar_id" in attributes: convertedAttributes[ "gravatar_id" ] = attributes[ "gravatar_id" ] - if "followers" in attributes: convertedAttributes[ "followers" ] = attributes[ "followers" ] - if "repos" in attributes: convertedAttributes[ "public_repos" ] = attributes[ "repos" ] - if "name" in attributes: convertedAttributes[ "name" ] = attributes[ "name" ] - if "created_at" in attributes: convertedAttributes[ "created_at" ] = attributes[ "created_at" ] - if "location" in attributes: convertedAttributes[ "location" ] = attributes[ "location" ] + if "gravatar_id" in attributes: + convertedAttributes["gravatar_id"] = attributes["gravatar_id"] + if "followers" in attributes: + convertedAttributes["followers"] = attributes["followers"] + if "repos" in attributes: + convertedAttributes["public_repos"] = attributes["repos"] + if "name" in attributes: + convertedAttributes["name"] = attributes["name"] + if "created_at" in attributes: + convertedAttributes["created_at"] = attributes["created_at"] + if "location" in attributes: + convertedAttributes["location"] = attributes["location"] return convertedAttributes -def convertRepo( attributes ): + +def convertRepo(attributes): convertedAttributes = { - "owner": { "login": attributes[ "owner" ], "url": "/users/" + attributes[ "owner" ] }, - "url": "/repos/" + attributes[ "owner" ] + "/" + attributes[ "name" ], + "owner": {"login": attributes["owner"], "url": "/users/" + attributes["owner"]}, + "url": "/repos/" + attributes["owner"] + "/" + attributes["name"], } - if "pushed_at" in attributes: convertedAttributes[ "pushed_at" ] = attributes[ "pushed_at" ] - if "homepage" in attributes: convertedAttributes[ "homepage" ] = attributes[ "homepage" ] - if "created_at" in attributes: convertedAttributes[ "created_at" ] = attributes[ "created_at" ] - if "watchers" in attributes: convertedAttributes[ "watchers" ] = attributes[ "watchers" ] - if "has_downloads" in attributes: convertedAttributes[ "has_downloads" ] = attributes[ "has_downloads" ] - if "fork" in attributes: convertedAttributes[ "fork" ] = attributes[ "fork" ] - if "has_issues" in attributes: convertedAttributes[ "has_issues" ] = attributes[ "has_issues" ] - if "has_wiki" in attributes: convertedAttributes[ "has_wiki" ] = attributes[ "has_wiki" ] - if "forks" in attributes: convertedAttributes[ "forks" ] = attributes[ "forks" ] - if "size" in attributes: convertedAttributes[ "size" ] = attributes[ "size" ] - if "private" in attributes: convertedAttributes[ "private" ] = attributes[ "private" ] - if "open_issues" in attributes: convertedAttributes[ "open_issues" ] = attributes[ "open_issues" ] - if "description" in attributes: convertedAttributes[ "description" ] = attributes[ "description" ] - if "language" in attributes: convertedAttributes[ "language" ] = attributes[ "language" ] - if "name" in attributes: convertedAttributes[ "name" ] = attributes[ "name" ] + if "pushed_at" in attributes: + convertedAttributes["pushed_at"] = attributes["pushed_at"] + if "homepage" in attributes: + convertedAttributes["homepage"] = attributes["homepage"] + if "created_at" in attributes: + convertedAttributes["created_at"] = attributes["created_at"] + if "watchers" in attributes: + convertedAttributes["watchers"] = attributes["watchers"] + if "has_downloads" in attributes: + convertedAttributes["has_downloads"] = attributes["has_downloads"] + if "fork" in attributes: + convertedAttributes["fork"] = attributes["fork"] + if "has_issues" in attributes: + convertedAttributes["has_issues"] = attributes["has_issues"] + if "has_wiki" in attributes: + convertedAttributes["has_wiki"] = attributes["has_wiki"] + if "forks" in attributes: + convertedAttributes["forks"] = attributes["forks"] + if "size" in attributes: + convertedAttributes["size"] = attributes["size"] + if "private" in attributes: + convertedAttributes["private"] = attributes["private"] + if "open_issues" in attributes: + convertedAttributes["open_issues"] = attributes["open_issues"] + if "description" in attributes: + convertedAttributes["description"] = attributes["description"] + if "language" in attributes: + convertedAttributes["language"] = attributes["language"] + if "name" in attributes: + convertedAttributes["name"] = attributes["name"] return convertedAttributes -def convertIssue( attributes ): + +def convertIssue(attributes): convertedAttributes = { - "number": attributes[ "number" ], - "url": "/repos" + urlparse.urlparse( attributes[ "html_url" ] ).path, - "user": { "login": attributes[ "user" ], "url": "/users/" + attributes[ "user" ] }, + "number": attributes["number"], + "url": "/repos" + urlparse.urlparse(attributes["html_url"]).path, + "user": {"login": attributes["user"], "url": "/users/" + attributes["user"]}, } - if "labels" in attributes: convertedAttributes[ "labels" ] = [ { "name": label } for label in attributes[ "labels" ] ] - if "title" in attributes: convertedAttributes[ "title" ] = attributes[ "title" ] - if "created_at" in attributes: convertedAttributes[ "created_at" ] = attributes[ "created_at" ] - if "comments" in attributes: convertedAttributes[ "comments" ] = attributes[ "comments" ] - if "body" in attributes: convertedAttributes[ "body" ] = attributes[ "body" ] - if "updated_at" in attributes: convertedAttributes[ "updated_at" ] = attributes[ "updated_at" ] - if "state" in attributes: convertedAttributes[ "state" ] = attributes[ "state" ] + if "labels" in attributes: + convertedAttributes["labels"] = [{"name": label} for label in attributes["labels"]] + if "title" in attributes: + convertedAttributes["title"] = attributes["title"] + if "created_at" in attributes: + convertedAttributes["created_at"] = attributes["created_at"] + if "comments" in attributes: + convertedAttributes["comments"] = attributes["comments"] + if "body" in attributes: + convertedAttributes["body"] = attributes["body"] + if "updated_at" in attributes: + convertedAttributes["updated_at"] = attributes["updated_at"] + if "state" in attributes: + convertedAttributes["state"] = attributes["state"] return convertedAttributes diff --git a/github/Logging.py b/github/Logging.py index 043fde0d..284ccba5 100644 --- a/github/Logging.py +++ b/github/Logging.py @@ -1,4 +1,5 @@ -import logging - -def get_logger(): - return logging.getLogger('github') +import logging + + +def get_logger(): + return logging.getLogger('github') diff --git a/github/Milestone.py b/github/Milestone.py index 47afe173..7a0c2262 100644 --- a/github/Milestone.py +++ b/github/Milestone.py @@ -19,63 +19,64 @@ import PaginatedList import NamedUser import Label -class Milestone( GithubObject.GithubObject ): + +class Milestone(GithubObject.GithubObject): @property - def closed_issues( self ): - self._completeIfNotSet( self._closed_issues ) - return self._NoneIfNotSet( self._closed_issues ) + def closed_issues(self): + self._completeIfNotSet(self._closed_issues) + return self._NoneIfNotSet(self._closed_issues) @property - def created_at( self ): - self._completeIfNotSet( self._created_at ) - return self._NoneIfNotSet( self._created_at ) + def created_at(self): + self._completeIfNotSet(self._created_at) + return self._NoneIfNotSet(self._created_at) @property - def creator( self ): - self._completeIfNotSet( self._creator ) - return self._NoneIfNotSet( self._creator ) + def creator(self): + self._completeIfNotSet(self._creator) + return self._NoneIfNotSet(self._creator) @property - def description( self ): - self._completeIfNotSet( self._description ) - return self._NoneIfNotSet( self._description ) + def description(self): + self._completeIfNotSet(self._description) + return self._NoneIfNotSet(self._description) @property - def due_on( self ): - self._completeIfNotSet( self._due_on ) - return self._NoneIfNotSet( self._due_on ) + def due_on(self): + self._completeIfNotSet(self._due_on) + return self._NoneIfNotSet(self._due_on) @property - def id( self ): - self._completeIfNotSet( self._id ) - return self._NoneIfNotSet( self._id ) + def id(self): + self._completeIfNotSet(self._id) + return self._NoneIfNotSet(self._id) @property - def number( self ): - self._completeIfNotSet( self._number ) - return self._NoneIfNotSet( self._number ) + def number(self): + self._completeIfNotSet(self._number) + return self._NoneIfNotSet(self._number) @property - def open_issues( self ): - self._completeIfNotSet( self._open_issues ) - return self._NoneIfNotSet( self._open_issues ) + def open_issues(self): + self._completeIfNotSet(self._open_issues) + return self._NoneIfNotSet(self._open_issues) @property - def state( self ): - self._completeIfNotSet( self._state ) - return self._NoneIfNotSet( self._state ) + def state(self): + self._completeIfNotSet(self._state) + return self._NoneIfNotSet(self._state) @property - def title( self ): - self._completeIfNotSet( self._title ) - return self._NoneIfNotSet( self._title ) + def title(self): + self._completeIfNotSet(self._title) + return self._NoneIfNotSet(self._title) @property - def url( self ): - self._completeIfNotSet( self._url ) - return self._NoneIfNotSet( self._url ) + def url(self): + self._completeIfNotSet(self._url) + return self._NoneIfNotSet(self._url) - def delete( self ): + def delete(self): headers, data = self._requester.requestAndCheck( "DELETE", self.url, @@ -83,29 +84,29 @@ class Milestone( GithubObject.GithubObject ): None ) - def edit( self, title, state = GithubObject.NotSet, description = GithubObject.NotSet, due_on = GithubObject.NotSet ): - assert isinstance( title, ( str, unicode ) ), title - assert state is GithubObject.NotSet or isinstance( state, ( str, unicode ) ), state - assert description is GithubObject.NotSet or isinstance( description, ( str, unicode ) ), description - assert due_on is GithubObject.NotSet or isinstance( due_on, datetime.date ), due_on + def edit(self, title, state=GithubObject.NotSet, description=GithubObject.NotSet, due_on=GithubObject.NotSet): + assert isinstance(title, (str, unicode)), title + assert state is GithubObject.NotSet or isinstance(state, (str, unicode)), state + assert description is GithubObject.NotSet or isinstance(description, (str, unicode)), description + assert due_on is GithubObject.NotSet or isinstance(due_on, datetime.date), due_on post_parameters = { "title": title, } if state is not GithubObject.NotSet: - post_parameters[ "state" ] = state + post_parameters["state"] = state if description is not GithubObject.NotSet: - post_parameters[ "description" ] = description + post_parameters["description"] = description if due_on is not GithubObject.NotSet: - post_parameters[ "due_on" ] = due_on.strftime( "%Y-%m-%d" ) + post_parameters["due_on"] = due_on.strftime("%Y-%m-%d") headers, data = self._requester.requestAndCheck( "PATCH", self.url, None, post_parameters ) - self._useAttributes( data ) + self._useAttributes(data) - def get_labels( self ): + def get_labels(self): return PaginatedList.PaginatedList( Label.Label, self._requester, @@ -114,10 +115,10 @@ class Milestone( GithubObject.GithubObject ): ) @property - def _identity( self ): + def _identity(self): return self.number - def _initAttributes( self ): + def _initAttributes(self): self._closed_issues = GithubObject.NotSet self._created_at = GithubObject.NotSet self._creator = GithubObject.NotSet @@ -130,37 +131,37 @@ class Milestone( GithubObject.GithubObject ): self._title = GithubObject.NotSet self._url = GithubObject.NotSet - def _useAttributes( self, attributes ): - if "closed_issues" in attributes: # pragma no branch - assert attributes[ "closed_issues" ] is None or isinstance( attributes[ "closed_issues" ], int ), attributes[ "closed_issues" ] - self._closed_issues = attributes[ "closed_issues" ] - if "created_at" in attributes: # pragma no branch - assert attributes[ "created_at" ] is None or isinstance( attributes[ "created_at" ], ( str, unicode ) ), attributes[ "created_at" ] - self._created_at = self._parseDatetime( attributes[ "created_at" ] ) - if "creator" in attributes: # pragma no branch - assert attributes[ "creator" ] is None or isinstance( attributes[ "creator" ], dict ), attributes[ "creator" ] - self._creator = None if attributes[ "creator" ] is None else NamedUser.NamedUser( self._requester, attributes[ "creator" ], completed = False ) - if "description" in attributes: # pragma no branch - assert attributes[ "description" ] is None or isinstance( attributes[ "description" ], ( str, unicode ) ), attributes[ "description" ] - self._description = attributes[ "description" ] - if "due_on" in attributes: # pragma no branch - assert attributes[ "due_on" ] is None or isinstance( attributes[ "due_on" ], ( str, unicode ) ), attributes[ "due_on" ] - self._due_on = self._parseDatetime( attributes[ "due_on" ] ) - if "id" in attributes: # pragma no branch - assert attributes[ "id" ] is None or isinstance( attributes[ "id" ], int ), attributes[ "id" ] - self._id = attributes[ "id" ] - if "number" in attributes: # pragma no branch - assert attributes[ "number" ] is None or isinstance( attributes[ "number" ], int ), attributes[ "number" ] - self._number = attributes[ "number" ] - if "open_issues" in attributes: # pragma no branch - assert attributes[ "open_issues" ] is None or isinstance( attributes[ "open_issues" ], int ), attributes[ "open_issues" ] - self._open_issues = attributes[ "open_issues" ] - if "state" in attributes: # pragma no branch - assert attributes[ "state" ] is None or isinstance( attributes[ "state" ], ( str, unicode ) ), attributes[ "state" ] - self._state = attributes[ "state" ] - if "title" in attributes: # pragma no branch - assert attributes[ "title" ] is None or isinstance( attributes[ "title" ], ( str, unicode ) ), attributes[ "title" ] - self._title = attributes[ "title" ] - if "url" in attributes: # pragma no branch - assert attributes[ "url" ] is None or isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ] - self._url = attributes[ "url" ] + def _useAttributes(self, attributes): + if "closed_issues" in attributes: # pragma no branch + assert attributes["closed_issues"] is None or isinstance(attributes["closed_issues"], int), attributes["closed_issues"] + self._closed_issues = attributes["closed_issues"] + if "created_at" in attributes: # pragma no branch + assert attributes["created_at"] is None or isinstance(attributes["created_at"], (str, unicode)), attributes["created_at"] + self._created_at = self._parseDatetime(attributes["created_at"]) + if "creator" in attributes: # pragma no branch + assert attributes["creator"] is None or isinstance(attributes["creator"], dict), attributes["creator"] + self._creator = None if attributes["creator"] is None else NamedUser.NamedUser(self._requester, attributes["creator"], completed=False) + if "description" in attributes: # pragma no branch + assert attributes["description"] is None or isinstance(attributes["description"], (str, unicode)), attributes["description"] + self._description = attributes["description"] + if "due_on" in attributes: # pragma no branch + assert attributes["due_on"] is None or isinstance(attributes["due_on"], (str, unicode)), attributes["due_on"] + self._due_on = self._parseDatetime(attributes["due_on"]) + if "id" in attributes: # pragma no branch + assert attributes["id"] is None or isinstance(attributes["id"], int), attributes["id"] + self._id = attributes["id"] + if "number" in attributes: # pragma no branch + assert attributes["number"] is None or isinstance(attributes["number"], int), attributes["number"] + self._number = attributes["number"] + if "open_issues" in attributes: # pragma no branch + assert attributes["open_issues"] is None or isinstance(attributes["open_issues"], int), attributes["open_issues"] + self._open_issues = attributes["open_issues"] + if "state" in attributes: # pragma no branch + assert attributes["state"] is None or isinstance(attributes["state"], (str, unicode)), attributes["state"] + self._state = attributes["state"] + if "title" in attributes: # pragma no branch + assert attributes["title"] is None or isinstance(attributes["title"], (str, unicode)), attributes["title"] + self._title = attributes["title"] + if "url" in attributes: # pragma no branch + assert attributes["url"] is None or isinstance(attributes["url"], (str, unicode)), attributes["url"] + self._url = attributes["url"] diff --git a/github/NamedUser.py b/github/NamedUser.py index 03a66e4b..e8666187 100644 --- a/github/NamedUser.py +++ b/github/NamedUser.py @@ -22,156 +22,157 @@ import Organization import InputFileContent import Event -class NamedUser( GithubObject.GithubObject ): + +class NamedUser(GithubObject.GithubObject): @property - def avatar_url( self ): - self._completeIfNotSet( self._avatar_url ) - return self._NoneIfNotSet( self._avatar_url ) + def avatar_url(self): + self._completeIfNotSet(self._avatar_url) + return self._NoneIfNotSet(self._avatar_url) @property - def bio( self ): - self._completeIfNotSet( self._bio ) - return self._NoneIfNotSet( self._bio ) + def bio(self): + self._completeIfNotSet(self._bio) + return self._NoneIfNotSet(self._bio) @property - def blog( self ): - self._completeIfNotSet( self._blog ) - return self._NoneIfNotSet( self._blog ) + def blog(self): + self._completeIfNotSet(self._blog) + return self._NoneIfNotSet(self._blog) @property - def collaborators( self ): - self._completeIfNotSet( self._collaborators ) - return self._NoneIfNotSet( self._collaborators ) + def collaborators(self): + self._completeIfNotSet(self._collaborators) + return self._NoneIfNotSet(self._collaborators) @property - def company( self ): - self._completeIfNotSet( self._company ) - return self._NoneIfNotSet( self._company ) + def company(self): + self._completeIfNotSet(self._company) + return self._NoneIfNotSet(self._company) @property - def contributions( self ): - self._completeIfNotSet( self._contributions ) - return self._NoneIfNotSet( self._contributions ) + def contributions(self): + self._completeIfNotSet(self._contributions) + return self._NoneIfNotSet(self._contributions) @property - def created_at( self ): - self._completeIfNotSet( self._created_at ) - return self._NoneIfNotSet( self._created_at ) + def created_at(self): + self._completeIfNotSet(self._created_at) + return self._NoneIfNotSet(self._created_at) @property - def disk_usage( self ): - self._completeIfNotSet( self._disk_usage ) - return self._NoneIfNotSet( self._disk_usage ) + def disk_usage(self): + self._completeIfNotSet(self._disk_usage) + return self._NoneIfNotSet(self._disk_usage) @property - def email( self ): - self._completeIfNotSet( self._email ) - return self._NoneIfNotSet( self._email ) + def email(self): + self._completeIfNotSet(self._email) + return self._NoneIfNotSet(self._email) @property - def followers( self ): - self._completeIfNotSet( self._followers ) - return self._NoneIfNotSet( self._followers ) + def followers(self): + self._completeIfNotSet(self._followers) + return self._NoneIfNotSet(self._followers) @property - def following( self ): - self._completeIfNotSet( self._following ) - return self._NoneIfNotSet( self._following ) + def following(self): + self._completeIfNotSet(self._following) + return self._NoneIfNotSet(self._following) @property - def gravatar_id( self ): - self._completeIfNotSet( self._gravatar_id ) - return self._NoneIfNotSet( self._gravatar_id ) + def gravatar_id(self): + self._completeIfNotSet(self._gravatar_id) + return self._NoneIfNotSet(self._gravatar_id) @property - def hireable( self ): - self._completeIfNotSet( self._hireable ) - return self._NoneIfNotSet( self._hireable ) + def hireable(self): + self._completeIfNotSet(self._hireable) + return self._NoneIfNotSet(self._hireable) @property - def html_url( self ): - self._completeIfNotSet( self._html_url ) - return self._NoneIfNotSet( self._html_url ) + def html_url(self): + self._completeIfNotSet(self._html_url) + return self._NoneIfNotSet(self._html_url) @property - def id( self ): - self._completeIfNotSet( self._id ) - return self._NoneIfNotSet( self._id ) + def id(self): + self._completeIfNotSet(self._id) + return self._NoneIfNotSet(self._id) @property - def location( self ): - self._completeIfNotSet( self._location ) - return self._NoneIfNotSet( self._location ) + def location(self): + self._completeIfNotSet(self._location) + return self._NoneIfNotSet(self._location) @property - def login( self ): - self._completeIfNotSet( self._login ) - return self._NoneIfNotSet( self._login ) + def login(self): + self._completeIfNotSet(self._login) + return self._NoneIfNotSet(self._login) @property - def name( self ): - self._completeIfNotSet( self._name ) - return self._NoneIfNotSet( self._name ) + def name(self): + self._completeIfNotSet(self._name) + return self._NoneIfNotSet(self._name) @property - def owned_private_repos( self ): - self._completeIfNotSet( self._owned_private_repos ) - return self._NoneIfNotSet( self._owned_private_repos ) + def owned_private_repos(self): + self._completeIfNotSet(self._owned_private_repos) + return self._NoneIfNotSet(self._owned_private_repos) @property - def plan( self ): - self._completeIfNotSet( self._plan ) - return self._NoneIfNotSet( self._plan ) + def plan(self): + self._completeIfNotSet(self._plan) + return self._NoneIfNotSet(self._plan) @property - def private_gists( self ): - self._completeIfNotSet( self._private_gists ) - return self._NoneIfNotSet( self._private_gists ) + def private_gists(self): + self._completeIfNotSet(self._private_gists) + return self._NoneIfNotSet(self._private_gists) @property - def public_gists( self ): - self._completeIfNotSet( self._public_gists ) - return self._NoneIfNotSet( self._public_gists ) + def public_gists(self): + self._completeIfNotSet(self._public_gists) + return self._NoneIfNotSet(self._public_gists) @property - def public_repos( self ): - self._completeIfNotSet( self._public_repos ) - return self._NoneIfNotSet( self._public_repos ) + def public_repos(self): + self._completeIfNotSet(self._public_repos) + return self._NoneIfNotSet(self._public_repos) @property - def total_private_repos( self ): - self._completeIfNotSet( self._total_private_repos ) - return self._NoneIfNotSet( self._total_private_repos ) + def total_private_repos(self): + self._completeIfNotSet(self._total_private_repos) + return self._NoneIfNotSet(self._total_private_repos) @property - def type( self ): - self._completeIfNotSet( self._type ) - return self._NoneIfNotSet( self._type ) + def type(self): + self._completeIfNotSet(self._type) + return self._NoneIfNotSet(self._type) @property - def url( self ): - self._completeIfNotSet( self._url ) - return self._NoneIfNotSet( self._url ) + def url(self): + self._completeIfNotSet(self._url) + return self._NoneIfNotSet(self._url) - def create_gist( self, public, files, description = GithubObject.NotSet ): - assert isinstance( public, bool ), public - assert all( isinstance( element, InputFileContent.InputFileContent ) for element in files.itervalues() ), files - assert description is GithubObject.NotSet or isinstance( description, ( str, unicode ) ), description + def create_gist(self, public, files, description=GithubObject.NotSet): + assert isinstance(public, bool), public + assert all(isinstance(element, InputFileContent.InputFileContent) for element in files.itervalues()), files + assert description is GithubObject.NotSet or isinstance(description, (str, unicode)), description post_parameters = { "public": public, - "files": dict( ( key, value._identity ) for key, value in files.iteritems() ), + "files": dict((key, value._identity) for key, value in files.iteritems()), } if description is not GithubObject.NotSet: - post_parameters[ "description" ] = description + post_parameters["description"] = description headers, data = self._requester.requestAndCheck( "POST", self.url + "/gists", None, post_parameters ) - return Gist.Gist( self._requester, data, completed = True ) + return Gist.Gist(self._requester, data, completed=True) - def get_events( self ): + def get_events(self): return PaginatedList.PaginatedList( Event.Event, self._requester, @@ -179,7 +180,7 @@ class NamedUser( GithubObject.GithubObject ): None ) - def get_followers( self ): + def get_followers(self): return PaginatedList.PaginatedList( NamedUser, self._requester, @@ -187,7 +188,7 @@ class NamedUser( GithubObject.GithubObject ): None ) - def get_following( self ): + def get_following(self): return PaginatedList.PaginatedList( NamedUser, self._requester, @@ -195,7 +196,7 @@ class NamedUser( GithubObject.GithubObject ): None ) - def get_gists( self ): + def get_gists(self): return PaginatedList.PaginatedList( Gist.Gist, self._requester, @@ -203,7 +204,7 @@ class NamedUser( GithubObject.GithubObject ): None ) - def get_orgs( self ): + def get_orgs(self): return PaginatedList.PaginatedList( Organization.Organization, self._requester, @@ -211,7 +212,7 @@ class NamedUser( GithubObject.GithubObject ): None ) - def get_public_events( self ): + def get_public_events(self): return PaginatedList.PaginatedList( Event.Event, self._requester, @@ -219,7 +220,7 @@ class NamedUser( GithubObject.GithubObject ): None ) - def get_public_received_events( self ): + def get_public_received_events(self): return PaginatedList.PaginatedList( Event.Event, self._requester, @@ -227,7 +228,7 @@ class NamedUser( GithubObject.GithubObject ): None ) - def get_received_events( self ): + def get_received_events(self): return PaginatedList.PaginatedList( Event.Event, self._requester, @@ -235,21 +236,21 @@ class NamedUser( GithubObject.GithubObject ): None ) - def get_repo( self, name ): - assert isinstance( name, ( str, unicode ) ), name + def get_repo(self, name): + assert isinstance(name, (str, unicode)), name headers, data = self._requester.requestAndCheck( "GET", "/repos/" + self.login + "/" + name, None, None ) - return Repository.Repository( self._requester, data, completed = True ) + return Repository.Repository(self._requester, data, completed=True) - def get_repos( self, type = GithubObject.NotSet ): - assert type is GithubObject.NotSet or isinstance( type, ( str, unicode ) ), type + def get_repos(self, type=GithubObject.NotSet): + assert type is GithubObject.NotSet or isinstance(type, (str, unicode)), type url_parameters = dict() if type is not GithubObject.NotSet: - url_parameters[ "type" ] = type + url_parameters["type"] = type return PaginatedList.PaginatedList( Repository.Repository, self._requester, @@ -257,7 +258,7 @@ class NamedUser( GithubObject.GithubObject ): url_parameters ) - def get_starred( self ): + def get_starred(self): return PaginatedList.PaginatedList( Repository.Repository, self._requester, @@ -265,7 +266,7 @@ class NamedUser( GithubObject.GithubObject ): None ) - def get_subscriptions( self ): + def get_subscriptions(self): return PaginatedList.PaginatedList( Repository.Repository, self._requester, @@ -273,7 +274,7 @@ class NamedUser( GithubObject.GithubObject ): None ) - def get_watched( self ): + def get_watched(self): return PaginatedList.PaginatedList( Repository.Repository, self._requester, @@ -282,10 +283,10 @@ class NamedUser( GithubObject.GithubObject ): ) @property - def _identity( self ): + def _identity(self): return self.login - def _initAttributes( self ): + def _initAttributes(self): self._avatar_url = GithubObject.NotSet self._bio = GithubObject.NotSet self._blog = GithubObject.NotSet @@ -313,82 +314,82 @@ class NamedUser( GithubObject.GithubObject ): self._type = GithubObject.NotSet self._url = GithubObject.NotSet - def _useAttributes( self, attributes ): - if "avatar_url" in attributes: # pragma no branch - assert attributes[ "avatar_url" ] is None or isinstance( attributes[ "avatar_url" ], ( str, unicode ) ), attributes[ "avatar_url" ] - self._avatar_url = attributes[ "avatar_url" ] - if "bio" in attributes: # pragma no branch - assert attributes[ "bio" ] is None or isinstance( attributes[ "bio" ], ( str, unicode ) ), attributes[ "bio" ] - self._bio = attributes[ "bio" ] - if "blog" in attributes: # pragma no branch - assert attributes[ "blog" ] is None or isinstance( attributes[ "blog" ], ( str, unicode ) ), attributes[ "blog" ] - self._blog = attributes[ "blog" ] - if "collaborators" in attributes: # pragma no branch - assert attributes[ "collaborators" ] is None or isinstance( attributes[ "collaborators" ], int ), attributes[ "collaborators" ] - self._collaborators = attributes[ "collaborators" ] - if "company" in attributes: # pragma no branch - assert attributes[ "company" ] is None or isinstance( attributes[ "company" ], ( str, unicode ) ), attributes[ "company" ] - self._company = attributes[ "company" ] - if "contributions" in attributes: # pragma no branch - assert attributes[ "contributions" ] is None or isinstance( attributes[ "contributions" ], int ), attributes[ "contributions" ] - self._contributions = attributes[ "contributions" ] - if "created_at" in attributes: # pragma no branch - assert attributes[ "created_at" ] is None or isinstance( attributes[ "created_at" ], ( str, unicode ) ), attributes[ "created_at" ] - self._created_at = self._parseDatetime( attributes[ "created_at" ] ) - if "disk_usage" in attributes: # pragma no branch - assert attributes[ "disk_usage" ] is None or isinstance( attributes[ "disk_usage" ], int ), attributes[ "disk_usage" ] - self._disk_usage = attributes[ "disk_usage" ] - if "email" in attributes: # pragma no branch - assert attributes[ "email" ] is None or isinstance( attributes[ "email" ], ( str, unicode ) ), attributes[ "email" ] - self._email = attributes[ "email" ] - if "followers" in attributes: # pragma no branch - assert attributes[ "followers" ] is None or isinstance( attributes[ "followers" ], int ), attributes[ "followers" ] - self._followers = attributes[ "followers" ] - if "following" in attributes: # pragma no branch - assert attributes[ "following" ] is None or isinstance( attributes[ "following" ], int ), attributes[ "following" ] - self._following = attributes[ "following" ] - if "gravatar_id" in attributes: # pragma no branch - assert attributes[ "gravatar_id" ] is None or isinstance( attributes[ "gravatar_id" ], ( str, unicode ) ), attributes[ "gravatar_id" ] - self._gravatar_id = attributes[ "gravatar_id" ] - if "hireable" in attributes: # pragma no branch - assert attributes[ "hireable" ] is None or isinstance( attributes[ "hireable" ], bool ), attributes[ "hireable" ] - self._hireable = attributes[ "hireable" ] - if "html_url" in attributes: # pragma no branch - assert attributes[ "html_url" ] is None or isinstance( attributes[ "html_url" ], ( str, unicode ) ), attributes[ "html_url" ] - self._html_url = attributes[ "html_url" ] - if "id" in attributes: # pragma no branch - assert attributes[ "id" ] is None or isinstance( attributes[ "id" ], int ), attributes[ "id" ] - self._id = attributes[ "id" ] - if "location" in attributes: # pragma no branch - assert attributes[ "location" ] is None or isinstance( attributes[ "location" ], ( str, unicode ) ), attributes[ "location" ] - self._location = attributes[ "location" ] - if "login" in attributes: # pragma no branch - assert attributes[ "login" ] is None or isinstance( attributes[ "login" ], ( str, unicode ) ), attributes[ "login" ] - self._login = attributes[ "login" ] - if "name" in attributes: # pragma no branch - assert attributes[ "name" ] is None or isinstance( attributes[ "name" ], ( str, unicode ) ), attributes[ "name" ] - self._name = attributes[ "name" ] - if "owned_private_repos" in attributes: # pragma no branch - assert attributes[ "owned_private_repos" ] is None or isinstance( attributes[ "owned_private_repos" ], int ), attributes[ "owned_private_repos" ] - self._owned_private_repos = attributes[ "owned_private_repos" ] - if "plan" in attributes: # pragma no branch - assert attributes[ "plan" ] is None or isinstance( attributes[ "plan" ], dict ), attributes[ "plan" ] - self._plan = None if attributes[ "plan" ] is None else Plan.Plan( self._requester, attributes[ "plan" ], completed = False ) - if "private_gists" in attributes: # pragma no branch - assert attributes[ "private_gists" ] is None or isinstance( attributes[ "private_gists" ], int ), attributes[ "private_gists" ] - self._private_gists = attributes[ "private_gists" ] - if "public_gists" in attributes: # pragma no branch - assert attributes[ "public_gists" ] is None or isinstance( attributes[ "public_gists" ], int ), attributes[ "public_gists" ] - self._public_gists = attributes[ "public_gists" ] - if "public_repos" in attributes: # pragma no branch - assert attributes[ "public_repos" ] is None or isinstance( attributes[ "public_repos" ], int ), attributes[ "public_repos" ] - self._public_repos = attributes[ "public_repos" ] - if "total_private_repos" in attributes: # pragma no branch - assert attributes[ "total_private_repos" ] is None or isinstance( attributes[ "total_private_repos" ], int ), attributes[ "total_private_repos" ] - self._total_private_repos = attributes[ "total_private_repos" ] - if "type" in attributes: # pragma no branch - assert attributes[ "type" ] is None or isinstance( attributes[ "type" ], ( str, unicode ) ), attributes[ "type" ] - self._type = attributes[ "type" ] - if "url" in attributes: # pragma no branch - assert attributes[ "url" ] is None or isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ] - self._url = attributes[ "url" ] + def _useAttributes(self, attributes): + if "avatar_url" in attributes: # pragma no branch + assert attributes["avatar_url"] is None or isinstance(attributes["avatar_url"], (str, unicode)), attributes["avatar_url"] + self._avatar_url = attributes["avatar_url"] + if "bio" in attributes: # pragma no branch + assert attributes["bio"] is None or isinstance(attributes["bio"], (str, unicode)), attributes["bio"] + self._bio = attributes["bio"] + if "blog" in attributes: # pragma no branch + assert attributes["blog"] is None or isinstance(attributes["blog"], (str, unicode)), attributes["blog"] + self._blog = attributes["blog"] + if "collaborators" in attributes: # pragma no branch + assert attributes["collaborators"] is None or isinstance(attributes["collaborators"], int), attributes["collaborators"] + self._collaborators = attributes["collaborators"] + if "company" in attributes: # pragma no branch + assert attributes["company"] is None or isinstance(attributes["company"], (str, unicode)), attributes["company"] + self._company = attributes["company"] + if "contributions" in attributes: # pragma no branch + assert attributes["contributions"] is None or isinstance(attributes["contributions"], int), attributes["contributions"] + self._contributions = attributes["contributions"] + if "created_at" in attributes: # pragma no branch + assert attributes["created_at"] is None or isinstance(attributes["created_at"], (str, unicode)), attributes["created_at"] + self._created_at = self._parseDatetime(attributes["created_at"]) + if "disk_usage" in attributes: # pragma no branch + assert attributes["disk_usage"] is None or isinstance(attributes["disk_usage"], int), attributes["disk_usage"] + self._disk_usage = attributes["disk_usage"] + if "email" in attributes: # pragma no branch + assert attributes["email"] is None or isinstance(attributes["email"], (str, unicode)), attributes["email"] + self._email = attributes["email"] + if "followers" in attributes: # pragma no branch + assert attributes["followers"] is None or isinstance(attributes["followers"], int), attributes["followers"] + self._followers = attributes["followers"] + if "following" in attributes: # pragma no branch + assert attributes["following"] is None or isinstance(attributes["following"], int), attributes["following"] + self._following = attributes["following"] + if "gravatar_id" in attributes: # pragma no branch + assert attributes["gravatar_id"] is None or isinstance(attributes["gravatar_id"], (str, unicode)), attributes["gravatar_id"] + self._gravatar_id = attributes["gravatar_id"] + if "hireable" in attributes: # pragma no branch + assert attributes["hireable"] is None or isinstance(attributes["hireable"], bool), attributes["hireable"] + self._hireable = attributes["hireable"] + if "html_url" in attributes: # pragma no branch + assert attributes["html_url"] is None or isinstance(attributes["html_url"], (str, unicode)), attributes["html_url"] + self._html_url = attributes["html_url"] + if "id" in attributes: # pragma no branch + assert attributes["id"] is None or isinstance(attributes["id"], int), attributes["id"] + self._id = attributes["id"] + if "location" in attributes: # pragma no branch + assert attributes["location"] is None or isinstance(attributes["location"], (str, unicode)), attributes["location"] + self._location = attributes["location"] + if "login" in attributes: # pragma no branch + assert attributes["login"] is None or isinstance(attributes["login"], (str, unicode)), attributes["login"] + self._login = attributes["login"] + if "name" in attributes: # pragma no branch + assert attributes["name"] is None or isinstance(attributes["name"], (str, unicode)), attributes["name"] + self._name = attributes["name"] + if "owned_private_repos" in attributes: # pragma no branch + assert attributes["owned_private_repos"] is None or isinstance(attributes["owned_private_repos"], int), attributes["owned_private_repos"] + self._owned_private_repos = attributes["owned_private_repos"] + if "plan" in attributes: # pragma no branch + assert attributes["plan"] is None or isinstance(attributes["plan"], dict), attributes["plan"] + self._plan = None if attributes["plan"] is None else Plan.Plan(self._requester, attributes["plan"], completed=False) + if "private_gists" in attributes: # pragma no branch + assert attributes["private_gists"] is None or isinstance(attributes["private_gists"], int), attributes["private_gists"] + self._private_gists = attributes["private_gists"] + if "public_gists" in attributes: # pragma no branch + assert attributes["public_gists"] is None or isinstance(attributes["public_gists"], int), attributes["public_gists"] + self._public_gists = attributes["public_gists"] + if "public_repos" in attributes: # pragma no branch + assert attributes["public_repos"] is None or isinstance(attributes["public_repos"], int), attributes["public_repos"] + self._public_repos = attributes["public_repos"] + if "total_private_repos" in attributes: # pragma no branch + assert attributes["total_private_repos"] is None or isinstance(attributes["total_private_repos"], int), attributes["total_private_repos"] + self._total_private_repos = attributes["total_private_repos"] + if "type" in attributes: # pragma no branch + assert attributes["type"] is None or isinstance(attributes["type"], (str, unicode)), attributes["type"] + self._type = attributes["type"] + if "url" in attributes: # pragma no branch + assert attributes["url"] is None or isinstance(attributes["url"], (str, unicode)), attributes["url"] + self._url = attributes["url"] diff --git a/github/Organization.py b/github/Organization.py index 896d99cf..90cd93e5 100644 --- a/github/Organization.py +++ b/github/Organization.py @@ -20,129 +20,130 @@ import Event import Repository import NamedUser -class Organization( GithubObject.GithubObject ): + +class Organization(GithubObject.GithubObject): @property - def avatar_url( self ): - self._completeIfNotSet( self._avatar_url ) - return self._NoneIfNotSet( self._avatar_url ) + def avatar_url(self): + self._completeIfNotSet(self._avatar_url) + return self._NoneIfNotSet(self._avatar_url) @property - def billing_email( self ): - self._completeIfNotSet( self._billing_email ) - return self._NoneIfNotSet( self._billing_email ) + def billing_email(self): + self._completeIfNotSet(self._billing_email) + return self._NoneIfNotSet(self._billing_email) @property - def blog( self ): - self._completeIfNotSet( self._blog ) - return self._NoneIfNotSet( self._blog ) + def blog(self): + self._completeIfNotSet(self._blog) + return self._NoneIfNotSet(self._blog) @property - def collaborators( self ): - self._completeIfNotSet( self._collaborators ) - return self._NoneIfNotSet( self._collaborators ) + def collaborators(self): + self._completeIfNotSet(self._collaborators) + return self._NoneIfNotSet(self._collaborators) @property - def company( self ): - self._completeIfNotSet( self._company ) - return self._NoneIfNotSet( self._company ) + def company(self): + self._completeIfNotSet(self._company) + return self._NoneIfNotSet(self._company) @property - def created_at( self ): - self._completeIfNotSet( self._created_at ) - return self._NoneIfNotSet( self._created_at ) + def created_at(self): + self._completeIfNotSet(self._created_at) + return self._NoneIfNotSet(self._created_at) @property - def disk_usage( self ): - self._completeIfNotSet( self._disk_usage ) - return self._NoneIfNotSet( self._disk_usage ) + def disk_usage(self): + self._completeIfNotSet(self._disk_usage) + return self._NoneIfNotSet(self._disk_usage) @property - def email( self ): - self._completeIfNotSet( self._email ) - return self._NoneIfNotSet( self._email ) + def email(self): + self._completeIfNotSet(self._email) + return self._NoneIfNotSet(self._email) @property - def followers( self ): - self._completeIfNotSet( self._followers ) - return self._NoneIfNotSet( self._followers ) + def followers(self): + self._completeIfNotSet(self._followers) + return self._NoneIfNotSet(self._followers) @property - def following( self ): - self._completeIfNotSet( self._following ) - return self._NoneIfNotSet( self._following ) + def following(self): + self._completeIfNotSet(self._following) + return self._NoneIfNotSet(self._following) @property - def gravatar_id( self ): - self._completeIfNotSet( self._gravatar_id ) - return self._NoneIfNotSet( self._gravatar_id ) + def gravatar_id(self): + self._completeIfNotSet(self._gravatar_id) + return self._NoneIfNotSet(self._gravatar_id) @property - def html_url( self ): - self._completeIfNotSet( self._html_url ) - return self._NoneIfNotSet( self._html_url ) + def html_url(self): + self._completeIfNotSet(self._html_url) + return self._NoneIfNotSet(self._html_url) @property - def id( self ): - self._completeIfNotSet( self._id ) - return self._NoneIfNotSet( self._id ) + def id(self): + self._completeIfNotSet(self._id) + return self._NoneIfNotSet(self._id) @property - def location( self ): - self._completeIfNotSet( self._location ) - return self._NoneIfNotSet( self._location ) + def location(self): + self._completeIfNotSet(self._location) + return self._NoneIfNotSet(self._location) @property - def login( self ): - self._completeIfNotSet( self._login ) - return self._NoneIfNotSet( self._login ) + def login(self): + self._completeIfNotSet(self._login) + return self._NoneIfNotSet(self._login) @property - def name( self ): - self._completeIfNotSet( self._name ) - return self._NoneIfNotSet( self._name ) + def name(self): + self._completeIfNotSet(self._name) + return self._NoneIfNotSet(self._name) @property - def owned_private_repos( self ): - self._completeIfNotSet( self._owned_private_repos ) - return self._NoneIfNotSet( self._owned_private_repos ) + def owned_private_repos(self): + self._completeIfNotSet(self._owned_private_repos) + return self._NoneIfNotSet(self._owned_private_repos) @property - def plan( self ): - self._completeIfNotSet( self._plan ) - return self._NoneIfNotSet( self._plan ) + def plan(self): + self._completeIfNotSet(self._plan) + return self._NoneIfNotSet(self._plan) @property - def private_gists( self ): - self._completeIfNotSet( self._private_gists ) - return self._NoneIfNotSet( self._private_gists ) + def private_gists(self): + self._completeIfNotSet(self._private_gists) + return self._NoneIfNotSet(self._private_gists) @property - def public_gists( self ): - self._completeIfNotSet( self._public_gists ) - return self._NoneIfNotSet( self._public_gists ) + def public_gists(self): + self._completeIfNotSet(self._public_gists) + return self._NoneIfNotSet(self._public_gists) @property - def public_repos( self ): - self._completeIfNotSet( self._public_repos ) - return self._NoneIfNotSet( self._public_repos ) + def public_repos(self): + self._completeIfNotSet(self._public_repos) + return self._NoneIfNotSet(self._public_repos) @property - def total_private_repos( self ): - self._completeIfNotSet( self._total_private_repos ) - return self._NoneIfNotSet( self._total_private_repos ) + def total_private_repos(self): + self._completeIfNotSet(self._total_private_repos) + return self._NoneIfNotSet(self._total_private_repos) @property - def type( self ): - self._completeIfNotSet( self._type ) - return self._NoneIfNotSet( self._type ) + def type(self): + self._completeIfNotSet(self._type) + return self._NoneIfNotSet(self._type) @property - def url( self ): - self._completeIfNotSet( self._url ) - return self._NoneIfNotSet( self._url ) + def url(self): + self._completeIfNotSet(self._url) + return self._NoneIfNotSet(self._url) - def add_to_public_members( self, public_member ): - assert isinstance( public_member, NamedUser.NamedUser ), public_member + def add_to_public_members(self, public_member): + assert isinstance(public_member, NamedUser.NamedUser), public_member headers, data = self._requester.requestAndCheck( "PUT", self.url + "/public_members/" + public_member._identity, @@ -150,8 +151,8 @@ class Organization( GithubObject.GithubObject ): None ) - def create_fork( self, repo ): - assert isinstance( repo, Repository.Repository ), repo + def create_fork(self, repo): + assert isinstance(repo, Repository.Repository), repo url_parameters = { "org": self.login, } @@ -161,90 +162,90 @@ class Organization( GithubObject.GithubObject ): url_parameters, None ) - return Repository.Repository( self._requester, data, completed = True ) + return Repository.Repository(self._requester, data, completed=True) - def create_repo( self, name, description = GithubObject.NotSet, homepage = GithubObject.NotSet, private = GithubObject.NotSet, has_issues = GithubObject.NotSet, has_wiki = GithubObject.NotSet, has_downloads = GithubObject.NotSet, team_id = GithubObject.NotSet ): - assert isinstance( name, ( str, unicode ) ), name - assert description is GithubObject.NotSet or isinstance( description, ( str, unicode ) ), description - assert homepage is GithubObject.NotSet or isinstance( homepage, ( str, unicode ) ), homepage - assert private is GithubObject.NotSet or isinstance( private, bool ), private - assert has_issues is GithubObject.NotSet or isinstance( has_issues, bool ), has_issues - assert has_wiki is GithubObject.NotSet or isinstance( has_wiki, bool ), has_wiki - assert has_downloads is GithubObject.NotSet or isinstance( has_downloads, bool ), has_downloads - assert team_id is GithubObject.NotSet or isinstance( team_id, Team.Team ), team_id + def create_repo(self, name, description=GithubObject.NotSet, homepage=GithubObject.NotSet, private=GithubObject.NotSet, has_issues=GithubObject.NotSet, has_wiki=GithubObject.NotSet, has_downloads=GithubObject.NotSet, team_id=GithubObject.NotSet): + assert isinstance(name, (str, unicode)), name + assert description is GithubObject.NotSet or isinstance(description, (str, unicode)), description + assert homepage is GithubObject.NotSet or isinstance(homepage, (str, unicode)), homepage + assert private is GithubObject.NotSet or isinstance(private, bool), private + assert has_issues is GithubObject.NotSet or isinstance(has_issues, bool), has_issues + assert has_wiki is GithubObject.NotSet or isinstance(has_wiki, bool), has_wiki + assert has_downloads is GithubObject.NotSet or isinstance(has_downloads, bool), has_downloads + assert team_id is GithubObject.NotSet or isinstance(team_id, Team.Team), team_id post_parameters = { "name": name, } if description is not GithubObject.NotSet: - post_parameters[ "description" ] = description + post_parameters["description"] = description if homepage is not GithubObject.NotSet: - post_parameters[ "homepage" ] = homepage + post_parameters["homepage"] = homepage if private is not GithubObject.NotSet: - post_parameters[ "private" ] = private + post_parameters["private"] = private if has_issues is not GithubObject.NotSet: - post_parameters[ "has_issues" ] = has_issues + post_parameters["has_issues"] = has_issues if has_wiki is not GithubObject.NotSet: - post_parameters[ "has_wiki" ] = has_wiki + post_parameters["has_wiki"] = has_wiki if has_downloads is not GithubObject.NotSet: - post_parameters[ "has_downloads" ] = has_downloads + post_parameters["has_downloads"] = has_downloads if team_id is not GithubObject.NotSet: - post_parameters[ "team_id" ] = team_id._identity + post_parameters["team_id"] = team_id._identity headers, data = self._requester.requestAndCheck( "POST", self.url + "/repos", None, post_parameters ) - return Repository.Repository( self._requester, data, completed = True ) + return Repository.Repository(self._requester, data, completed=True) - def create_team( self, name, repo_names = GithubObject.NotSet, permission = GithubObject.NotSet ): - assert isinstance( name, ( str, unicode ) ), name - assert repo_names is GithubObject.NotSet or all( isinstance( element, Repository.Repository ) for element in repo_names ), repo_names - assert permission is GithubObject.NotSet or isinstance( permission, ( str, unicode ) ), permission + def create_team(self, name, repo_names=GithubObject.NotSet, permission=GithubObject.NotSet): + assert isinstance(name, (str, unicode)), name + assert repo_names is GithubObject.NotSet or all(isinstance(element, Repository.Repository) for element in repo_names), repo_names + assert permission is GithubObject.NotSet or isinstance(permission, (str, unicode)), permission post_parameters = { "name": name, } if repo_names is not GithubObject.NotSet: - post_parameters[ "repo_names" ] = [ element._identity for element in repo_names ] + post_parameters["repo_names"] = [element._identity for element in repo_names] if permission is not GithubObject.NotSet: - post_parameters[ "permission" ] = permission + post_parameters["permission"] = permission headers, data = self._requester.requestAndCheck( "POST", self.url + "/teams", None, post_parameters ) - return Team.Team( self._requester, data, completed = True ) + return Team.Team(self._requester, data, completed=True) - def edit( self, billing_email = GithubObject.NotSet, blog = GithubObject.NotSet, company = GithubObject.NotSet, email = GithubObject.NotSet, location = GithubObject.NotSet, name = GithubObject.NotSet ): - assert billing_email is GithubObject.NotSet or isinstance( billing_email, ( str, unicode ) ), billing_email - assert blog is GithubObject.NotSet or isinstance( blog, ( str, unicode ) ), blog - assert company is GithubObject.NotSet or isinstance( company, ( str, unicode ) ), company - assert email is GithubObject.NotSet or isinstance( email, ( str, unicode ) ), email - assert location is GithubObject.NotSet or isinstance( location, ( str, unicode ) ), location - assert name is GithubObject.NotSet or isinstance( name, ( str, unicode ) ), name + def edit(self, billing_email=GithubObject.NotSet, blog=GithubObject.NotSet, company=GithubObject.NotSet, email=GithubObject.NotSet, location=GithubObject.NotSet, name=GithubObject.NotSet): + assert billing_email is GithubObject.NotSet or isinstance(billing_email, (str, unicode)), billing_email + assert blog is GithubObject.NotSet or isinstance(blog, (str, unicode)), blog + assert company is GithubObject.NotSet or isinstance(company, (str, unicode)), company + assert email is GithubObject.NotSet or isinstance(email, (str, unicode)), email + assert location is GithubObject.NotSet or isinstance(location, (str, unicode)), location + assert name is GithubObject.NotSet or isinstance(name, (str, unicode)), name post_parameters = dict() if billing_email is not GithubObject.NotSet: - post_parameters[ "billing_email" ] = billing_email + post_parameters["billing_email"] = billing_email if blog is not GithubObject.NotSet: - post_parameters[ "blog" ] = blog + post_parameters["blog"] = blog if company is not GithubObject.NotSet: - post_parameters[ "company" ] = company + post_parameters["company"] = company if email is not GithubObject.NotSet: - post_parameters[ "email" ] = email + post_parameters["email"] = email if location is not GithubObject.NotSet: - post_parameters[ "location" ] = location + post_parameters["location"] = location if name is not GithubObject.NotSet: - post_parameters[ "name" ] = name + post_parameters["name"] = name headers, data = self._requester.requestAndCheck( "PATCH", self.url, None, post_parameters ) - self._useAttributes( data ) + self._useAttributes(data) - def get_events( self ): + def get_events(self): return PaginatedList.PaginatedList( Event.Event, self._requester, @@ -252,7 +253,7 @@ class Organization( GithubObject.GithubObject ): None ) - def get_members( self ): + def get_members(self): return PaginatedList.PaginatedList( NamedUser.NamedUser, self._requester, @@ -260,7 +261,7 @@ class Organization( GithubObject.GithubObject ): None ) - def get_public_members( self ): + def get_public_members(self): return PaginatedList.PaginatedList( NamedUser.NamedUser, self._requester, @@ -268,21 +269,21 @@ class Organization( GithubObject.GithubObject ): None ) - def get_repo( self, name ): - assert isinstance( name, ( str, unicode ) ), name + def get_repo(self, name): + assert isinstance(name, (str, unicode)), name headers, data = self._requester.requestAndCheck( "GET", "/repos/" + self.login + "/" + name, None, None ) - return Repository.Repository( self._requester, data, completed = True ) + return Repository.Repository(self._requester, data, completed=True) - def get_repos( self, type = GithubObject.NotSet ): - assert type is GithubObject.NotSet or isinstance( type, ( str, unicode ) ), type + def get_repos(self, type=GithubObject.NotSet): + assert type is GithubObject.NotSet or isinstance(type, (str, unicode)), type url_parameters = dict() if type is not GithubObject.NotSet: - url_parameters[ "type" ] = type + url_parameters["type"] = type return PaginatedList.PaginatedList( Repository.Repository, self._requester, @@ -290,17 +291,17 @@ class Organization( GithubObject.GithubObject ): url_parameters ) - def get_team( self, id ): - assert isinstance( id, int ), id + def get_team(self, id): + assert isinstance(id, int), id headers, data = self._requester.requestAndCheck( "GET", - "/teams/" + str( id ), + "/teams/" + str(id), None, None ) - return Team.Team( self._requester, data, completed = True ) + return Team.Team(self._requester, data, completed=True) - def get_teams( self ): + def get_teams(self): return PaginatedList.PaginatedList( Team.Team, self._requester, @@ -308,8 +309,8 @@ class Organization( GithubObject.GithubObject ): None ) - def has_in_members( self, member ): - assert isinstance( member, NamedUser.NamedUser ), member + def has_in_members(self, member): + assert isinstance(member, NamedUser.NamedUser), member status, headers, data = self._requester.requestRaw( "GET", self.url + "/members/" + member._identity, @@ -318,8 +319,8 @@ class Organization( GithubObject.GithubObject ): ) return status == 204 - def has_in_public_members( self, public_member ): - assert isinstance( public_member, NamedUser.NamedUser ), public_member + def has_in_public_members(self, public_member): + assert isinstance(public_member, NamedUser.NamedUser), public_member status, headers, data = self._requester.requestRaw( "GET", self.url + "/public_members/" + public_member._identity, @@ -328,8 +329,8 @@ class Organization( GithubObject.GithubObject ): ) return status == 204 - def remove_from_members( self, member ): - assert isinstance( member, NamedUser.NamedUser ), member + def remove_from_members(self, member): + assert isinstance(member, NamedUser.NamedUser), member headers, data = self._requester.requestAndCheck( "DELETE", self.url + "/members/" + member._identity, @@ -337,8 +338,8 @@ class Organization( GithubObject.GithubObject ): None ) - def remove_from_public_members( self, public_member ): - assert isinstance( public_member, NamedUser.NamedUser ), public_member + def remove_from_public_members(self, public_member): + assert isinstance(public_member, NamedUser.NamedUser), public_member headers, data = self._requester.requestAndCheck( "DELETE", self.url + "/public_members/" + public_member._identity, @@ -346,7 +347,7 @@ class Organization( GithubObject.GithubObject ): None ) - def _initAttributes( self ): + def _initAttributes(self): self._avatar_url = GithubObject.NotSet self._billing_email = GithubObject.NotSet self._blog = GithubObject.NotSet @@ -372,76 +373,76 @@ class Organization( GithubObject.GithubObject ): self._type = GithubObject.NotSet self._url = GithubObject.NotSet - def _useAttributes( self, attributes ): - if "avatar_url" in attributes: # pragma no branch - assert attributes[ "avatar_url" ] is None or isinstance( attributes[ "avatar_url" ], ( str, unicode ) ), attributes[ "avatar_url" ] - self._avatar_url = attributes[ "avatar_url" ] - if "billing_email" in attributes: # pragma no branch - assert attributes[ "billing_email" ] is None or isinstance( attributes[ "billing_email" ], ( str, unicode ) ), attributes[ "billing_email" ] - self._billing_email = attributes[ "billing_email" ] - if "blog" in attributes: # pragma no branch - assert attributes[ "blog" ] is None or isinstance( attributes[ "blog" ], ( str, unicode ) ), attributes[ "blog" ] - self._blog = attributes[ "blog" ] - if "collaborators" in attributes: # pragma no branch - assert attributes[ "collaborators" ] is None or isinstance( attributes[ "collaborators" ], int ), attributes[ "collaborators" ] - self._collaborators = attributes[ "collaborators" ] - if "company" in attributes: # pragma no branch - assert attributes[ "company" ] is None or isinstance( attributes[ "company" ], ( str, unicode ) ), attributes[ "company" ] - self._company = attributes[ "company" ] - if "created_at" in attributes: # pragma no branch - assert attributes[ "created_at" ] is None or isinstance( attributes[ "created_at" ], ( str, unicode ) ), attributes[ "created_at" ] - self._created_at = self._parseDatetime( attributes[ "created_at" ] ) - if "disk_usage" in attributes: # pragma no branch - assert attributes[ "disk_usage" ] is None or isinstance( attributes[ "disk_usage" ], int ), attributes[ "disk_usage" ] - self._disk_usage = attributes[ "disk_usage" ] - if "email" in attributes: # pragma no branch - assert attributes[ "email" ] is None or isinstance( attributes[ "email" ], ( str, unicode ) ), attributes[ "email" ] - self._email = attributes[ "email" ] - if "followers" in attributes: # pragma no branch - assert attributes[ "followers" ] is None or isinstance( attributes[ "followers" ], int ), attributes[ "followers" ] - self._followers = attributes[ "followers" ] - if "following" in attributes: # pragma no branch - assert attributes[ "following" ] is None or isinstance( attributes[ "following" ], int ), attributes[ "following" ] - self._following = attributes[ "following" ] - if "gravatar_id" in attributes: # pragma no branch - assert attributes[ "gravatar_id" ] is None or isinstance( attributes[ "gravatar_id" ], ( str, unicode ) ), attributes[ "gravatar_id" ] - self._gravatar_id = attributes[ "gravatar_id" ] - if "html_url" in attributes: # pragma no branch - assert attributes[ "html_url" ] is None or isinstance( attributes[ "html_url" ], ( str, unicode ) ), attributes[ "html_url" ] - self._html_url = attributes[ "html_url" ] - if "id" in attributes: # pragma no branch - assert attributes[ "id" ] is None or isinstance( attributes[ "id" ], int ), attributes[ "id" ] - self._id = attributes[ "id" ] - if "location" in attributes: # pragma no branch - assert attributes[ "location" ] is None or isinstance( attributes[ "location" ], ( str, unicode ) ), attributes[ "location" ] - self._location = attributes[ "location" ] - if "login" in attributes: # pragma no branch - assert attributes[ "login" ] is None or isinstance( attributes[ "login" ], ( str, unicode ) ), attributes[ "login" ] - self._login = attributes[ "login" ] - if "name" in attributes: # pragma no branch - assert attributes[ "name" ] is None or isinstance( attributes[ "name" ], ( str, unicode ) ), attributes[ "name" ] - self._name = attributes[ "name" ] - if "owned_private_repos" in attributes: # pragma no branch - assert attributes[ "owned_private_repos" ] is None or isinstance( attributes[ "owned_private_repos" ], int ), attributes[ "owned_private_repos" ] - self._owned_private_repos = attributes[ "owned_private_repos" ] - if "plan" in attributes: # pragma no branch - assert attributes[ "plan" ] is None or isinstance( attributes[ "plan" ], dict ), attributes[ "plan" ] - self._plan = None if attributes[ "plan" ] is None else Plan.Plan( self._requester, attributes[ "plan" ], completed = False ) - if "private_gists" in attributes: # pragma no branch - assert attributes[ "private_gists" ] is None or isinstance( attributes[ "private_gists" ], int ), attributes[ "private_gists" ] - self._private_gists = attributes[ "private_gists" ] - if "public_gists" in attributes: # pragma no branch - assert attributes[ "public_gists" ] is None or isinstance( attributes[ "public_gists" ], int ), attributes[ "public_gists" ] - self._public_gists = attributes[ "public_gists" ] - if "public_repos" in attributes: # pragma no branch - assert attributes[ "public_repos" ] is None or isinstance( attributes[ "public_repos" ], int ), attributes[ "public_repos" ] - self._public_repos = attributes[ "public_repos" ] - if "total_private_repos" in attributes: # pragma no branch - assert attributes[ "total_private_repos" ] is None or isinstance( attributes[ "total_private_repos" ], int ), attributes[ "total_private_repos" ] - self._total_private_repos = attributes[ "total_private_repos" ] - if "type" in attributes: # pragma no branch - assert attributes[ "type" ] is None or isinstance( attributes[ "type" ], ( str, unicode ) ), attributes[ "type" ] - self._type = attributes[ "type" ] - if "url" in attributes: # pragma no branch - assert attributes[ "url" ] is None or isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ] - self._url = attributes[ "url" ] + def _useAttributes(self, attributes): + if "avatar_url" in attributes: # pragma no branch + assert attributes["avatar_url"] is None or isinstance(attributes["avatar_url"], (str, unicode)), attributes["avatar_url"] + self._avatar_url = attributes["avatar_url"] + if "billing_email" in attributes: # pragma no branch + assert attributes["billing_email"] is None or isinstance(attributes["billing_email"], (str, unicode)), attributes["billing_email"] + self._billing_email = attributes["billing_email"] + if "blog" in attributes: # pragma no branch + assert attributes["blog"] is None or isinstance(attributes["blog"], (str, unicode)), attributes["blog"] + self._blog = attributes["blog"] + if "collaborators" in attributes: # pragma no branch + assert attributes["collaborators"] is None or isinstance(attributes["collaborators"], int), attributes["collaborators"] + self._collaborators = attributes["collaborators"] + if "company" in attributes: # pragma no branch + assert attributes["company"] is None or isinstance(attributes["company"], (str, unicode)), attributes["company"] + self._company = attributes["company"] + if "created_at" in attributes: # pragma no branch + assert attributes["created_at"] is None or isinstance(attributes["created_at"], (str, unicode)), attributes["created_at"] + self._created_at = self._parseDatetime(attributes["created_at"]) + if "disk_usage" in attributes: # pragma no branch + assert attributes["disk_usage"] is None or isinstance(attributes["disk_usage"], int), attributes["disk_usage"] + self._disk_usage = attributes["disk_usage"] + if "email" in attributes: # pragma no branch + assert attributes["email"] is None or isinstance(attributes["email"], (str, unicode)), attributes["email"] + self._email = attributes["email"] + if "followers" in attributes: # pragma no branch + assert attributes["followers"] is None or isinstance(attributes["followers"], int), attributes["followers"] + self._followers = attributes["followers"] + if "following" in attributes: # pragma no branch + assert attributes["following"] is None or isinstance(attributes["following"], int), attributes["following"] + self._following = attributes["following"] + if "gravatar_id" in attributes: # pragma no branch + assert attributes["gravatar_id"] is None or isinstance(attributes["gravatar_id"], (str, unicode)), attributes["gravatar_id"] + self._gravatar_id = attributes["gravatar_id"] + if "html_url" in attributes: # pragma no branch + assert attributes["html_url"] is None or isinstance(attributes["html_url"], (str, unicode)), attributes["html_url"] + self._html_url = attributes["html_url"] + if "id" in attributes: # pragma no branch + assert attributes["id"] is None or isinstance(attributes["id"], int), attributes["id"] + self._id = attributes["id"] + if "location" in attributes: # pragma no branch + assert attributes["location"] is None or isinstance(attributes["location"], (str, unicode)), attributes["location"] + self._location = attributes["location"] + if "login" in attributes: # pragma no branch + assert attributes["login"] is None or isinstance(attributes["login"], (str, unicode)), attributes["login"] + self._login = attributes["login"] + if "name" in attributes: # pragma no branch + assert attributes["name"] is None or isinstance(attributes["name"], (str, unicode)), attributes["name"] + self._name = attributes["name"] + if "owned_private_repos" in attributes: # pragma no branch + assert attributes["owned_private_repos"] is None or isinstance(attributes["owned_private_repos"], int), attributes["owned_private_repos"] + self._owned_private_repos = attributes["owned_private_repos"] + if "plan" in attributes: # pragma no branch + assert attributes["plan"] is None or isinstance(attributes["plan"], dict), attributes["plan"] + self._plan = None if attributes["plan"] is None else Plan.Plan(self._requester, attributes["plan"], completed=False) + if "private_gists" in attributes: # pragma no branch + assert attributes["private_gists"] is None or isinstance(attributes["private_gists"], int), attributes["private_gists"] + self._private_gists = attributes["private_gists"] + if "public_gists" in attributes: # pragma no branch + assert attributes["public_gists"] is None or isinstance(attributes["public_gists"], int), attributes["public_gists"] + self._public_gists = attributes["public_gists"] + if "public_repos" in attributes: # pragma no branch + assert attributes["public_repos"] is None or isinstance(attributes["public_repos"], int), attributes["public_repos"] + self._public_repos = attributes["public_repos"] + if "total_private_repos" in attributes: # pragma no branch + assert attributes["total_private_repos"] is None or isinstance(attributes["total_private_repos"], int), attributes["total_private_repos"] + self._total_private_repos = attributes["total_private_repos"] + if "type" in attributes: # pragma no branch + assert attributes["type"] is None or isinstance(attributes["type"], (str, unicode)), attributes["type"] + self._type = attributes["type"] + if "url" in attributes: # pragma no branch + assert attributes["url"] is None or isinstance(attributes["url"], (str, unicode)), attributes["url"] + self._url = attributes["url"] diff --git a/github/PaginatedList.py b/github/PaginatedList.py index f04d1540..24a14b8a 100644 --- a/github/PaginatedList.py +++ b/github/PaginatedList.py @@ -13,19 +13,20 @@ import GithubObject + class PaginatedListBase: - def __init__( self ): + def __init__(self): self.__elements = list() - def __getitem__( self, index ): - assert isinstance( index, ( int, slice ) ) - if isinstance( index, int ): - self.__fetchToIndex( index ) - return self.__elements[ index ] + def __getitem__(self, index): + assert isinstance(index, (int, slice)) + if isinstance(index, int): + self.__fetchToIndex(index) + return self.__elements[index] else: - return self._Slice( self, index ) + return self._Slice(self, index) - def __iter__( self ): + def __iter__(self): for element in self.__elements: yield element while self._couldGrow(): @@ -33,40 +34,41 @@ class PaginatedListBase: for element in newElements: yield element - def _isBiggerThan( self, index ): - return len( self.__elements ) > index or self._couldGrow() + def _isBiggerThan(self, index): + return len(self.__elements) > index or self._couldGrow() - def __fetchToIndex( self, index ): - while len( self.__elements ) <= index and self._couldGrow(): + def __fetchToIndex(self, index): + while len(self.__elements) <= index and self._couldGrow(): self.__grow() - def __grow( self ): + def __grow(self): newElements = self._fetchNextPage() self.__elements += newElements return newElements class _Slice: - def __init__( self, theList, theSlice ): + def __init__(self, theList, theSlice): self.__list = theList self.__start = theSlice.start or 0 self.__stop = theSlice.stop self.__step = theSlice.step or 1 - def __iter__( self ): + def __iter__(self): index = self.__start - while not self.__finished( index ) : - if self.__list._isBiggerThan( index ): - yield self.__list[ index ] + while not self.__finished(index): + if self.__list._isBiggerThan(index): + yield self.__list[index] index += self.__step else: return - def __finished( self, index ): + def __finished(self, index): return self.__stop is not None and index >= self.__stop -class PaginatedList( PaginatedListBase ): - def __init__( self, contentClass, requester, firstUrl, firstParams ): - PaginatedListBase.__init__( self ) + +class PaginatedList(PaginatedListBase): + def __init__(self, contentClass, requester, firstUrl, firstParams): + PaginatedListBase.__init__(self) self.__requester = requester self.__contentClass = contentClass self.__firstUrl = firstUrl @@ -74,42 +76,42 @@ class PaginatedList( PaginatedListBase ): self.__nextUrl = firstUrl self.__nextParams = firstParams - def _couldGrow( self ): + def _couldGrow(self): return self.__nextUrl is not None - def _fetchNextPage( self ): - headers, data = self.__requester.requestAndCheck( "GET", self.__nextUrl, self.__nextParams, None ) + def _fetchNextPage(self): + headers, data = self.__requester.requestAndCheck("GET", self.__nextUrl, self.__nextParams, None) - links = self.__parseLinkHeader( headers ) - if len( data ) > 0 and "next" in links: - self.__nextUrl = links[ "next" ] + links = self.__parseLinkHeader(headers) + if len(data) > 0 and "next" in links: + self.__nextUrl = links["next"] else: self.__nextUrl = None self.__nextParams = None return [ - self.__contentClass( self.__requester, element, completed = False ) + self.__contentClass(self.__requester, element, completed=False) for element in data ] - def __parseLinkHeader( self, headers ): + def __parseLinkHeader(self, headers): links = {} if "link" in headers: - linkHeaders = headers[ "link" ].split( "," ) + linkHeaders = headers["link"].split(",") for linkHeader in linkHeaders: - ( url, rel ) = linkHeader.split( "; " ) - url = url[ 1 : -1 ] - rel = rel[ 5 : -1 ] - links[ rel ] = url + (url, rel) = linkHeader.split("; ") + url = url[1:-1] + rel = rel[5:-1] + links[rel] = url return links - def get_page( self, page ): - params = dict( self.__firstParams ) + def get_page(self, page): + params = dict(self.__firstParams) if page != 0: - params[ "page" ] = page + 1 - headers, data = self.__requester.requestAndCheck( "GET", self.__firstUrl, params, None ) + params["page"] = page + 1 + headers, data = self.__requester.requestAndCheck("GET", self.__firstUrl, params, None) return [ - self.__contentClass( self.__requester, element, completed = False ) + self.__contentClass(self.__requester, element, completed=False) for element in data ] diff --git a/github/Permissions.py b/github/Permissions.py index a0782c43..0c776469 100644 --- a/github/Permissions.py +++ b/github/Permissions.py @@ -13,31 +13,32 @@ import GithubObject -class Permissions( GithubObject.BasicGithubObject ): + +class Permissions(GithubObject.BasicGithubObject): @property - def admin( self ): - return self._NoneIfNotSet( self._admin ) + def admin(self): + return self._NoneIfNotSet(self._admin) @property - def pull( self ): - return self._NoneIfNotSet( self._pull ) + def pull(self): + return self._NoneIfNotSet(self._pull) @property - def push( self ): - return self._NoneIfNotSet( self._push ) + def push(self): + return self._NoneIfNotSet(self._push) - def _initAttributes( self ): + def _initAttributes(self): self._admin = GithubObject.NotSet self._pull = GithubObject.NotSet self._push = GithubObject.NotSet - def _useAttributes( self, attributes ): - if "admin" in attributes: # pragma no branch - assert attributes[ "admin" ] is None or isinstance( attributes[ "admin" ], bool ), attributes[ "admin" ] - self._admin = attributes[ "admin" ] - if "pull" in attributes: # pragma no branch - assert attributes[ "pull" ] is None or isinstance( attributes[ "pull" ], bool ), attributes[ "pull" ] - self._pull = attributes[ "pull" ] - if "push" in attributes: # pragma no branch - assert attributes[ "push" ] is None or isinstance( attributes[ "push" ], bool ), attributes[ "push" ] - self._push = attributes[ "push" ] + def _useAttributes(self, attributes): + if "admin" in attributes: # pragma no branch + assert attributes["admin"] is None or isinstance(attributes["admin"], bool), attributes["admin"] + self._admin = attributes["admin"] + if "pull" in attributes: # pragma no branch + assert attributes["pull"] is None or isinstance(attributes["pull"], bool), attributes["pull"] + self._pull = attributes["pull"] + if "push" in attributes: # pragma no branch + assert attributes["push"] is None or isinstance(attributes["push"], bool), attributes["push"] + self._push = attributes["push"] diff --git a/github/Plan.py b/github/Plan.py index 5eb0d435..76f801be 100644 --- a/github/Plan.py +++ b/github/Plan.py @@ -13,39 +13,40 @@ import GithubObject -class Plan( GithubObject.BasicGithubObject ): + +class Plan(GithubObject.BasicGithubObject): @property - def collaborators( self ): - return self._NoneIfNotSet( self._collaborators ) + def collaborators(self): + return self._NoneIfNotSet(self._collaborators) @property - def name( self ): - return self._NoneIfNotSet( self._name ) + def name(self): + return self._NoneIfNotSet(self._name) @property - def private_repos( self ): - return self._NoneIfNotSet( self._private_repos ) + def private_repos(self): + return self._NoneIfNotSet(self._private_repos) @property - def space( self ): - return self._NoneIfNotSet( self._space ) + def space(self): + return self._NoneIfNotSet(self._space) - def _initAttributes( self ): + def _initAttributes(self): self._collaborators = GithubObject.NotSet self._name = GithubObject.NotSet self._private_repos = GithubObject.NotSet self._space = GithubObject.NotSet - def _useAttributes( self, attributes ): - if "collaborators" in attributes: # pragma no branch - assert attributes[ "collaborators" ] is None or isinstance( attributes[ "collaborators" ], int ), attributes[ "collaborators" ] - self._collaborators = attributes[ "collaborators" ] - if "name" in attributes: # pragma no branch - assert attributes[ "name" ] is None or isinstance( attributes[ "name" ], ( str, unicode ) ), attributes[ "name" ] - self._name = attributes[ "name" ] - if "private_repos" in attributes: # pragma no branch - assert attributes[ "private_repos" ] is None or isinstance( attributes[ "private_repos" ], int ), attributes[ "private_repos" ] - self._private_repos = attributes[ "private_repos" ] - if "space" in attributes: # pragma no branch - assert attributes[ "space" ] is None or isinstance( attributes[ "space" ], int ), attributes[ "space" ] - self._space = attributes[ "space" ] + def _useAttributes(self, attributes): + if "collaborators" in attributes: # pragma no branch + assert attributes["collaborators"] is None or isinstance(attributes["collaborators"], int), attributes["collaborators"] + self._collaborators = attributes["collaborators"] + if "name" in attributes: # pragma no branch + assert attributes["name"] is None or isinstance(attributes["name"], (str, unicode)), attributes["name"] + self._name = attributes["name"] + if "private_repos" in attributes: # pragma no branch + assert attributes["private_repos"] is None or isinstance(attributes["private_repos"], int), attributes["private_repos"] + self._private_repos = attributes["private_repos"] + if "space" in attributes: # pragma no branch + assert attributes["space"] is None or isinstance(attributes["space"], int), attributes["space"] + self._space = attributes["space"] diff --git a/github/PullRequest.py b/github/PullRequest.py index 6fb604b5..a31b4a45 100644 --- a/github/PullRequest.py +++ b/github/PullRequest.py @@ -22,145 +22,146 @@ import File import IssueComment import Commit -class PullRequest( GithubObject.GithubObject ): + +class PullRequest(GithubObject.GithubObject): @property - def additions( self ): - self._completeIfNotSet( self._additions ) - return self._NoneIfNotSet( self._additions ) + def additions(self): + self._completeIfNotSet(self._additions) + return self._NoneIfNotSet(self._additions) @property - def base( self ): - self._completeIfNotSet( self._base ) - return self._NoneIfNotSet( self._base ) + def base(self): + self._completeIfNotSet(self._base) + return self._NoneIfNotSet(self._base) @property - def body( self ): - self._completeIfNotSet( self._body ) - return self._NoneIfNotSet( self._body ) + def body(self): + self._completeIfNotSet(self._body) + return self._NoneIfNotSet(self._body) @property - def changed_files( self ): - self._completeIfNotSet( self._changed_files ) - return self._NoneIfNotSet( self._changed_files ) + def changed_files(self): + self._completeIfNotSet(self._changed_files) + return self._NoneIfNotSet(self._changed_files) @property - def closed_at( self ): - self._completeIfNotSet( self._closed_at ) - return self._NoneIfNotSet( self._closed_at ) + def closed_at(self): + self._completeIfNotSet(self._closed_at) + return self._NoneIfNotSet(self._closed_at) @property - def comments( self ): - self._completeIfNotSet( self._comments ) - return self._NoneIfNotSet( self._comments ) + def comments(self): + self._completeIfNotSet(self._comments) + return self._NoneIfNotSet(self._comments) @property - def commits( self ): - self._completeIfNotSet( self._commits ) - return self._NoneIfNotSet( self._commits ) + def commits(self): + self._completeIfNotSet(self._commits) + return self._NoneIfNotSet(self._commits) @property - def created_at( self ): - self._completeIfNotSet( self._created_at ) - return self._NoneIfNotSet( self._created_at ) + def created_at(self): + self._completeIfNotSet(self._created_at) + return self._NoneIfNotSet(self._created_at) @property - def deletions( self ): - self._completeIfNotSet( self._deletions ) - return self._NoneIfNotSet( self._deletions ) + def deletions(self): + self._completeIfNotSet(self._deletions) + return self._NoneIfNotSet(self._deletions) @property - def diff_url( self ): - self._completeIfNotSet( self._diff_url ) - return self._NoneIfNotSet( self._diff_url ) + def diff_url(self): + self._completeIfNotSet(self._diff_url) + return self._NoneIfNotSet(self._diff_url) @property - def head( self ): - self._completeIfNotSet( self._head ) - return self._NoneIfNotSet( self._head ) + def head(self): + self._completeIfNotSet(self._head) + return self._NoneIfNotSet(self._head) @property - def html_url( self ): - self._completeIfNotSet( self._html_url ) - return self._NoneIfNotSet( self._html_url ) + def html_url(self): + self._completeIfNotSet(self._html_url) + return self._NoneIfNotSet(self._html_url) @property - def id( self ): - self._completeIfNotSet( self._id ) - return self._NoneIfNotSet( self._id ) + def id(self): + self._completeIfNotSet(self._id) + return self._NoneIfNotSet(self._id) @property - def issue_url( self ): - self._completeIfNotSet( self._issue_url ) - return self._NoneIfNotSet( self._issue_url ) + def issue_url(self): + self._completeIfNotSet(self._issue_url) + return self._NoneIfNotSet(self._issue_url) @property - def mergeable( self ): - self._completeIfNotSet( self._mergeable ) - return self._NoneIfNotSet( self._mergeable ) + def mergeable(self): + self._completeIfNotSet(self._mergeable) + return self._NoneIfNotSet(self._mergeable) @property - def merged( self ): - self._completeIfNotSet( self._merged ) - return self._NoneIfNotSet( self._merged ) + def merged(self): + self._completeIfNotSet(self._merged) + return self._NoneIfNotSet(self._merged) @property - def merged_at( self ): - self._completeIfNotSet( self._merged_at ) - return self._NoneIfNotSet( self._merged_at ) + def merged_at(self): + self._completeIfNotSet(self._merged_at) + return self._NoneIfNotSet(self._merged_at) @property - def merged_by( self ): - self._completeIfNotSet( self._merged_by ) - return self._NoneIfNotSet( self._merged_by ) + def merged_by(self): + self._completeIfNotSet(self._merged_by) + return self._NoneIfNotSet(self._merged_by) @property - def number( self ): - self._completeIfNotSet( self._number ) - return self._NoneIfNotSet( self._number ) + def number(self): + self._completeIfNotSet(self._number) + return self._NoneIfNotSet(self._number) @property - def patch_url( self ): - self._completeIfNotSet( self._patch_url ) - return self._NoneIfNotSet( self._patch_url ) + def patch_url(self): + self._completeIfNotSet(self._patch_url) + return self._NoneIfNotSet(self._patch_url) @property - def review_comments( self ): - self._completeIfNotSet( self._review_comments ) - return self._NoneIfNotSet( self._review_comments ) + def review_comments(self): + self._completeIfNotSet(self._review_comments) + return self._NoneIfNotSet(self._review_comments) @property - def state( self ): - self._completeIfNotSet( self._state ) - return self._NoneIfNotSet( self._state ) + def state(self): + self._completeIfNotSet(self._state) + return self._NoneIfNotSet(self._state) @property - def title( self ): - self._completeIfNotSet( self._title ) - return self._NoneIfNotSet( self._title ) + def title(self): + self._completeIfNotSet(self._title) + return self._NoneIfNotSet(self._title) @property - def updated_at( self ): - self._completeIfNotSet( self._updated_at ) - return self._NoneIfNotSet( self._updated_at ) + def updated_at(self): + self._completeIfNotSet(self._updated_at) + return self._NoneIfNotSet(self._updated_at) @property - def url( self ): - self._completeIfNotSet( self._url ) - return self._NoneIfNotSet( self._url ) + def url(self): + self._completeIfNotSet(self._url) + return self._NoneIfNotSet(self._url) @property - def user( self ): - self._completeIfNotSet( self._user ) - return self._NoneIfNotSet( self._user ) + def user(self): + self._completeIfNotSet(self._user) + return self._NoneIfNotSet(self._user) - def create_comment( self, body, commit_id, path, position ): - return self.create_review_comment( body, commit_id, path, position ) + def create_comment(self, body, commit_id, path, position): + return self.create_review_comment(body, commit_id, path, position) - def create_review_comment( self, body, commit_id, path, position ): - assert isinstance( body, ( str, unicode ) ), body - assert isinstance( commit_id, Commit.Commit ), commit_id - assert isinstance( path, ( str, unicode ) ), path - assert isinstance( position, int ), position + def create_review_comment(self, body, commit_id, path, position): + assert isinstance(body, (str, unicode)), body + assert isinstance(commit_id, Commit.Commit), commit_id + assert isinstance(path, (str, unicode)), path + assert isinstance(position, int), position post_parameters = { "body": body, "commit_id": commit_id._identity, @@ -173,57 +174,57 @@ class PullRequest( GithubObject.GithubObject ): None, post_parameters ) - return PullRequestComment.PullRequestComment( self._requester, data, completed = True ) + return PullRequestComment.PullRequestComment(self._requester, data, completed=True) - def create_issue_comment( self, body ): - assert isinstance( body, ( str, unicode ) ), body + def create_issue_comment(self, body): + assert isinstance(body, (str, unicode)), body post_parameters = { "body": body, } headers, data = self._requester.requestAndCheck( "POST", - self._parentUrl( self._parentUrl( self.url ) ) + "/issues/" + str( self.number ) + "/comments", + self._parentUrl(self._parentUrl(self.url)) + "/issues/" + str(self.number) + "/comments", None, post_parameters ) - return IssueComment.IssueComment( self._requester, data, completed = True ) + return IssueComment.IssueComment(self._requester, data, completed=True) - def edit( self, title = GithubObject.NotSet, body = GithubObject.NotSet, state = GithubObject.NotSet ): - assert title is GithubObject.NotSet or isinstance( title, ( str, unicode ) ), title - assert body is GithubObject.NotSet or isinstance( body, ( str, unicode ) ), body - assert state is GithubObject.NotSet or isinstance( state, ( str, unicode ) ), state + def edit(self, title=GithubObject.NotSet, body=GithubObject.NotSet, state=GithubObject.NotSet): + assert title is GithubObject.NotSet or isinstance(title, (str, unicode)), title + assert body is GithubObject.NotSet or isinstance(body, (str, unicode)), body + assert state is GithubObject.NotSet or isinstance(state, (str, unicode)), state post_parameters = dict() if title is not GithubObject.NotSet: - post_parameters[ "title" ] = title + post_parameters["title"] = title if body is not GithubObject.NotSet: - post_parameters[ "body" ] = body + post_parameters["body"] = body if state is not GithubObject.NotSet: - post_parameters[ "state" ] = state + post_parameters["state"] = state headers, data = self._requester.requestAndCheck( "PATCH", self.url, None, post_parameters ) - self._useAttributes( data ) + self._useAttributes(data) - def get_comment( self, id ): - return self.get_review_comment( id ) + def get_comment(self, id): + return self.get_review_comment(id) - def get_review_comment( self, id ): - assert isinstance( id, int ), id + def get_review_comment(self, id): + assert isinstance(id, int), id headers, data = self._requester.requestAndCheck( "GET", - self._parentUrl( self.url ) + "/comments/" + str( id ), + self._parentUrl(self.url) + "/comments/" + str(id), None, None ) - return PullRequestComment.PullRequestComment( self._requester, data, completed = True ) + return PullRequestComment.PullRequestComment(self._requester, data, completed=True) - def get_comments( self ): + def get_comments(self): return self.get_review_comments() - def get_review_comments( self ): + def get_review_comments(self): return PaginatedList.PaginatedList( PullRequestComment.PullRequestComment, self._requester, @@ -231,7 +232,7 @@ class PullRequest( GithubObject.GithubObject ): None ) - def get_commits( self ): + def get_commits(self): return PaginatedList.PaginatedList( Commit.Commit, self._requester, @@ -239,7 +240,7 @@ class PullRequest( GithubObject.GithubObject ): None ) - def get_files( self ): + def get_files(self): return PaginatedList.PaginatedList( File.File, self._requester, @@ -247,25 +248,25 @@ class PullRequest( GithubObject.GithubObject ): None ) - def get_issue_comment( self, id ): - assert isinstance( id, int ), id + def get_issue_comment(self, id): + assert isinstance(id, int), id headers, data = self._requester.requestAndCheck( "GET", - self._parentUrl( self._parentUrl( self.url ) ) + "/issues/comments/" + str( id ), + self._parentUrl(self._parentUrl(self.url)) + "/issues/comments/" + str(id), None, None ) - return IssueComment.IssueComment( self._requester, data, completed = True ) + return IssueComment.IssueComment(self._requester, data, completed=True) - def get_issue_comments( self ): + def get_issue_comments(self): return PaginatedList.PaginatedList( IssueComment.IssueComment, self._requester, - self._parentUrl( self._parentUrl( self.url ) ) + "/issues/" + str( self.number ) + "/comments", + self._parentUrl(self._parentUrl(self.url)) + "/issues/" + str(self.number) + "/comments", None ) - def is_merged( self ): + def is_merged(self): status, headers, data = self._requester.requestRaw( "GET", self.url + "/merge", @@ -274,20 +275,20 @@ class PullRequest( GithubObject.GithubObject ): ) return status == 204 - def merge( self, commit_message = GithubObject.NotSet ): - assert commit_message is GithubObject.NotSet or isinstance( commit_message, ( str, unicode ) ), commit_message + def merge(self, commit_message=GithubObject.NotSet): + assert commit_message is GithubObject.NotSet or isinstance(commit_message, (str, unicode)), commit_message post_parameters = dict() if commit_message is not GithubObject.NotSet: - post_parameters[ "commit_message" ] = commit_message + post_parameters["commit_message"] = commit_message headers, data = self._requester.requestAndCheck( "PUT", self.url + "/merge", None, post_parameters ) - return PullRequestMergeStatus.PullRequestMergeStatus( self._requester, data, completed = True ) + return PullRequestMergeStatus.PullRequestMergeStatus(self._requester, data, completed=True) - def _initAttributes( self ): + def _initAttributes(self): self._additions = GithubObject.NotSet self._base = GithubObject.NotSet self._body = GithubObject.NotSet @@ -315,82 +316,82 @@ class PullRequest( GithubObject.GithubObject ): self._url = GithubObject.NotSet self._user = GithubObject.NotSet - def _useAttributes( self, attributes ): - if "additions" in attributes: # pragma no branch - assert attributes[ "additions" ] is None or isinstance( attributes[ "additions" ], int ), attributes[ "additions" ] - self._additions = attributes[ "additions" ] - if "base" in attributes: # pragma no branch - assert attributes[ "base" ] is None or isinstance( attributes[ "base" ], dict ), attributes[ "base" ] - self._base = None if attributes[ "base" ] is None else PullRequestPart.PullRequestPart( self._requester, attributes[ "base" ], completed = False ) - if "body" in attributes: # pragma no branch - assert attributes[ "body" ] is None or isinstance( attributes[ "body" ], ( str, unicode ) ), attributes[ "body" ] - self._body = attributes[ "body" ] - if "changed_files" in attributes: # pragma no branch - assert attributes[ "changed_files" ] is None or isinstance( attributes[ "changed_files" ], int ), attributes[ "changed_files" ] - self._changed_files = attributes[ "changed_files" ] - if "closed_at" in attributes: # pragma no branch - assert attributes[ "closed_at" ] is None or isinstance( attributes[ "closed_at" ], ( str, unicode ) ), attributes[ "closed_at" ] - self._closed_at = self._parseDatetime( attributes[ "closed_at" ] ) - if "comments" in attributes: # pragma no branch - assert attributes[ "comments" ] is None or isinstance( attributes[ "comments" ], int ), attributes[ "comments" ] - self._comments = attributes[ "comments" ] - if "commits" in attributes: # pragma no branch - assert attributes[ "commits" ] is None or isinstance( attributes[ "commits" ], int ), attributes[ "commits" ] - self._commits = attributes[ "commits" ] - if "created_at" in attributes: # pragma no branch - assert attributes[ "created_at" ] is None or isinstance( attributes[ "created_at" ], ( str, unicode ) ), attributes[ "created_at" ] - self._created_at = self._parseDatetime( attributes[ "created_at" ] ) - if "deletions" in attributes: # pragma no branch - assert attributes[ "deletions" ] is None or isinstance( attributes[ "deletions" ], int ), attributes[ "deletions" ] - self._deletions = attributes[ "deletions" ] - if "diff_url" in attributes: # pragma no branch - assert attributes[ "diff_url" ] is None or isinstance( attributes[ "diff_url" ], ( str, unicode ) ), attributes[ "diff_url" ] - self._diff_url = attributes[ "diff_url" ] - if "head" in attributes: # pragma no branch - assert attributes[ "head" ] is None or isinstance( attributes[ "head" ], dict ), attributes[ "head" ] - self._head = None if attributes[ "head" ] is None else PullRequestPart.PullRequestPart( self._requester, attributes[ "head" ], completed = False ) - if "html_url" in attributes: # pragma no branch - assert attributes[ "html_url" ] is None or isinstance( attributes[ "html_url" ], ( str, unicode ) ), attributes[ "html_url" ] - self._html_url = attributes[ "html_url" ] - if "id" in attributes: # pragma no branch - assert attributes[ "id" ] is None or isinstance( attributes[ "id" ], int ), attributes[ "id" ] - self._id = attributes[ "id" ] - if "issue_url" in attributes: # pragma no branch - assert attributes[ "issue_url" ] is None or isinstance( attributes[ "issue_url" ], ( str, unicode ) ), attributes[ "issue_url" ] - self._issue_url = attributes[ "issue_url" ] - if "mergeable" in attributes: # pragma no branch - assert attributes[ "mergeable" ] is None or isinstance( attributes[ "mergeable" ], bool ), attributes[ "mergeable" ] - self._mergeable = attributes[ "mergeable" ] - if "merged" in attributes: # pragma no branch - assert attributes[ "merged" ] is None or isinstance( attributes[ "merged" ], bool ), attributes[ "merged" ] - self._merged = attributes[ "merged" ] - if "merged_at" in attributes: # pragma no branch - assert attributes[ "merged_at" ] is None or isinstance( attributes[ "merged_at" ], ( str, unicode ) ), attributes[ "merged_at" ] - self._merged_at = self._parseDatetime( attributes[ "merged_at" ] ) - if "merged_by" in attributes: # pragma no branch - assert attributes[ "merged_by" ] is None or isinstance( attributes[ "merged_by" ], dict ), attributes[ "merged_by" ] - self._merged_by = None if attributes[ "merged_by" ] is None else NamedUser.NamedUser( self._requester, attributes[ "merged_by" ], completed = False ) - if "number" in attributes: # pragma no branch - assert attributes[ "number" ] is None or isinstance( attributes[ "number" ], int ), attributes[ "number" ] - self._number = attributes[ "number" ] - if "patch_url" in attributes: # pragma no branch - assert attributes[ "patch_url" ] is None or isinstance( attributes[ "patch_url" ], ( str, unicode ) ), attributes[ "patch_url" ] - self._patch_url = attributes[ "patch_url" ] - if "review_comments" in attributes: # pragma no branch - assert attributes[ "review_comments" ] is None or isinstance( attributes[ "review_comments" ], int ), attributes[ "review_comments" ] - self._review_comments = attributes[ "review_comments" ] - if "state" in attributes: # pragma no branch - assert attributes[ "state" ] is None or isinstance( attributes[ "state" ], ( str, unicode ) ), attributes[ "state" ] - self._state = attributes[ "state" ] - if "title" in attributes: # pragma no branch - assert attributes[ "title" ] is None or isinstance( attributes[ "title" ], ( str, unicode ) ), attributes[ "title" ] - self._title = attributes[ "title" ] - if "updated_at" in attributes: # pragma no branch - assert attributes[ "updated_at" ] is None or isinstance( attributes[ "updated_at" ], ( str, unicode ) ), attributes[ "updated_at" ] - self._updated_at = self._parseDatetime( attributes[ "updated_at" ] ) - if "url" in attributes: # pragma no branch - assert attributes[ "url" ] is None or isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ] - self._url = attributes[ "url" ] - if "user" in attributes: # pragma no branch - assert attributes[ "user" ] is None or isinstance( attributes[ "user" ], dict ), attributes[ "user" ] - self._user = None if attributes[ "user" ] is None else NamedUser.NamedUser( self._requester, attributes[ "user" ], completed = False ) + def _useAttributes(self, attributes): + if "additions" in attributes: # pragma no branch + assert attributes["additions"] is None or isinstance(attributes["additions"], int), attributes["additions"] + self._additions = attributes["additions"] + if "base" in attributes: # pragma no branch + assert attributes["base"] is None or isinstance(attributes["base"], dict), attributes["base"] + self._base = None if attributes["base"] is None else PullRequestPart.PullRequestPart(self._requester, attributes["base"], completed=False) + if "body" in attributes: # pragma no branch + assert attributes["body"] is None or isinstance(attributes["body"], (str, unicode)), attributes["body"] + self._body = attributes["body"] + if "changed_files" in attributes: # pragma no branch + assert attributes["changed_files"] is None or isinstance(attributes["changed_files"], int), attributes["changed_files"] + self._changed_files = attributes["changed_files"] + if "closed_at" in attributes: # pragma no branch + assert attributes["closed_at"] is None or isinstance(attributes["closed_at"], (str, unicode)), attributes["closed_at"] + self._closed_at = self._parseDatetime(attributes["closed_at"]) + if "comments" in attributes: # pragma no branch + assert attributes["comments"] is None or isinstance(attributes["comments"], int), attributes["comments"] + self._comments = attributes["comments"] + if "commits" in attributes: # pragma no branch + assert attributes["commits"] is None or isinstance(attributes["commits"], int), attributes["commits"] + self._commits = attributes["commits"] + if "created_at" in attributes: # pragma no branch + assert attributes["created_at"] is None or isinstance(attributes["created_at"], (str, unicode)), attributes["created_at"] + self._created_at = self._parseDatetime(attributes["created_at"]) + if "deletions" in attributes: # pragma no branch + assert attributes["deletions"] is None or isinstance(attributes["deletions"], int), attributes["deletions"] + self._deletions = attributes["deletions"] + if "diff_url" in attributes: # pragma no branch + assert attributes["diff_url"] is None or isinstance(attributes["diff_url"], (str, unicode)), attributes["diff_url"] + self._diff_url = attributes["diff_url"] + if "head" in attributes: # pragma no branch + assert attributes["head"] is None or isinstance(attributes["head"], dict), attributes["head"] + self._head = None if attributes["head"] is None else PullRequestPart.PullRequestPart(self._requester, attributes["head"], completed=False) + if "html_url" in attributes: # pragma no branch + assert attributes["html_url"] is None or isinstance(attributes["html_url"], (str, unicode)), attributes["html_url"] + self._html_url = attributes["html_url"] + if "id" in attributes: # pragma no branch + assert attributes["id"] is None or isinstance(attributes["id"], int), attributes["id"] + self._id = attributes["id"] + if "issue_url" in attributes: # pragma no branch + assert attributes["issue_url"] is None or isinstance(attributes["issue_url"], (str, unicode)), attributes["issue_url"] + self._issue_url = attributes["issue_url"] + if "mergeable" in attributes: # pragma no branch + assert attributes["mergeable"] is None or isinstance(attributes["mergeable"], bool), attributes["mergeable"] + self._mergeable = attributes["mergeable"] + if "merged" in attributes: # pragma no branch + assert attributes["merged"] is None or isinstance(attributes["merged"], bool), attributes["merged"] + self._merged = attributes["merged"] + if "merged_at" in attributes: # pragma no branch + assert attributes["merged_at"] is None or isinstance(attributes["merged_at"], (str, unicode)), attributes["merged_at"] + self._merged_at = self._parseDatetime(attributes["merged_at"]) + if "merged_by" in attributes: # pragma no branch + assert attributes["merged_by"] is None or isinstance(attributes["merged_by"], dict), attributes["merged_by"] + self._merged_by = None if attributes["merged_by"] is None else NamedUser.NamedUser(self._requester, attributes["merged_by"], completed=False) + if "number" in attributes: # pragma no branch + assert attributes["number"] is None or isinstance(attributes["number"], int), attributes["number"] + self._number = attributes["number"] + if "patch_url" in attributes: # pragma no branch + assert attributes["patch_url"] is None or isinstance(attributes["patch_url"], (str, unicode)), attributes["patch_url"] + self._patch_url = attributes["patch_url"] + if "review_comments" in attributes: # pragma no branch + assert attributes["review_comments"] is None or isinstance(attributes["review_comments"], int), attributes["review_comments"] + self._review_comments = attributes["review_comments"] + if "state" in attributes: # pragma no branch + assert attributes["state"] is None or isinstance(attributes["state"], (str, unicode)), attributes["state"] + self._state = attributes["state"] + if "title" in attributes: # pragma no branch + assert attributes["title"] is None or isinstance(attributes["title"], (str, unicode)), attributes["title"] + self._title = attributes["title"] + if "updated_at" in attributes: # pragma no branch + assert attributes["updated_at"] is None or isinstance(attributes["updated_at"], (str, unicode)), attributes["updated_at"] + self._updated_at = self._parseDatetime(attributes["updated_at"]) + if "url" in attributes: # pragma no branch + assert attributes["url"] is None or isinstance(attributes["url"], (str, unicode)), attributes["url"] + self._url = attributes["url"] + if "user" in attributes: # pragma no branch + assert attributes["user"] is None or isinstance(attributes["user"], dict), attributes["user"] + self._user = None if attributes["user"] is None else NamedUser.NamedUser(self._requester, attributes["user"], completed=False) diff --git a/github/PullRequestComment.py b/github/PullRequestComment.py index eb042a3c..04525b01 100644 --- a/github/PullRequestComment.py +++ b/github/PullRequestComment.py @@ -15,63 +15,64 @@ import GithubObject import NamedUser -class PullRequestComment( GithubObject.GithubObject ): + +class PullRequestComment(GithubObject.GithubObject): @property - def body( self ): - self._completeIfNotSet( self._body ) - return self._NoneIfNotSet( self._body ) + def body(self): + self._completeIfNotSet(self._body) + return self._NoneIfNotSet(self._body) @property - def commit_id( self ): - self._completeIfNotSet( self._commit_id ) - return self._NoneIfNotSet( self._commit_id ) + def commit_id(self): + self._completeIfNotSet(self._commit_id) + return self._NoneIfNotSet(self._commit_id) @property - def created_at( self ): - self._completeIfNotSet( self._created_at ) - return self._NoneIfNotSet( self._created_at ) + def created_at(self): + self._completeIfNotSet(self._created_at) + return self._NoneIfNotSet(self._created_at) @property - def id( self ): - self._completeIfNotSet( self._id ) - return self._NoneIfNotSet( self._id ) + def id(self): + self._completeIfNotSet(self._id) + return self._NoneIfNotSet(self._id) @property - def original_commit_id( self ): - self._completeIfNotSet( self._original_commit_id ) - return self._NoneIfNotSet( self._original_commit_id ) + def original_commit_id(self): + self._completeIfNotSet(self._original_commit_id) + return self._NoneIfNotSet(self._original_commit_id) @property - def original_position( self ): - self._completeIfNotSet( self._original_position ) - return self._NoneIfNotSet( self._original_position ) + def original_position(self): + self._completeIfNotSet(self._original_position) + return self._NoneIfNotSet(self._original_position) @property - def path( self ): - self._completeIfNotSet( self._path ) - return self._NoneIfNotSet( self._path ) + def path(self): + self._completeIfNotSet(self._path) + return self._NoneIfNotSet(self._path) @property - def position( self ): - self._completeIfNotSet( self._position ) - return self._NoneIfNotSet( self._position ) + def position(self): + self._completeIfNotSet(self._position) + return self._NoneIfNotSet(self._position) @property - def updated_at( self ): - self._completeIfNotSet( self._updated_at ) - return self._NoneIfNotSet( self._updated_at ) + def updated_at(self): + self._completeIfNotSet(self._updated_at) + return self._NoneIfNotSet(self._updated_at) @property - def url( self ): - self._completeIfNotSet( self._url ) - return self._NoneIfNotSet( self._url ) + def url(self): + self._completeIfNotSet(self._url) + return self._NoneIfNotSet(self._url) @property - def user( self ): - self._completeIfNotSet( self._user ) - return self._NoneIfNotSet( self._user ) + def user(self): + self._completeIfNotSet(self._user) + return self._NoneIfNotSet(self._user) - def delete( self ): + def delete(self): headers, data = self._requester.requestAndCheck( "DELETE", self.url, @@ -79,8 +80,8 @@ class PullRequestComment( GithubObject.GithubObject ): None ) - def edit( self, body ): - assert isinstance( body, ( str, unicode ) ), body + def edit(self, body): + assert isinstance(body, (str, unicode)), body post_parameters = { "body": body, } @@ -90,9 +91,9 @@ class PullRequestComment( GithubObject.GithubObject ): None, post_parameters ) - self._useAttributes( data ) + self._useAttributes(data) - def _initAttributes( self ): + def _initAttributes(self): self._body = GithubObject.NotSet self._commit_id = GithubObject.NotSet self._created_at = GithubObject.NotSet @@ -105,37 +106,37 @@ class PullRequestComment( GithubObject.GithubObject ): self._url = GithubObject.NotSet self._user = GithubObject.NotSet - def _useAttributes( self, attributes ): - if "body" in attributes: # pragma no branch - assert attributes[ "body" ] is None or isinstance( attributes[ "body" ], ( str, unicode ) ), attributes[ "body" ] - self._body = attributes[ "body" ] - if "commit_id" in attributes: # pragma no branch - assert attributes[ "commit_id" ] is None or isinstance( attributes[ "commit_id" ], ( str, unicode ) ), attributes[ "commit_id" ] - self._commit_id = attributes[ "commit_id" ] - if "created_at" in attributes: # pragma no branch - assert attributes[ "created_at" ] is None or isinstance( attributes[ "created_at" ], ( str, unicode ) ), attributes[ "created_at" ] - self._created_at = self._parseDatetime( attributes[ "created_at" ] ) - if "id" in attributes: # pragma no branch - assert attributes[ "id" ] is None or isinstance( attributes[ "id" ], int ), attributes[ "id" ] - self._id = attributes[ "id" ] - if "original_commit_id" in attributes: # pragma no branch - assert attributes[ "original_commit_id" ] is None or isinstance( attributes[ "original_commit_id" ], ( str, unicode ) ), attributes[ "original_commit_id" ] - self._original_commit_id = attributes[ "original_commit_id" ] - if "original_position" in attributes: # pragma no branch - assert attributes[ "original_position" ] is None or isinstance( attributes[ "original_position" ], int ), attributes[ "original_position" ] - self._original_position = attributes[ "original_position" ] - if "path" in attributes: # pragma no branch - assert attributes[ "path" ] is None or isinstance( attributes[ "path" ], ( str, unicode ) ), attributes[ "path" ] - self._path = attributes[ "path" ] - if "position" in attributes: # pragma no branch - assert attributes[ "position" ] is None or isinstance( attributes[ "position" ], int ), attributes[ "position" ] - self._position = attributes[ "position" ] - if "updated_at" in attributes: # pragma no branch - assert attributes[ "updated_at" ] is None or isinstance( attributes[ "updated_at" ], ( str, unicode ) ), attributes[ "updated_at" ] - self._updated_at = self._parseDatetime( attributes[ "updated_at" ] ) - if "url" in attributes: # pragma no branch - assert attributes[ "url" ] is None or isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ] - self._url = attributes[ "url" ] - if "user" in attributes: # pragma no branch - assert attributes[ "user" ] is None or isinstance( attributes[ "user" ], dict ), attributes[ "user" ] - self._user = None if attributes[ "user" ] is None else NamedUser.NamedUser( self._requester, attributes[ "user" ], completed = False ) + def _useAttributes(self, attributes): + if "body" in attributes: # pragma no branch + assert attributes["body"] is None or isinstance(attributes["body"], (str, unicode)), attributes["body"] + self._body = attributes["body"] + if "commit_id" in attributes: # pragma no branch + assert attributes["commit_id"] is None or isinstance(attributes["commit_id"], (str, unicode)), attributes["commit_id"] + self._commit_id = attributes["commit_id"] + if "created_at" in attributes: # pragma no branch + assert attributes["created_at"] is None or isinstance(attributes["created_at"], (str, unicode)), attributes["created_at"] + self._created_at = self._parseDatetime(attributes["created_at"]) + if "id" in attributes: # pragma no branch + assert attributes["id"] is None or isinstance(attributes["id"], int), attributes["id"] + self._id = attributes["id"] + if "original_commit_id" in attributes: # pragma no branch + assert attributes["original_commit_id"] is None or isinstance(attributes["original_commit_id"], (str, unicode)), attributes["original_commit_id"] + self._original_commit_id = attributes["original_commit_id"] + if "original_position" in attributes: # pragma no branch + assert attributes["original_position"] is None or isinstance(attributes["original_position"], int), attributes["original_position"] + self._original_position = attributes["original_position"] + if "path" in attributes: # pragma no branch + assert attributes["path"] is None or isinstance(attributes["path"], (str, unicode)), attributes["path"] + self._path = attributes["path"] + if "position" in attributes: # pragma no branch + assert attributes["position"] is None or isinstance(attributes["position"], int), attributes["position"] + self._position = attributes["position"] + if "updated_at" in attributes: # pragma no branch + assert attributes["updated_at"] is None or isinstance(attributes["updated_at"], (str, unicode)), attributes["updated_at"] + self._updated_at = self._parseDatetime(attributes["updated_at"]) + if "url" in attributes: # pragma no branch + assert attributes["url"] is None or isinstance(attributes["url"], (str, unicode)), attributes["url"] + self._url = attributes["url"] + if "user" in attributes: # pragma no branch + assert attributes["user"] is None or isinstance(attributes["user"], dict), attributes["user"] + self._user = None if attributes["user"] is None else NamedUser.NamedUser(self._requester, attributes["user"], completed=False) diff --git a/github/PullRequestMergeStatus.py b/github/PullRequestMergeStatus.py index c1e8c859..3117b003 100644 --- a/github/PullRequestMergeStatus.py +++ b/github/PullRequestMergeStatus.py @@ -13,31 +13,32 @@ import GithubObject -class PullRequestMergeStatus( GithubObject.BasicGithubObject ): + +class PullRequestMergeStatus(GithubObject.BasicGithubObject): @property - def merged( self ): - return self._NoneIfNotSet( self._merged ) + def merged(self): + return self._NoneIfNotSet(self._merged) @property - def message( self ): - return self._NoneIfNotSet( self._message ) + def message(self): + return self._NoneIfNotSet(self._message) @property - def sha( self ): - return self._NoneIfNotSet( self._sha ) + def sha(self): + return self._NoneIfNotSet(self._sha) - def _initAttributes( self ): + def _initAttributes(self): self._merged = GithubObject.NotSet self._message = GithubObject.NotSet self._sha = GithubObject.NotSet - def _useAttributes( self, attributes ): - if "merged" in attributes: # pragma no branch - assert attributes[ "merged" ] is None or isinstance( attributes[ "merged" ], bool ), attributes[ "merged" ] - self._merged = attributes[ "merged" ] - if "message" in attributes: # pragma no branch - assert attributes[ "message" ] is None or isinstance( attributes[ "message" ], ( str, unicode ) ), attributes[ "message" ] - self._message = attributes[ "message" ] - if "sha" in attributes: # pragma no branch - assert attributes[ "sha" ] is None or isinstance( attributes[ "sha" ], ( str, unicode ) ), attributes[ "sha" ] - self._sha = attributes[ "sha" ] + def _useAttributes(self, attributes): + if "merged" in attributes: # pragma no branch + assert attributes["merged"] is None or isinstance(attributes["merged"], bool), attributes["merged"] + self._merged = attributes["merged"] + if "message" in attributes: # pragma no branch + assert attributes["message"] is None or isinstance(attributes["message"], (str, unicode)), attributes["message"] + self._message = attributes["message"] + if "sha" in attributes: # pragma no branch + assert attributes["sha"] is None or isinstance(attributes["sha"], (str, unicode)), attributes["sha"] + self._sha = attributes["sha"] diff --git a/github/PullRequestPart.py b/github/PullRequestPart.py index 877a8a49..f7695e85 100644 --- a/github/PullRequestPart.py +++ b/github/PullRequestPart.py @@ -16,47 +16,48 @@ import GithubObject import Repository import NamedUser -class PullRequestPart( GithubObject.BasicGithubObject ): + +class PullRequestPart(GithubObject.BasicGithubObject): @property - def label( self ): - return self._NoneIfNotSet( self._label ) + def label(self): + return self._NoneIfNotSet(self._label) @property - def ref( self ): - return self._NoneIfNotSet( self._ref ) + def ref(self): + return self._NoneIfNotSet(self._ref) @property - def repo( self ): - return self._NoneIfNotSet( self._repo ) + def repo(self): + return self._NoneIfNotSet(self._repo) @property - def sha( self ): - return self._NoneIfNotSet( self._sha ) + def sha(self): + return self._NoneIfNotSet(self._sha) @property - def user( self ): - return self._NoneIfNotSet( self._user ) + def user(self): + return self._NoneIfNotSet(self._user) - def _initAttributes( self ): + def _initAttributes(self): self._label = GithubObject.NotSet self._ref = GithubObject.NotSet self._repo = GithubObject.NotSet self._sha = GithubObject.NotSet self._user = GithubObject.NotSet - def _useAttributes( self, attributes ): - if "label" in attributes: # pragma no branch - assert attributes[ "label" ] is None or isinstance( attributes[ "label" ], ( str, unicode ) ), attributes[ "label" ] - self._label = attributes[ "label" ] - if "ref" in attributes: # pragma no branch - assert attributes[ "ref" ] is None or isinstance( attributes[ "ref" ], ( str, unicode ) ), attributes[ "ref" ] - self._ref = attributes[ "ref" ] - if "repo" in attributes: # pragma no branch - assert attributes[ "repo" ] is None or isinstance( attributes[ "repo" ], dict ), attributes[ "repo" ] - self._repo = None if attributes[ "repo" ] is None else Repository.Repository( self._requester, attributes[ "repo" ], completed = False ) - if "sha" in attributes: # pragma no branch - assert attributes[ "sha" ] is None or isinstance( attributes[ "sha" ], ( str, unicode ) ), attributes[ "sha" ] - self._sha = attributes[ "sha" ] - if "user" in attributes: # pragma no branch - assert attributes[ "user" ] is None or isinstance( attributes[ "user" ], dict ), attributes[ "user" ] - self._user = None if attributes[ "user" ] is None else NamedUser.NamedUser( self._requester, attributes[ "user" ], completed = False ) + def _useAttributes(self, attributes): + if "label" in attributes: # pragma no branch + assert attributes["label"] is None or isinstance(attributes["label"], (str, unicode)), attributes["label"] + self._label = attributes["label"] + if "ref" in attributes: # pragma no branch + assert attributes["ref"] is None or isinstance(attributes["ref"], (str, unicode)), attributes["ref"] + self._ref = attributes["ref"] + if "repo" in attributes: # pragma no branch + assert attributes["repo"] is None or isinstance(attributes["repo"], dict), attributes["repo"] + self._repo = None if attributes["repo"] is None else Repository.Repository(self._requester, attributes["repo"], completed=False) + if "sha" in attributes: # pragma no branch + assert attributes["sha"] is None or isinstance(attributes["sha"], (str, unicode)), attributes["sha"] + self._sha = attributes["sha"] + if "user" in attributes: # pragma no branch + assert attributes["user"] is None or isinstance(attributes["user"], dict), attributes["user"] + self._user = None if attributes["user"] is None else NamedUser.NamedUser(self._requester, attributes["user"], completed=False) diff --git a/github/Repository.py b/github/Repository.py index 811ffbc9..b2c81c80 100644 --- a/github/Repository.py +++ b/github/Repository.py @@ -46,159 +46,160 @@ import Permissions import Event import Legacy -class Repository( GithubObject.GithubObject ): + +class Repository(GithubObject.GithubObject): @property - def clone_url( self ): - self._completeIfNotSet( self._clone_url ) - return self._NoneIfNotSet( self._clone_url ) + def clone_url(self): + self._completeIfNotSet(self._clone_url) + return self._NoneIfNotSet(self._clone_url) @property - def created_at( self ): - self._completeIfNotSet( self._created_at ) - return self._NoneIfNotSet( self._created_at ) + def created_at(self): + self._completeIfNotSet(self._created_at) + return self._NoneIfNotSet(self._created_at) @property - def description( self ): - self._completeIfNotSet( self._description ) - return self._NoneIfNotSet( self._description ) + def description(self): + self._completeIfNotSet(self._description) + return self._NoneIfNotSet(self._description) @property - def fork( self ): - self._completeIfNotSet( self._fork ) - return self._NoneIfNotSet( self._fork ) + def fork(self): + self._completeIfNotSet(self._fork) + return self._NoneIfNotSet(self._fork) @property - def forks( self ): - self._completeIfNotSet( self._forks ) - return self._NoneIfNotSet( self._forks ) + def forks(self): + self._completeIfNotSet(self._forks) + return self._NoneIfNotSet(self._forks) @property - def full_name( self ): - self._completeIfNotSet( self._full_name ) - return self._NoneIfNotSet( self._full_name ) + def full_name(self): + self._completeIfNotSet(self._full_name) + return self._NoneIfNotSet(self._full_name) @property - def git_url( self ): - self._completeIfNotSet( self._git_url ) - return self._NoneIfNotSet( self._git_url ) + def git_url(self): + self._completeIfNotSet(self._git_url) + return self._NoneIfNotSet(self._git_url) @property - def has_downloads( self ): - self._completeIfNotSet( self._has_downloads ) - return self._NoneIfNotSet( self._has_downloads ) + def has_downloads(self): + self._completeIfNotSet(self._has_downloads) + return self._NoneIfNotSet(self._has_downloads) @property - def has_issues( self ): - self._completeIfNotSet( self._has_issues ) - return self._NoneIfNotSet( self._has_issues ) + def has_issues(self): + self._completeIfNotSet(self._has_issues) + return self._NoneIfNotSet(self._has_issues) @property - def has_wiki( self ): - self._completeIfNotSet( self._has_wiki ) - return self._NoneIfNotSet( self._has_wiki ) + def has_wiki(self): + self._completeIfNotSet(self._has_wiki) + return self._NoneIfNotSet(self._has_wiki) @property - def homepage( self ): - self._completeIfNotSet( self._homepage ) - return self._NoneIfNotSet( self._homepage ) + def homepage(self): + self._completeIfNotSet(self._homepage) + return self._NoneIfNotSet(self._homepage) @property - def html_url( self ): - self._completeIfNotSet( self._html_url ) - return self._NoneIfNotSet( self._html_url ) + def html_url(self): + self._completeIfNotSet(self._html_url) + return self._NoneIfNotSet(self._html_url) @property - def id( self ): - self._completeIfNotSet( self._id ) - return self._NoneIfNotSet( self._id ) + def id(self): + self._completeIfNotSet(self._id) + return self._NoneIfNotSet(self._id) @property - def language( self ): - self._completeIfNotSet( self._language ) - return self._NoneIfNotSet( self._language ) + def language(self): + self._completeIfNotSet(self._language) + return self._NoneIfNotSet(self._language) @property - def master_branch( self ): - self._completeIfNotSet( self._master_branch ) - return self._NoneIfNotSet( self._master_branch ) + def master_branch(self): + self._completeIfNotSet(self._master_branch) + return self._NoneIfNotSet(self._master_branch) @property - def name( self ): - self._completeIfNotSet( self._name ) - return self._NoneIfNotSet( self._name ) + def name(self): + self._completeIfNotSet(self._name) + return self._NoneIfNotSet(self._name) @property - def open_issues( self ): - self._completeIfNotSet( self._open_issues ) - return self._NoneIfNotSet( self._open_issues ) + def open_issues(self): + self._completeIfNotSet(self._open_issues) + return self._NoneIfNotSet(self._open_issues) @property - def organization( self ): - self._completeIfNotSet( self._organization ) - return self._NoneIfNotSet( self._organization ) + def organization(self): + self._completeIfNotSet(self._organization) + return self._NoneIfNotSet(self._organization) @property - def owner( self ): - self._completeIfNotSet( self._owner ) - return self._NoneIfNotSet( self._owner ) + def owner(self): + self._completeIfNotSet(self._owner) + return self._NoneIfNotSet(self._owner) @property - def parent( self ): - self._completeIfNotSet( self._parent ) - return self._NoneIfNotSet( self._parent ) + def parent(self): + self._completeIfNotSet(self._parent) + return self._NoneIfNotSet(self._parent) @property - def permissions( self ): - self._completeIfNotSet( self._permissions ) - return self._NoneIfNotSet( self._permissions ) + def permissions(self): + self._completeIfNotSet(self._permissions) + return self._NoneIfNotSet(self._permissions) @property - def private( self ): - self._completeIfNotSet( self._private ) - return self._NoneIfNotSet( self._private ) + def private(self): + self._completeIfNotSet(self._private) + return self._NoneIfNotSet(self._private) @property - def pushed_at( self ): - self._completeIfNotSet( self._pushed_at ) - return self._NoneIfNotSet( self._pushed_at ) + def pushed_at(self): + self._completeIfNotSet(self._pushed_at) + return self._NoneIfNotSet(self._pushed_at) @property - def size( self ): - self._completeIfNotSet( self._size ) - return self._NoneIfNotSet( self._size ) + def size(self): + self._completeIfNotSet(self._size) + return self._NoneIfNotSet(self._size) @property - def source( self ): - self._completeIfNotSet( self._source ) - return self._NoneIfNotSet( self._source ) + def source(self): + self._completeIfNotSet(self._source) + return self._NoneIfNotSet(self._source) @property - def ssh_url( self ): - self._completeIfNotSet( self._ssh_url ) - return self._NoneIfNotSet( self._ssh_url ) + def ssh_url(self): + self._completeIfNotSet(self._ssh_url) + return self._NoneIfNotSet(self._ssh_url) @property - def svn_url( self ): - self._completeIfNotSet( self._svn_url ) - return self._NoneIfNotSet( self._svn_url ) + def svn_url(self): + self._completeIfNotSet(self._svn_url) + return self._NoneIfNotSet(self._svn_url) @property - def updated_at( self ): - self._completeIfNotSet( self._updated_at ) - return self._NoneIfNotSet( self._updated_at ) + def updated_at(self): + self._completeIfNotSet(self._updated_at) + return self._NoneIfNotSet(self._updated_at) @property - def url( self ): - self._completeIfNotSet( self._url ) - return self._NoneIfNotSet( self._url ) + def url(self): + self._completeIfNotSet(self._url) + return self._NoneIfNotSet(self._url) @property - def watchers( self ): - self._completeIfNotSet( self._watchers ) - return self._NoneIfNotSet( self._watchers ) + def watchers(self): + self._completeIfNotSet(self._watchers) + return self._NoneIfNotSet(self._watchers) - def add_to_collaborators( self, collaborator ): - assert isinstance( collaborator, NamedUser.NamedUser ), collaborator + def add_to_collaborators(self, collaborator): + assert isinstance(collaborator, NamedUser.NamedUser), collaborator headers, data = self._requester.requestAndCheck( "PUT", self.url + "/collaborators/" + collaborator._identity, @@ -206,41 +207,41 @@ class Repository( GithubObject.GithubObject ): None ) - def compare( self, base, head ): - assert isinstance( base, ( str, unicode ) ), base - assert isinstance( head, ( str, unicode ) ), head + def compare(self, base, head): + assert isinstance(base, (str, unicode)), base + assert isinstance(head, (str, unicode)), head headers, data = self._requester.requestAndCheck( "GET", self.url + "/compare/" + base + "..." + head, None, None ) - return Comparison.Comparison( self._requester, data, completed = True ) + return Comparison.Comparison(self._requester, data, completed=True) - def create_download( self, name, size, description = GithubObject.NotSet, content_type = GithubObject.NotSet ): - assert isinstance( name, ( str, unicode ) ), name - assert isinstance( size, int ), size - assert description is GithubObject.NotSet or isinstance( description, ( str, unicode ) ), description - assert content_type is GithubObject.NotSet or isinstance( content_type, ( str, unicode ) ), content_type + def create_download(self, name, size, description=GithubObject.NotSet, content_type=GithubObject.NotSet): + assert isinstance(name, (str, unicode)), name + assert isinstance(size, int), size + assert description is GithubObject.NotSet or isinstance(description, (str, unicode)), description + assert content_type is GithubObject.NotSet or isinstance(content_type, (str, unicode)), content_type post_parameters = { "name": name, "size": size, } if description is not GithubObject.NotSet: - post_parameters[ "description" ] = description + post_parameters["description"] = description if content_type is not GithubObject.NotSet: - post_parameters[ "content_type" ] = content_type + post_parameters["content_type"] = content_type headers, data = self._requester.requestAndCheck( "POST", self.url + "/downloads", None, post_parameters ) - return Download.Download( self._requester, data, completed = True ) + return Download.Download(self._requester, data, completed=True) - def create_git_blob( self, content, encoding ): - assert isinstance( content, ( str, unicode ) ), content - assert isinstance( encoding, ( str, unicode ) ), encoding + def create_git_blob(self, content, encoding): + assert isinstance(content, (str, unicode)), content + assert isinstance(encoding, (str, unicode)), encoding post_parameters = { "content": content, "encoding": encoding, @@ -251,34 +252,34 @@ class Repository( GithubObject.GithubObject ): None, post_parameters ) - return GitBlob.GitBlob( self._requester, data, completed = True ) + return GitBlob.GitBlob(self._requester, data, completed=True) - def create_git_commit( self, message, tree, parents, author = GithubObject.NotSet, committer = GithubObject.NotSet ): - assert isinstance( message, ( str, unicode ) ), message - assert isinstance( tree, GitTree.GitTree ), tree - assert all( isinstance( element, GitCommit.GitCommit ) for element in parents ), parents - assert author is GithubObject.NotSet or isinstance( author, InputGitAuthor.InputGitAuthor ), author - assert committer is GithubObject.NotSet or isinstance( committer, InputGitAuthor.InputGitAuthor ), committer + def create_git_commit(self, message, tree, parents, author=GithubObject.NotSet, committer=GithubObject.NotSet): + assert isinstance(message, (str, unicode)), message + assert isinstance(tree, GitTree.GitTree), tree + assert all(isinstance(element, GitCommit.GitCommit) for element in parents), parents + assert author is GithubObject.NotSet or isinstance(author, InputGitAuthor.InputGitAuthor), author + assert committer is GithubObject.NotSet or isinstance(committer, InputGitAuthor.InputGitAuthor), committer post_parameters = { "message": message, "tree": tree._identity, - "parents": [ element._identity for element in parents ], + "parents": [element._identity for element in parents], } if author is not GithubObject.NotSet: - post_parameters[ "author" ] = author._identity + post_parameters["author"] = author._identity if committer is not GithubObject.NotSet: - post_parameters[ "committer" ] = committer._identity + post_parameters["committer"] = committer._identity headers, data = self._requester.requestAndCheck( "POST", self.url + "/git/commits", None, post_parameters ) - return GitCommit.GitCommit( self._requester, data, completed = True ) + return GitCommit.GitCommit(self._requester, data, completed=True) - def create_git_ref( self, ref, sha ): - assert isinstance( ref, ( str, unicode ) ), ref - assert isinstance( sha, ( str, unicode ) ), sha + def create_git_ref(self, ref, sha): + assert isinstance(ref, (str, unicode)), ref + assert isinstance(sha, (str, unicode)), sha post_parameters = { "ref": ref, "sha": sha, @@ -289,14 +290,14 @@ class Repository( GithubObject.GithubObject ): None, post_parameters ) - return GitRef.GitRef( self._requester, data, completed = True ) + return GitRef.GitRef(self._requester, data, completed=True) - def create_git_tag( self, tag, message, object, type, tagger = GithubObject.NotSet ): - assert isinstance( tag, ( str, unicode ) ), tag - assert isinstance( message, ( str, unicode ) ), message - assert isinstance( object, ( str, unicode ) ), object - assert isinstance( type, ( str, unicode ) ), type - assert tagger is GithubObject.NotSet or isinstance( tagger, InputGitAuthor.InputGitAuthor ), tagger + def create_git_tag(self, tag, message, object, type, tagger=GithubObject.NotSet): + assert isinstance(tag, (str, unicode)), tag + assert isinstance(message, (str, unicode)), message + assert isinstance(object, (str, unicode)), object + assert isinstance(type, (str, unicode)), type + assert tagger is GithubObject.NotSet or isinstance(tagger, InputGitAuthor.InputGitAuthor), tagger post_parameters = { "tag": tag, "message": message, @@ -304,80 +305,80 @@ class Repository( GithubObject.GithubObject ): "type": type, } if tagger is not GithubObject.NotSet: - post_parameters[ "tagger" ] = tagger._identity + post_parameters["tagger"] = tagger._identity headers, data = self._requester.requestAndCheck( "POST", self.url + "/git/tags", None, post_parameters ) - return GitTag.GitTag( self._requester, data, completed = True ) + return GitTag.GitTag(self._requester, data, completed=True) - def create_git_tree( self, tree, base_tree = GithubObject.NotSet ): - assert all( isinstance( element, InputGitTreeElement.InputGitTreeElement ) for element in tree ), tree - assert base_tree is GithubObject.NotSet or isinstance( base_tree, GitTree.GitTree ), base_tree + def create_git_tree(self, tree, base_tree=GithubObject.NotSet): + assert all(isinstance(element, InputGitTreeElement.InputGitTreeElement) for element in tree), tree + assert base_tree is GithubObject.NotSet or isinstance(base_tree, GitTree.GitTree), base_tree post_parameters = { - "tree": [ element._identity for element in tree ], + "tree": [element._identity for element in tree], } if base_tree is not GithubObject.NotSet: - post_parameters[ "base_tree" ] = base_tree._identity + post_parameters["base_tree"] = base_tree._identity headers, data = self._requester.requestAndCheck( "POST", self.url + "/git/trees", None, post_parameters ) - return GitTree.GitTree( self._requester, data, completed = True ) + return GitTree.GitTree(self._requester, data, completed=True) - def create_hook( self, name, config, events = GithubObject.NotSet, active = GithubObject.NotSet ): - assert isinstance( name, ( str, unicode ) ), name - assert isinstance( config, dict ), config - assert events is GithubObject.NotSet or all( isinstance( element, ( str, unicode ) ) for element in events ), events - assert active is GithubObject.NotSet or isinstance( active, bool ), active + def create_hook(self, name, config, events=GithubObject.NotSet, active=GithubObject.NotSet): + assert isinstance(name, (str, unicode)), name + assert isinstance(config, dict), config + assert events is GithubObject.NotSet or all(isinstance(element, (str, unicode)) for element in events), events + assert active is GithubObject.NotSet or isinstance(active, bool), active post_parameters = { "name": name, "config": config, } if events is not GithubObject.NotSet: - post_parameters[ "events" ] = events + post_parameters["events"] = events if active is not GithubObject.NotSet: - post_parameters[ "active" ] = active + post_parameters["active"] = active headers, data = self._requester.requestAndCheck( "POST", self.url + "/hooks", None, post_parameters ) - return Hook.Hook( self._requester, data, completed = True ) + return Hook.Hook(self._requester, data, completed=True) - def create_issue( self, title, body = GithubObject.NotSet, assignee = GithubObject.NotSet, milestone = GithubObject.NotSet, labels = GithubObject.NotSet ): - assert isinstance( title, ( str, unicode ) ), title - assert body is GithubObject.NotSet or isinstance( body, ( str, unicode ) ), body - assert assignee is GithubObject.NotSet or isinstance( assignee, NamedUser.NamedUser ), assignee - assert milestone is GithubObject.NotSet or isinstance( milestone, Milestone.Milestone ), milestone - assert labels is GithubObject.NotSet or all( isinstance( element, Label.Label ) for element in labels ), labels + def create_issue(self, title, body=GithubObject.NotSet, assignee=GithubObject.NotSet, milestone=GithubObject.NotSet, labels=GithubObject.NotSet): + assert isinstance(title, (str, unicode)), title + assert body is GithubObject.NotSet or isinstance(body, (str, unicode)), body + assert assignee is GithubObject.NotSet or isinstance(assignee, NamedUser.NamedUser), assignee + assert milestone is GithubObject.NotSet or isinstance(milestone, Milestone.Milestone), milestone + assert labels is GithubObject.NotSet or all(isinstance(element, Label.Label) for element in labels), labels post_parameters = { "title": title, } if body is not GithubObject.NotSet: - post_parameters[ "body" ] = body + post_parameters["body"] = body if assignee is not GithubObject.NotSet: - post_parameters[ "assignee" ] = assignee._identity + post_parameters["assignee"] = assignee._identity if milestone is not GithubObject.NotSet: - post_parameters[ "milestone" ] = milestone._identity + post_parameters["milestone"] = milestone._identity if labels is not GithubObject.NotSet: - post_parameters[ "labels" ] = [ element.name for element in labels ] + post_parameters["labels"] = [element.name for element in labels] headers, data = self._requester.requestAndCheck( "POST", self.url + "/issues", None, post_parameters ) - return Issue.Issue( self._requester, data, completed = True ) + return Issue.Issue(self._requester, data, completed=True) - def create_key( self, title, key ): - assert isinstance( title, ( str, unicode ) ), title - assert isinstance( key, ( str, unicode ) ), key + def create_key(self, title, key): + assert isinstance(title, (str, unicode)), title + assert isinstance(key, (str, unicode)), key post_parameters = { "title": title, "key": key, @@ -388,11 +389,11 @@ class Repository( GithubObject.GithubObject ): None, post_parameters ) - return RepositoryKey.RepositoryKey( self._requester, data, completed = True, repoUrl = self._url ) + return RepositoryKey.RepositoryKey(self._requester, data, completed=True, repoUrl=self._url) - def create_label( self, name, color ): - assert isinstance( name, ( str, unicode ) ), name - assert isinstance( color, ( str, unicode ) ), color + def create_label(self, name, color): + assert isinstance(name, (str, unicode)), name + assert isinstance(color, (str, unicode)), color post_parameters = { "name": name, "color": color, @@ -403,50 +404,50 @@ class Repository( GithubObject.GithubObject ): None, post_parameters ) - return Label.Label( self._requester, data, completed = True ) + return Label.Label(self._requester, data, completed=True) - def create_milestone( self, title, state = GithubObject.NotSet, description = GithubObject.NotSet, due_on = GithubObject.NotSet ): - assert isinstance( title, ( str, unicode ) ), title - assert state is GithubObject.NotSet or isinstance( state, ( str, unicode ) ), state - assert description is GithubObject.NotSet or isinstance( description, ( str, unicode ) ), description - assert due_on is GithubObject.NotSet or isinstance( due_on, datetime.date ), due_on + def create_milestone(self, title, state=GithubObject.NotSet, description=GithubObject.NotSet, due_on=GithubObject.NotSet): + assert isinstance(title, (str, unicode)), title + assert state is GithubObject.NotSet or isinstance(state, (str, unicode)), state + assert description is GithubObject.NotSet or isinstance(description, (str, unicode)), description + assert due_on is GithubObject.NotSet or isinstance(due_on, datetime.date), due_on post_parameters = { "title": title, } if state is not GithubObject.NotSet: - post_parameters[ "state" ] = state + post_parameters["state"] = state if description is not GithubObject.NotSet: - post_parameters[ "description" ] = description + post_parameters["description"] = description if due_on is not GithubObject.NotSet: - post_parameters[ "due_on" ] = due_on.strftime( "%Y-%m-%d" ) + post_parameters["due_on"] = due_on.strftime("%Y-%m-%d") headers, data = self._requester.requestAndCheck( "POST", self.url + "/milestones", None, post_parameters ) - return Milestone.Milestone( self._requester, data, completed = True ) + return Milestone.Milestone(self._requester, data, completed=True) - def create_pull( self, *args, **kwds ): - if len( args ) + len( kwds ) == 4: - return self.__create_pull_1( *args, **kwds ) + def create_pull(self, *args, **kwds): + if len(args) + len(kwds) == 4: + return self.__create_pull_1(*args, **kwds) else: - return self.__create_pull_2( *args, **kwds ) + return self.__create_pull_2(*args, **kwds) - def __create_pull_1( self, title, body, base, head ): - assert isinstance( title, ( str, unicode ) ), title - assert isinstance( body, ( str, unicode ) ), body - assert isinstance( base, ( str, unicode ) ), base - assert isinstance( head, ( str, unicode ) ), head - return self.__create_pull( title = title, body = body, base = base, head = head ) + def __create_pull_1(self, title, body, base, head): + assert isinstance(title, (str, unicode)), title + assert isinstance(body, (str, unicode)), body + assert isinstance(base, (str, unicode)), base + assert isinstance(head, (str, unicode)), head + return self.__create_pull(title=title, body=body, base=base, head=head) - def __create_pull_2( self, issue, base, head ): - assert isinstance( issue, Issue.Issue ), issue - assert isinstance( base, ( str, unicode ) ), base - assert isinstance( head, ( str, unicode ) ), head - return self.__create_pull( issue = issue._identity, base = base, head = head ) + def __create_pull_2(self, issue, base, head): + assert isinstance(issue, Issue.Issue), issue + assert isinstance(base, (str, unicode)), base + assert isinstance(head, (str, unicode)), head + return self.__create_pull(issue=issue._identity, base=base, head=head) - def __create_pull( self, **kwds ): + def __create_pull(self, **kwds): post_parameters = kwds headers, data = self._requester.requestAndCheck( "POST", @@ -454,9 +455,9 @@ class Repository( GithubObject.GithubObject ): None, post_parameters ) - return PullRequest.PullRequest( self._requester, data, completed = True ) + return PullRequest.PullRequest(self._requester, data, completed=True) - def delete( self ): + def delete(self): headers, data = self._requester.requestAndCheck( "DELETE", self.url, @@ -464,40 +465,40 @@ class Repository( GithubObject.GithubObject ): None ) - def edit( self, name, description = GithubObject.NotSet, homepage = GithubObject.NotSet, public = GithubObject.NotSet, has_issues = GithubObject.NotSet, has_wiki = GithubObject.NotSet, has_downloads = GithubObject.NotSet ): - assert isinstance( name, ( str, unicode ) ), name - assert description is GithubObject.NotSet or isinstance( description, ( str, unicode ) ), description - assert homepage is GithubObject.NotSet or isinstance( homepage, ( str, unicode ) ), homepage - assert public is GithubObject.NotSet or isinstance( public, bool ), public - assert has_issues is GithubObject.NotSet or isinstance( has_issues, bool ), has_issues - assert has_wiki is GithubObject.NotSet or isinstance( has_wiki, bool ), has_wiki - assert has_downloads is GithubObject.NotSet or isinstance( has_downloads, bool ), has_downloads + def edit(self, name, description=GithubObject.NotSet, homepage=GithubObject.NotSet, public=GithubObject.NotSet, has_issues=GithubObject.NotSet, has_wiki=GithubObject.NotSet, has_downloads=GithubObject.NotSet): + assert isinstance(name, (str, unicode)), name + assert description is GithubObject.NotSet or isinstance(description, (str, unicode)), description + assert homepage is GithubObject.NotSet or isinstance(homepage, (str, unicode)), homepage + assert public is GithubObject.NotSet or isinstance(public, bool), public + assert has_issues is GithubObject.NotSet or isinstance(has_issues, bool), has_issues + assert has_wiki is GithubObject.NotSet or isinstance(has_wiki, bool), has_wiki + assert has_downloads is GithubObject.NotSet or isinstance(has_downloads, bool), has_downloads post_parameters = { "name": name, } if description is not GithubObject.NotSet: - post_parameters[ "description" ] = description + post_parameters["description"] = description if homepage is not GithubObject.NotSet: - post_parameters[ "homepage" ] = homepage + post_parameters["homepage"] = homepage if public is not GithubObject.NotSet: - post_parameters[ "public" ] = public + post_parameters["public"] = public if has_issues is not GithubObject.NotSet: - post_parameters[ "has_issues" ] = has_issues + post_parameters["has_issues"] = has_issues if has_wiki is not GithubObject.NotSet: - post_parameters[ "has_wiki" ] = has_wiki + post_parameters["has_wiki"] = has_wiki if has_downloads is not GithubObject.NotSet: - post_parameters[ "has_downloads" ] = has_downloads + post_parameters["has_downloads"] = has_downloads headers, data = self._requester.requestAndCheck( "PATCH", self.url, None, post_parameters ) - self._useAttributes( data ) + self._useAttributes(data) - def get_archive_link( self, archive_format, ref = GithubObject.NotSet ): - assert isinstance( archive_format, ( str, unicode ) ), archive_format - assert ref is GithubObject.NotSet or isinstance( ref, ( str, unicode ) ), ref + def get_archive_link(self, archive_format, ref=GithubObject.NotSet): + assert isinstance(archive_format, (str, unicode)), archive_format + assert ref is GithubObject.NotSet or isinstance(ref, (str, unicode)), ref url = self.url + "/" + archive_format if ref is not GithubObject.NotSet: url += "/" + ref @@ -507,9 +508,9 @@ class Repository( GithubObject.GithubObject ): None, None ) - return headers[ "location" ] + return headers["location"] - def get_assignees( self ): + def get_assignees(self): return PaginatedList.PaginatedList( NamedUser.NamedUser, self._requester, @@ -517,17 +518,17 @@ class Repository( GithubObject.GithubObject ): None ) - def get_branch( self, branch ): - assert isinstance( branch, ( str, unicode ) ), branch + def get_branch(self, branch): + assert isinstance(branch, (str, unicode)), branch headers, data = self._requester.requestAndCheck( "GET", self.url + "/branches/" + branch, None, None ) - return Branch.Branch( self._requester, data, completed = True ) + return Branch.Branch(self._requester, data, completed=True) - def get_branches( self ): + def get_branches(self): return PaginatedList.PaginatedList( Branch.Branch, self._requester, @@ -535,7 +536,7 @@ class Repository( GithubObject.GithubObject ): None ) - def get_collaborators( self ): + def get_collaborators(self): return PaginatedList.PaginatedList( NamedUser.NamedUser, self._requester, @@ -543,17 +544,17 @@ class Repository( GithubObject.GithubObject ): None ) - def get_comment( self, id ): - assert isinstance( id, int ), id + def get_comment(self, id): + assert isinstance(id, int), id headers, data = self._requester.requestAndCheck( "GET", - self.url + "/comments/" + str( id ), + self.url + "/comments/" + str(id), None, None ) - return CommitComment.CommitComment( self._requester, data, completed = True ) + return CommitComment.CommitComment(self._requester, data, completed=True) - def get_comments( self ): + def get_comments(self): return PaginatedList.PaginatedList( CommitComment.CommitComment, self._requester, @@ -561,24 +562,24 @@ class Repository( GithubObject.GithubObject ): None ) - def get_commit( self, sha ): - assert isinstance( sha, ( str, unicode ) ), sha + def get_commit(self, sha): + assert isinstance(sha, (str, unicode)), sha headers, data = self._requester.requestAndCheck( "GET", self.url + "/commits/" + sha, None, None ) - return Commit.Commit( self._requester, data, completed = True ) + return Commit.Commit(self._requester, data, completed=True) - def get_commits( self, sha = GithubObject.NotSet, path = GithubObject.NotSet ): - assert sha is GithubObject.NotSet or isinstance( sha, ( str, unicode ) ), sha - assert path is GithubObject.NotSet or isinstance( path, ( str, unicode ) ), path + def get_commits(self, sha=GithubObject.NotSet, path=GithubObject.NotSet): + assert sha is GithubObject.NotSet or isinstance(sha, (str, unicode)), sha + assert path is GithubObject.NotSet or isinstance(path, (str, unicode)), path url_parameters = dict() if sha is not GithubObject.NotSet: - url_parameters[ "sha" ] = sha + url_parameters["sha"] = sha if path is not GithubObject.NotSet: - url_parameters[ "path" ] = path + url_parameters["path"] = path return PaginatedList.PaginatedList( Commit.Commit, self._requester, @@ -586,17 +587,17 @@ class Repository( GithubObject.GithubObject ): url_parameters ) - def get_contents( self, path ): - assert isinstance( path, ( str, unicode ) ), path + def get_contents(self, path): + assert isinstance(path, (str, unicode)), path headers, data = self._requester.requestAndCheck( "GET", self.url + "/contents" + path, None, None ) - return ContentFile.ContentFile( self._requester, data, completed = True ) + return ContentFile.ContentFile(self._requester, data, completed=True) - def get_contributors( self ): + def get_contributors(self): return PaginatedList.PaginatedList( NamedUser.NamedUser, self._requester, @@ -604,17 +605,17 @@ class Repository( GithubObject.GithubObject ): None ) - def get_download( self, id ): - assert isinstance( id, int ), id + def get_download(self, id): + assert isinstance(id, int), id headers, data = self._requester.requestAndCheck( "GET", - self.url + "/downloads/" + str( id ), + self.url + "/downloads/" + str(id), None, None ) - return Download.Download( self._requester, data, completed = True ) + return Download.Download(self._requester, data, completed=True) - def get_downloads( self ): + def get_downloads(self): return PaginatedList.PaginatedList( Download.Download, self._requester, @@ -622,7 +623,7 @@ class Repository( GithubObject.GithubObject ): None ) - def get_events( self ): + def get_events(self): return PaginatedList.PaginatedList( Event.Event, self._requester, @@ -630,7 +631,7 @@ class Repository( GithubObject.GithubObject ): None ) - def get_forks( self ): + def get_forks(self): return PaginatedList.PaginatedList( Repository, self._requester, @@ -638,37 +639,37 @@ class Repository( GithubObject.GithubObject ): None ) - def get_git_blob( self, sha ): - assert isinstance( sha, ( str, unicode ) ), sha + def get_git_blob(self, sha): + assert isinstance(sha, (str, unicode)), sha headers, data = self._requester.requestAndCheck( "GET", self.url + "/git/blobs/" + sha, None, None ) - return GitBlob.GitBlob( self._requester, data, completed = True ) + return GitBlob.GitBlob(self._requester, data, completed=True) - def get_git_commit( self, sha ): - assert isinstance( sha, ( str, unicode ) ), sha + def get_git_commit(self, sha): + assert isinstance(sha, (str, unicode)), sha headers, data = self._requester.requestAndCheck( "GET", self.url + "/git/commits/" + sha, None, None ) - return GitCommit.GitCommit( self._requester, data, completed = True ) + return GitCommit.GitCommit(self._requester, data, completed=True) - def get_git_ref( self, ref ): - assert isinstance( ref, ( str, unicode ) ), ref + def get_git_ref(self, ref): + assert isinstance(ref, (str, unicode)), ref headers, data = self._requester.requestAndCheck( "GET", self.url + "/git/" + ref, None, None ) - return GitRef.GitRef( self._requester, data, completed = True ) + return GitRef.GitRef(self._requester, data, completed=True) - def get_git_refs( self ): + def get_git_refs(self): return PaginatedList.PaginatedList( GitRef.GitRef, self._requester, @@ -676,41 +677,41 @@ class Repository( GithubObject.GithubObject ): None ) - def get_git_tag( self, sha ): - assert isinstance( sha, ( str, unicode ) ), sha + def get_git_tag(self, sha): + assert isinstance(sha, (str, unicode)), sha headers, data = self._requester.requestAndCheck( "GET", self.url + "/git/tags/" + sha, None, None ) - return GitTag.GitTag( self._requester, data, completed = True ) + return GitTag.GitTag(self._requester, data, completed=True) - def get_git_tree( self, sha, recursive = GithubObject.NotSet ): - assert isinstance( sha, ( str, unicode ) ), sha - assert recursive is GithubObject.NotSet or isinstance( recursive, bool ), recursive + def get_git_tree(self, sha, recursive=GithubObject.NotSet): + assert isinstance(sha, (str, unicode)), sha + assert recursive is GithubObject.NotSet or isinstance(recursive, bool), recursive url_parameters = dict() if recursive is not GithubObject.NotSet: - url_parameters[ "recursive" ] = recursive + url_parameters["recursive"] = recursive headers, data = self._requester.requestAndCheck( "GET", self.url + "/git/trees/" + sha, url_parameters, None ) - return GitTree.GitTree( self._requester, data, completed = True ) + return GitTree.GitTree(self._requester, data, completed=True) - def get_hook( self, id ): - assert isinstance( id, int ), id + def get_hook(self, id): + assert isinstance(id, int), id headers, data = self._requester.requestAndCheck( "GET", - self.url + "/hooks/" + str( id ), + self.url + "/hooks/" + str(id), None, None ) - return Hook.Hook( self._requester, data, completed = True ) + return Hook.Hook(self._requester, data, completed=True) - def get_hooks( self ): + def get_hooks(self): return PaginatedList.PaginatedList( Hook.Hook, self._requester, @@ -718,48 +719,48 @@ class Repository( GithubObject.GithubObject ): None ) - def get_issue( self, number ): - assert isinstance( number, int ), number + def get_issue(self, number): + assert isinstance(number, int), number headers, data = self._requester.requestAndCheck( "GET", - self.url + "/issues/" + str( number ), + self.url + "/issues/" + str(number), None, None ) - return Issue.Issue( self._requester, data, completed = True ) + return Issue.Issue(self._requester, data, completed=True) - def get_issues( self, milestone = GithubObject.NotSet, state = GithubObject.NotSet, assignee = GithubObject.NotSet, mentioned = GithubObject.NotSet, labels = GithubObject.NotSet, sort = GithubObject.NotSet, direction = GithubObject.NotSet, since = GithubObject.NotSet ): - assert milestone is GithubObject.NotSet or milestone == "*" or milestone == "none" or isinstance( milestone, Milestone.Milestone ), milestone - assert state is GithubObject.NotSet or isinstance( state, ( str, unicode ) ), state - assert assignee is GithubObject.NotSet or assignee == "*" or assignee == "none" or isinstance( assignee, NamedUser.NamedUser ), assignee - assert mentioned is GithubObject.NotSet or isinstance( mentioned, NamedUser.NamedUser ), mentioned - assert labels is GithubObject.NotSet or all( isinstance( element, Label.Label ) for element in labels ), labels - assert sort is GithubObject.NotSet or isinstance( sort, ( str, unicode ) ), sort - assert direction is GithubObject.NotSet or isinstance( direction, ( str, unicode ) ), direction - assert since is GithubObject.NotSet or isinstance( since, datetime.datetime ), since + def get_issues(self, milestone=GithubObject.NotSet, state=GithubObject.NotSet, assignee=GithubObject.NotSet, mentioned=GithubObject.NotSet, labels=GithubObject.NotSet, sort=GithubObject.NotSet, direction=GithubObject.NotSet, since=GithubObject.NotSet): + assert milestone is GithubObject.NotSet or milestone == "*" or milestone == "none" or isinstance(milestone, Milestone.Milestone), milestone + assert state is GithubObject.NotSet or isinstance(state, (str, unicode)), state + assert assignee is GithubObject.NotSet or assignee == "*" or assignee == "none" or isinstance(assignee, NamedUser.NamedUser), assignee + assert mentioned is GithubObject.NotSet or isinstance(mentioned, NamedUser.NamedUser), mentioned + assert labels is GithubObject.NotSet or all(isinstance(element, Label.Label) for element in labels), labels + assert sort is GithubObject.NotSet or isinstance(sort, (str, unicode)), sort + assert direction is GithubObject.NotSet or isinstance(direction, (str, unicode)), direction + assert since is GithubObject.NotSet or isinstance(since, datetime.datetime), since url_parameters = dict() if milestone is not GithubObject.NotSet: - if isinstance( milestone, str ): - url_parameters[ "milestone" ] = milestone + if isinstance(milestone, str): + url_parameters["milestone"] = milestone else: - url_parameters[ "milestone" ] = milestone._identity + url_parameters["milestone"] = milestone._identity if state is not GithubObject.NotSet: - url_parameters[ "state" ] = state + url_parameters["state"] = state if assignee is not GithubObject.NotSet: - if isinstance( assignee, str ): - url_parameters[ "assignee" ] = assignee + if isinstance(assignee, str): + url_parameters["assignee"] = assignee else: - url_parameters[ "assignee" ] = assignee._identity + url_parameters["assignee"] = assignee._identity if mentioned is not GithubObject.NotSet: - url_parameters[ "mentioned" ] = mentioned._identity + url_parameters["mentioned"] = mentioned._identity if labels is not GithubObject.NotSet: - url_parameters[ "labels" ] = ",".join( label.name for label in labels ) + url_parameters["labels"] = ",".join(label.name for label in labels) if sort is not GithubObject.NotSet: - url_parameters[ "sort" ] = sort + url_parameters["sort"] = sort if direction is not GithubObject.NotSet: - url_parameters[ "direction" ] = direction + url_parameters["direction"] = direction if since is not GithubObject.NotSet: - url_parameters[ "since" ] = since.strftime( "%Y-%m-%dT%H:%M:%SZ" ) + url_parameters["since"] = since.strftime("%Y-%m-%dT%H:%M:%SZ") return PaginatedList.PaginatedList( Issue.Issue, self._requester, @@ -767,17 +768,17 @@ class Repository( GithubObject.GithubObject ): url_parameters ) - def get_issues_event( self, id ): - assert isinstance( id, int ), id + def get_issues_event(self, id): + assert isinstance(id, int), id headers, data = self._requester.requestAndCheck( "GET", - self.url + "/issues/events/" + str( id ), + self.url + "/issues/events/" + str(id), None, None ) - return IssueEvent.IssueEvent( self._requester, data, completed = True ) + return IssueEvent.IssueEvent(self._requester, data, completed=True) - def get_issues_events( self ): + def get_issues_events(self): return PaginatedList.PaginatedList( IssueEvent.IssueEvent, self._requester, @@ -785,35 +786,35 @@ class Repository( GithubObject.GithubObject ): None ) - def get_key( self, id ): - assert isinstance( id, int ), id + def get_key(self, id): + assert isinstance(id, int), id headers, data = self._requester.requestAndCheck( "GET", - self.url + "/keys/" + str( id ), + self.url + "/keys/" + str(id), None, None ) - return RepositoryKey.RepositoryKey( self._requester, data, completed = True, repoUrl = self._url ) + return RepositoryKey.RepositoryKey(self._requester, data, completed=True, repoUrl=self._url) - def get_keys( self ): + def get_keys(self): return PaginatedList.PaginatedList( - lambda requester, data, completed: RepositoryKey.RepositoryKey( requester, data, completed, repoUrl = self._url ), + lambda requester, data, completed: RepositoryKey.RepositoryKey(requester, data, completed, repoUrl=self._url), self._requester, self.url + "/keys", None ) - def get_label( self, name ): - assert isinstance( name, ( str, unicode ) ), name + def get_label(self, name): + assert isinstance(name, (str, unicode)), name headers, data = self._requester.requestAndCheck( "GET", - self.url + "/labels/" + urllib.quote( name ), + self.url + "/labels/" + urllib.quote(name), None, None ) - return Label.Label( self._requester, data, completed = True ) + return Label.Label(self._requester, data, completed=True) - def get_labels( self ): + def get_labels(self): return PaginatedList.PaginatedList( Label.Label, self._requester, @@ -821,7 +822,7 @@ class Repository( GithubObject.GithubObject ): None ) - def get_languages( self ): + def get_languages(self): headers, data = self._requester.requestAndCheck( "GET", self.url + "/languages", @@ -830,27 +831,27 @@ class Repository( GithubObject.GithubObject ): ) return data - def get_milestone( self, number ): - assert isinstance( number, int ), number + def get_milestone(self, number): + assert isinstance(number, int), number headers, data = self._requester.requestAndCheck( "GET", - self.url + "/milestones/" + str( number ), + self.url + "/milestones/" + str(number), None, None ) - return Milestone.Milestone( self._requester, data, completed = True ) + return Milestone.Milestone(self._requester, data, completed=True) - def get_milestones( self, state = GithubObject.NotSet, sort = GithubObject.NotSet, direction = GithubObject.NotSet ): - assert state is GithubObject.NotSet or isinstance( state, ( str, unicode ) ), state - assert sort is GithubObject.NotSet or isinstance( sort, ( str, unicode ) ), sort - assert direction is GithubObject.NotSet or isinstance( direction, ( str, unicode ) ), direction + def get_milestones(self, state=GithubObject.NotSet, sort=GithubObject.NotSet, direction=GithubObject.NotSet): + assert state is GithubObject.NotSet or isinstance(state, (str, unicode)), state + assert sort is GithubObject.NotSet or isinstance(sort, (str, unicode)), sort + assert direction is GithubObject.NotSet or isinstance(direction, (str, unicode)), direction url_parameters = dict() if state is not GithubObject.NotSet: - url_parameters[ "state" ] = state + url_parameters["state"] = state if sort is not GithubObject.NotSet: - url_parameters[ "sort" ] = sort + url_parameters["sort"] = sort if direction is not GithubObject.NotSet: - url_parameters[ "direction" ] = direction + url_parameters["direction"] = direction return PaginatedList.PaginatedList( Milestone.Milestone, self._requester, @@ -858,7 +859,7 @@ class Repository( GithubObject.GithubObject ): url_parameters ) - def get_network_events( self ): + def get_network_events(self): return PaginatedList.PaginatedList( Event.Event, self._requester, @@ -866,21 +867,21 @@ class Repository( GithubObject.GithubObject ): None ) - def get_pull( self, number ): - assert isinstance( number, int ), number + def get_pull(self, number): + assert isinstance(number, int), number headers, data = self._requester.requestAndCheck( "GET", - self.url + "/pulls/" + str( number ), + self.url + "/pulls/" + str(number), None, None ) - return PullRequest.PullRequest( self._requester, data, completed = True ) + return PullRequest.PullRequest(self._requester, data, completed=True) - def get_pulls( self, state = GithubObject.NotSet ): - assert state is GithubObject.NotSet or isinstance( state, ( str, unicode ) ), state + def get_pulls(self, state=GithubObject.NotSet): + assert state is GithubObject.NotSet or isinstance(state, (str, unicode)), state url_parameters = dict() if state is not GithubObject.NotSet: - url_parameters[ "state" ] = state + url_parameters["state"] = state return PaginatedList.PaginatedList( PullRequest.PullRequest, self._requester, @@ -888,16 +889,16 @@ class Repository( GithubObject.GithubObject ): url_parameters ) - def get_readme( self ): + def get_readme(self): headers, data = self._requester.requestAndCheck( "GET", self.url + "/readme", None, None ) - return ContentFile.ContentFile( self._requester, data, completed = True ) + return ContentFile.ContentFile(self._requester, data, completed=True) - def get_stargazers( self ): + def get_stargazers(self): return PaginatedList.PaginatedList( NamedUser.NamedUser, self._requester, @@ -905,7 +906,7 @@ class Repository( GithubObject.GithubObject ): None ) - def get_subscribers( self ): + def get_subscribers(self): return PaginatedList.PaginatedList( NamedUser.NamedUser, self._requester, @@ -913,7 +914,7 @@ class Repository( GithubObject.GithubObject ): None ) - def get_tags( self ): + def get_tags(self): return PaginatedList.PaginatedList( Tag.Tag, self._requester, @@ -921,7 +922,7 @@ class Repository( GithubObject.GithubObject ): None ) - def get_teams( self ): + def get_teams(self): return PaginatedList.PaginatedList( Team.Team, self._requester, @@ -929,7 +930,7 @@ class Repository( GithubObject.GithubObject ): None ) - def get_watchers( self ): + def get_watchers(self): return PaginatedList.PaginatedList( NamedUser.NamedUser, self._requester, @@ -937,8 +938,8 @@ class Repository( GithubObject.GithubObject ): None ) - def has_in_assignees( self, assignee ): - assert isinstance( assignee, NamedUser.NamedUser ), assignee + def has_in_assignees(self, assignee): + assert isinstance(assignee, NamedUser.NamedUser), assignee status, headers, data = self._requester.requestRaw( "GET", self.url + "/assignees/" + assignee._identity, @@ -947,8 +948,8 @@ class Repository( GithubObject.GithubObject ): ) return status == 204 - def has_in_collaborators( self, collaborator ): - assert isinstance( collaborator, NamedUser.NamedUser ), collaborator + def has_in_collaborators(self, collaborator): + assert isinstance(collaborator, NamedUser.NamedUser), collaborator status, headers, data = self._requester.requestRaw( "GET", self.url + "/collaborators/" + collaborator._identity, @@ -957,30 +958,30 @@ class Repository( GithubObject.GithubObject ): ) return status == 204 - def legacy_search_issues( self, state, keyword ): - assert state in [ "open", "closed" ], state - assert isinstance( keyword, ( str, unicode ) ), keyword + def legacy_search_issues(self, state, keyword): + assert state in ["open", "closed"], state + assert isinstance(keyword, (str, unicode)), keyword headers, data = self._requester.requestAndCheck( "GET", - "/legacy/issues/search/" + self.owner.login + "/" + self.name + "/" + state + "/" + urllib.quote( keyword ), + "/legacy/issues/search/" + self.owner.login + "/" + self.name + "/" + state + "/" + urllib.quote(keyword), None, None ) return [ - Issue.Issue( self._requester, Legacy.convertIssue( element ), completed = False ) - for element in data[ "issues" ] + Issue.Issue(self._requester, Legacy.convertIssue(element), completed=False) + for element in data["issues"] ] - def merge( self, base, head, commit_message = GithubObject.NotSet ): - assert isinstance( base, ( str, unicode ) ), base - assert isinstance( head, ( str, unicode ) ), head - assert commit_message is GithubObject.NotSet or isinstance( commit_message, ( str, unicode ) ), commit_message + def merge(self, base, head, commit_message=GithubObject.NotSet): + assert isinstance(base, (str, unicode)), base + assert isinstance(head, (str, unicode)), head + assert commit_message is GithubObject.NotSet or isinstance(commit_message, (str, unicode)), commit_message post_parameters = { "base": base, "head": head, } if commit_message is not GithubObject.NotSet: - post_parameters[ "commit_message" ] = commit_message + post_parameters["commit_message"] = commit_message headers, data = self._requester.requestAndCheck( "POST", self.url + "/merges", @@ -990,10 +991,10 @@ class Repository( GithubObject.GithubObject ): if data is None: return None else: - return Commit.Commit( self._requester, data, completed = True ) + return Commit.Commit(self._requester, data, completed=True) - def remove_from_collaborators( self, collaborator ): - assert isinstance( collaborator, NamedUser.NamedUser ), collaborator + def remove_from_collaborators(self, collaborator): + assert isinstance(collaborator, NamedUser.NamedUser), collaborator headers, data = self._requester.requestAndCheck( "DELETE", self.url + "/collaborators/" + collaborator._identity, @@ -1002,10 +1003,10 @@ class Repository( GithubObject.GithubObject ): ) @property - def _identity( self ): + def _identity(self): return self.owner.login + "/" + self.name - def _initAttributes( self ): + def _initAttributes(self): self._clone_url = GithubObject.NotSet self._created_at = GithubObject.NotSet self._description = GithubObject.NotSet @@ -1037,94 +1038,94 @@ class Repository( GithubObject.GithubObject ): self._url = GithubObject.NotSet self._watchers = GithubObject.NotSet - def _useAttributes( self, attributes ): - if "clone_url" in attributes: # pragma no branch - assert attributes[ "clone_url" ] is None or isinstance( attributes[ "clone_url" ], ( str, unicode ) ), attributes[ "clone_url" ] - self._clone_url = attributes[ "clone_url" ] - if "created_at" in attributes: # pragma no branch - assert attributes[ "created_at" ] is None or isinstance( attributes[ "created_at" ], ( str, unicode ) ), attributes[ "created_at" ] - self._created_at = self._parseDatetime( attributes[ "created_at" ] ) - if "description" in attributes: # pragma no branch - assert attributes[ "description" ] is None or isinstance( attributes[ "description" ], ( str, unicode ) ), attributes[ "description" ] - self._description = attributes[ "description" ] - if "fork" in attributes: # pragma no branch - assert attributes[ "fork" ] is None or isinstance( attributes[ "fork" ], bool ), attributes[ "fork" ] - self._fork = attributes[ "fork" ] - if "forks" in attributes: # pragma no branch - assert attributes[ "forks" ] is None or isinstance( attributes[ "forks" ], int ), attributes[ "forks" ] - self._forks = attributes[ "forks" ] - if "full_name" in attributes: # pragma no branch - assert attributes[ "full_name" ] is None or isinstance( attributes[ "full_name" ], ( str, unicode ) ), attributes[ "full_name" ] - self._full_name = attributes[ "full_name" ] - if "git_url" in attributes: # pragma no branch - assert attributes[ "git_url" ] is None or isinstance( attributes[ "git_url" ], ( str, unicode ) ), attributes[ "git_url" ] - self._git_url = attributes[ "git_url" ] - if "has_downloads" in attributes: # pragma no branch - assert attributes[ "has_downloads" ] is None or isinstance( attributes[ "has_downloads" ], bool ), attributes[ "has_downloads" ] - self._has_downloads = attributes[ "has_downloads" ] - if "has_issues" in attributes: # pragma no branch - assert attributes[ "has_issues" ] is None or isinstance( attributes[ "has_issues" ], bool ), attributes[ "has_issues" ] - self._has_issues = attributes[ "has_issues" ] - if "has_wiki" in attributes: # pragma no branch - assert attributes[ "has_wiki" ] is None or isinstance( attributes[ "has_wiki" ], bool ), attributes[ "has_wiki" ] - self._has_wiki = attributes[ "has_wiki" ] - if "homepage" in attributes: # pragma no branch - assert attributes[ "homepage" ] is None or isinstance( attributes[ "homepage" ], ( str, unicode ) ), attributes[ "homepage" ] - self._homepage = attributes[ "homepage" ] - if "html_url" in attributes: # pragma no branch - assert attributes[ "html_url" ] is None or isinstance( attributes[ "html_url" ], ( str, unicode ) ), attributes[ "html_url" ] - self._html_url = attributes[ "html_url" ] - if "id" in attributes: # pragma no branch - assert attributes[ "id" ] is None or isinstance( attributes[ "id" ], int ), attributes[ "id" ] - self._id = attributes[ "id" ] - if "language" in attributes: # pragma no branch - assert attributes[ "language" ] is None or isinstance( attributes[ "language" ], ( str, unicode ) ), attributes[ "language" ] - self._language = attributes[ "language" ] - if "master_branch" in attributes: # pragma no branch - assert attributes[ "master_branch" ] is None or isinstance( attributes[ "master_branch" ], ( str, unicode ) ), attributes[ "master_branch" ] - self._master_branch = attributes[ "master_branch" ] - if "name" in attributes: # pragma no branch - assert attributes[ "name" ] is None or isinstance( attributes[ "name" ], ( str, unicode ) ), attributes[ "name" ] - self._name = attributes[ "name" ] - if "open_issues" in attributes: # pragma no branch - assert attributes[ "open_issues" ] is None or isinstance( attributes[ "open_issues" ], int ), attributes[ "open_issues" ] - self._open_issues = attributes[ "open_issues" ] - if "organization" in attributes: # pragma no branch - assert attributes[ "organization" ] is None or isinstance( attributes[ "organization" ], dict ), attributes[ "organization" ] - self._organization = None if attributes[ "organization" ] is None else Organization.Organization( self._requester, attributes[ "organization" ], completed = False ) - if "owner" in attributes: # pragma no branch - assert attributes[ "owner" ] is None or isinstance( attributes[ "owner" ], dict ), attributes[ "owner" ] - self._owner = None if attributes[ "owner" ] is None else NamedUser.NamedUser( self._requester, attributes[ "owner" ], completed = False ) - if "parent" in attributes: # pragma no branch - assert attributes[ "parent" ] is None or isinstance( attributes[ "parent" ], dict ), attributes[ "parent" ] - self._parent = None if attributes[ "parent" ] is None else Repository( self._requester, attributes[ "parent" ], completed = False ) - if "permissions" in attributes: # pragma no branch - assert attributes[ "permissions" ] is None or isinstance( attributes[ "permissions" ], dict ), attributes[ "permissions" ] - self._permissions = None if attributes[ "permissions" ] is None else Permissions.Permissions( self._requester, attributes[ "permissions" ], completed = False ) - if "private" in attributes: # pragma no branch - assert attributes[ "private" ] is None or isinstance( attributes[ "private" ], bool ), attributes[ "private" ] - self._private = attributes[ "private" ] - if "pushed_at" in attributes: # pragma no branch - assert attributes[ "pushed_at" ] is None or isinstance( attributes[ "pushed_at" ], ( str, unicode ) ), attributes[ "pushed_at" ] - self._pushed_at = self._parseDatetime( attributes[ "pushed_at" ] ) - if "size" in attributes: # pragma no branch - assert attributes[ "size" ] is None or isinstance( attributes[ "size" ], int ), attributes[ "size" ] - self._size = attributes[ "size" ] - if "source" in attributes: # pragma no branch - assert attributes[ "source" ] is None or isinstance( attributes[ "source" ], dict ), attributes[ "source" ] - self._source = None if attributes[ "source" ] is None else Repository( self._requester, attributes[ "source" ], completed = False ) - if "ssh_url" in attributes: # pragma no branch - assert attributes[ "ssh_url" ] is None or isinstance( attributes[ "ssh_url" ], ( str, unicode ) ), attributes[ "ssh_url" ] - self._ssh_url = attributes[ "ssh_url" ] - if "svn_url" in attributes: # pragma no branch - assert attributes[ "svn_url" ] is None or isinstance( attributes[ "svn_url" ], ( str, unicode ) ), attributes[ "svn_url" ] - self._svn_url = attributes[ "svn_url" ] - if "updated_at" in attributes: # pragma no branch - assert attributes[ "updated_at" ] is None or isinstance( attributes[ "updated_at" ], ( str, unicode ) ), attributes[ "updated_at" ] - self._updated_at = self._parseDatetime( attributes[ "updated_at" ] ) - if "url" in attributes: # pragma no branch - assert attributes[ "url" ] is None or isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ] - self._url = attributes[ "url" ] - if "watchers" in attributes: # pragma no branch - assert attributes[ "watchers" ] is None or isinstance( attributes[ "watchers" ], int ), attributes[ "watchers" ] - self._watchers = attributes[ "watchers" ] + def _useAttributes(self, attributes): + if "clone_url" in attributes: # pragma no branch + assert attributes["clone_url"] is None or isinstance(attributes["clone_url"], (str, unicode)), attributes["clone_url"] + self._clone_url = attributes["clone_url"] + if "created_at" in attributes: # pragma no branch + assert attributes["created_at"] is None or isinstance(attributes["created_at"], (str, unicode)), attributes["created_at"] + self._created_at = self._parseDatetime(attributes["created_at"]) + if "description" in attributes: # pragma no branch + assert attributes["description"] is None or isinstance(attributes["description"], (str, unicode)), attributes["description"] + self._description = attributes["description"] + if "fork" in attributes: # pragma no branch + assert attributes["fork"] is None or isinstance(attributes["fork"], bool), attributes["fork"] + self._fork = attributes["fork"] + if "forks" in attributes: # pragma no branch + assert attributes["forks"] is None or isinstance(attributes["forks"], int), attributes["forks"] + self._forks = attributes["forks"] + if "full_name" in attributes: # pragma no branch + assert attributes["full_name"] is None or isinstance(attributes["full_name"], (str, unicode)), attributes["full_name"] + self._full_name = attributes["full_name"] + if "git_url" in attributes: # pragma no branch + assert attributes["git_url"] is None or isinstance(attributes["git_url"], (str, unicode)), attributes["git_url"] + self._git_url = attributes["git_url"] + if "has_downloads" in attributes: # pragma no branch + assert attributes["has_downloads"] is None or isinstance(attributes["has_downloads"], bool), attributes["has_downloads"] + self._has_downloads = attributes["has_downloads"] + if "has_issues" in attributes: # pragma no branch + assert attributes["has_issues"] is None or isinstance(attributes["has_issues"], bool), attributes["has_issues"] + self._has_issues = attributes["has_issues"] + if "has_wiki" in attributes: # pragma no branch + assert attributes["has_wiki"] is None or isinstance(attributes["has_wiki"], bool), attributes["has_wiki"] + self._has_wiki = attributes["has_wiki"] + if "homepage" in attributes: # pragma no branch + assert attributes["homepage"] is None or isinstance(attributes["homepage"], (str, unicode)), attributes["homepage"] + self._homepage = attributes["homepage"] + if "html_url" in attributes: # pragma no branch + assert attributes["html_url"] is None or isinstance(attributes["html_url"], (str, unicode)), attributes["html_url"] + self._html_url = attributes["html_url"] + if "id" in attributes: # pragma no branch + assert attributes["id"] is None or isinstance(attributes["id"], int), attributes["id"] + self._id = attributes["id"] + if "language" in attributes: # pragma no branch + assert attributes["language"] is None or isinstance(attributes["language"], (str, unicode)), attributes["language"] + self._language = attributes["language"] + if "master_branch" in attributes: # pragma no branch + assert attributes["master_branch"] is None or isinstance(attributes["master_branch"], (str, unicode)), attributes["master_branch"] + self._master_branch = attributes["master_branch"] + if "name" in attributes: # pragma no branch + assert attributes["name"] is None or isinstance(attributes["name"], (str, unicode)), attributes["name"] + self._name = attributes["name"] + if "open_issues" in attributes: # pragma no branch + assert attributes["open_issues"] is None or isinstance(attributes["open_issues"], int), attributes["open_issues"] + self._open_issues = attributes["open_issues"] + if "organization" in attributes: # pragma no branch + assert attributes["organization"] is None or isinstance(attributes["organization"], dict), attributes["organization"] + self._organization = None if attributes["organization"] is None else Organization.Organization(self._requester, attributes["organization"], completed=False) + if "owner" in attributes: # pragma no branch + assert attributes["owner"] is None or isinstance(attributes["owner"], dict), attributes["owner"] + self._owner = None if attributes["owner"] is None else NamedUser.NamedUser(self._requester, attributes["owner"], completed=False) + if "parent" in attributes: # pragma no branch + assert attributes["parent"] is None or isinstance(attributes["parent"], dict), attributes["parent"] + self._parent = None if attributes["parent"] is None else Repository(self._requester, attributes["parent"], completed=False) + if "permissions" in attributes: # pragma no branch + assert attributes["permissions"] is None or isinstance(attributes["permissions"], dict), attributes["permissions"] + self._permissions = None if attributes["permissions"] is None else Permissions.Permissions(self._requester, attributes["permissions"], completed=False) + if "private" in attributes: # pragma no branch + assert attributes["private"] is None or isinstance(attributes["private"], bool), attributes["private"] + self._private = attributes["private"] + if "pushed_at" in attributes: # pragma no branch + assert attributes["pushed_at"] is None or isinstance(attributes["pushed_at"], (str, unicode)), attributes["pushed_at"] + self._pushed_at = self._parseDatetime(attributes["pushed_at"]) + if "size" in attributes: # pragma no branch + assert attributes["size"] is None or isinstance(attributes["size"], int), attributes["size"] + self._size = attributes["size"] + if "source" in attributes: # pragma no branch + assert attributes["source"] is None or isinstance(attributes["source"], dict), attributes["source"] + self._source = None if attributes["source"] is None else Repository(self._requester, attributes["source"], completed=False) + if "ssh_url" in attributes: # pragma no branch + assert attributes["ssh_url"] is None or isinstance(attributes["ssh_url"], (str, unicode)), attributes["ssh_url"] + self._ssh_url = attributes["ssh_url"] + if "svn_url" in attributes: # pragma no branch + assert attributes["svn_url"] is None or isinstance(attributes["svn_url"], (str, unicode)), attributes["svn_url"] + self._svn_url = attributes["svn_url"] + if "updated_at" in attributes: # pragma no branch + assert attributes["updated_at"] is None or isinstance(attributes["updated_at"], (str, unicode)), attributes["updated_at"] + self._updated_at = self._parseDatetime(attributes["updated_at"]) + if "url" in attributes: # pragma no branch + assert attributes["url"] is None or isinstance(attributes["url"], (str, unicode)), attributes["url"] + self._url = attributes["url"] + if "watchers" in attributes: # pragma no branch + assert attributes["watchers"] is None or isinstance(attributes["watchers"], int), attributes["watchers"] + self._watchers = attributes["watchers"] diff --git a/github/RepositoryKey.py b/github/RepositoryKey.py index 2d05745b..e094b775 100644 --- a/github/RepositoryKey.py +++ b/github/RepositoryKey.py @@ -13,40 +13,42 @@ import GithubObject -class RepositoryKey( GithubObject.GithubObject ): - def __init__( self, requester, attributes, completed, repoUrl ): - GithubObject.GithubObject.__init__( self, requester, attributes, completed ) + +class RepositoryKey(GithubObject.GithubObject): + def __init__(self, requester, attributes, completed, repoUrl): + GithubObject.GithubObject.__init__(self, requester, attributes, completed) self.__repoUrl = repoUrl - @property - def __customUrl( self ): - return self.__repoUrl + "/keys/" + str( self.id ) @property - def id( self ): - self._completeIfNotSet( self._id ) - return self._NoneIfNotSet( self._id ) + def __customUrl(self): + return self.__repoUrl + "/keys/" + str(self.id) @property - def key( self ): - self._completeIfNotSet( self._key ) - return self._NoneIfNotSet( self._key ) + def id(self): + self._completeIfNotSet(self._id) + return self._NoneIfNotSet(self._id) @property - def title( self ): - self._completeIfNotSet( self._title ) - return self._NoneIfNotSet( self._title ) + def key(self): + self._completeIfNotSet(self._key) + return self._NoneIfNotSet(self._key) @property - def url( self ): - self._completeIfNotSet( self._url ) - return self._NoneIfNotSet( self._url ) + def title(self): + self._completeIfNotSet(self._title) + return self._NoneIfNotSet(self._title) @property - def verified( self ): - self._completeIfNotSet( self._verified ) - return self._NoneIfNotSet( self._verified ) + def url(self): + self._completeIfNotSet(self._url) + return self._NoneIfNotSet(self._url) - def delete( self ): + @property + def verified(self): + self._completeIfNotSet(self._verified) + return self._NoneIfNotSet(self._verified) + + def delete(self): headers, data = self._requester.requestAndCheck( "DELETE", self.__customUrl, @@ -54,42 +56,42 @@ class RepositoryKey( GithubObject.GithubObject ): None ) - def edit( self, title = GithubObject.NotSet, key = GithubObject.NotSet ): - assert title is GithubObject.NotSet or isinstance( title, ( str, unicode ) ), title - assert key is GithubObject.NotSet or isinstance( key, ( str, unicode ) ), key + def edit(self, title=GithubObject.NotSet, key=GithubObject.NotSet): + assert title is GithubObject.NotSet or isinstance(title, (str, unicode)), title + assert key is GithubObject.NotSet or isinstance(key, (str, unicode)), key post_parameters = dict() if title is not GithubObject.NotSet: - post_parameters[ "title" ] = title + post_parameters["title"] = title if key is not GithubObject.NotSet: - post_parameters[ "key" ] = key + post_parameters["key"] = key headers, data = self._requester.requestAndCheck( "PATCH", self.__customUrl, None, post_parameters ) - self._useAttributes( data ) + self._useAttributes(data) - def _initAttributes( self ): + def _initAttributes(self): self._id = GithubObject.NotSet self._key = GithubObject.NotSet self._title = GithubObject.NotSet self._url = GithubObject.NotSet self._verified = GithubObject.NotSet - def _useAttributes( self, attributes ): - if "id" in attributes: # pragma no branch - assert attributes[ "id" ] is None or isinstance( attributes[ "id" ], int ), attributes[ "id" ] - self._id = attributes[ "id" ] - if "key" in attributes: # pragma no branch - assert attributes[ "key" ] is None or isinstance( attributes[ "key" ], ( str, unicode ) ), attributes[ "key" ] - self._key = attributes[ "key" ] - if "title" in attributes: # pragma no branch - assert attributes[ "title" ] is None or isinstance( attributes[ "title" ], ( str, unicode ) ), attributes[ "title" ] - self._title = attributes[ "title" ] - if "url" in attributes: # pragma no branch - assert attributes[ "url" ] is None or isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ] - self._url = attributes[ "url" ] - if "verified" in attributes: # pragma no branch - assert attributes[ "verified" ] is None or isinstance( attributes[ "verified" ], bool ), attributes[ "verified" ] - self._verified = attributes[ "verified" ] + def _useAttributes(self, attributes): + if "id" in attributes: # pragma no branch + assert attributes["id"] is None or isinstance(attributes["id"], int), attributes["id"] + self._id = attributes["id"] + if "key" in attributes: # pragma no branch + assert attributes["key"] is None or isinstance(attributes["key"], (str, unicode)), attributes["key"] + self._key = attributes["key"] + if "title" in attributes: # pragma no branch + assert attributes["title"] is None or isinstance(attributes["title"], (str, unicode)), attributes["title"] + self._title = attributes["title"] + if "url" in attributes: # pragma no branch + assert attributes["url"] is None or isinstance(attributes["url"], (str, unicode)), attributes["url"] + self._url = attributes["url"] + if "verified" in attributes: # pragma no branch + assert attributes["verified"] is None or isinstance(attributes["verified"], bool), attributes["verified"] + self._verified = attributes["verified"] diff --git a/github/Requester.py b/github/Requester.py index 3b2682cb..a209a90c 100644 --- a/github/Requester.py +++ b/github/Requester.py @@ -22,8 +22,8 @@ atLeastPython26 = sys.hexversion >= 0x02060000 if atLeastPython26: import json -else: #pragma no cover - import simplejson as json #pragma no cover +else: # pragma no cover + import simplejson as json # pragma no cover import GithubException import Logging @@ -34,14 +34,14 @@ class Requester: __httpsConnectionClass = httplib.HTTPSConnection @classmethod - def injectConnectionClasses( cls, httpConnectionClass, httpsConnectionClass ): + def injectConnectionClasses(cls, httpConnectionClass, httpsConnectionClass): cls.__httpConnectionClass = httpConnectionClass cls.__httpsConnectionClass = httpsConnectionClass - def __init__( self, login_or_token, password, base_url, timeout ): + def __init__(self, login_or_token, password, base_url, timeout): if password is not None: login = login_or_token - self.__authorizationHeader = "Basic " + base64.b64encode( login + ":" + password ).replace( '\n', '' ) + self.__authorizationHeader = "Basic " + base64.b64encode(login + ":" + password).replace('\n', '') elif login_or_token is not None: token = login_or_token self.__authorizationHeader = "token " + token @@ -49,7 +49,7 @@ class Requester: self.__authorizationHeader = None self.__base_url = base_url - o = urlparse.urlparse( base_url ) + o = urlparse.urlparse(base_url) self.__hostname = o.hostname self.__port = o.port self.__prefix = o.path @@ -60,28 +60,28 @@ class Requester: elif o.scheme == "http": self.__connectionClass = self.__httpConnectionClass else: - assert( False ) #pragma no cover - self.rate_limiting = ( 5000, 5000 ) + assert(False) # pragma no cover + self.rate_limiting = (5000, 5000) - def requestAndCheck( self, verb, url, parameters, input ): - status, headers, output = self.requestRaw( verb, url, parameters, input ) - output = self.__structuredFromJson( output ) + def requestAndCheck(self, verb, url, parameters, input): + status, headers, output = self.requestRaw(verb, url, parameters, input) + output = self.__structuredFromJson(output) if status >= 400: - raise GithubException.GithubException( status, output ) + raise GithubException.GithubException(status, output) return headers, output - def requestRaw( self, verb, url, parameters, input ): - assert verb in [ "HEAD", "GET", "POST", "PATCH", "PUT", "DELETE" ] + def requestRaw(self, verb, url, parameters, input): + assert verb in ["HEAD", "GET", "POST", "PATCH", "PUT", "DELETE"] - #URLs generated locally will be relative to __base_url - #URLs returned from the server will start with __base_url - if url.startswith( "/" ): + # URLs generated locally will be relative to __base_url + # URLs returned from the server will start with __base_url + if url.startswith("/"): url = self.__prefix + url else: - o = urlparse.urlparse( url ) - assert o.scheme == self.__scheme or o.scheme == "https" and self.__scheme == "http" # Issue #80 + o = urlparse.urlparse(url) + assert o.scheme == self.__scheme or o.scheme == "https" and self.__scheme == "http" # Issue #80 assert o.hostname == self.__hostname - assert o.path.startswith( self.__prefix ) + assert o.path.startswith(self.__prefix) assert o.port == self.__port url = o.path if o.query != "": @@ -89,42 +89,42 @@ class Requester: headers = dict() if self.__authorizationHeader is not None: - headers[ "Authorization" ] = self.__authorizationHeader + headers["Authorization"] = self.__authorizationHeader if atLeastPython26: - cnx = self.__connectionClass( host = self.__hostname, port = self.__port, strict = True, timeout = self.__timeout ) - else: #pragma no cover - cnx = self.__connectionClass( host = self.__hostname, port = self.__port, strict = True ) #pragma no cover + cnx = self.__connectionClass(host=self.__hostname, port=self.__port, strict=True, timeout=self.__timeout) + else: # pragma no cover + cnx = self.__connectionClass(host=self.__hostname, port=self.__port, strict=True) # pragma no cover cnx.request( verb, - self.__completeUrl( url, parameters ), - json.dumps( input ), + self.__completeUrl(url, parameters), + json.dumps(input), headers ) response = cnx.getresponse() status = response.status - headers = dict( response.getheaders() ) + headers = dict(response.getheaders()) output = response.read() cnx.close() if "x-ratelimit-remaining" in headers and "x-ratelimit-limit" in headers: - self.rate_limiting = ( int( headers[ "x-ratelimit-remaining" ] ), int( headers[ "x-ratelimit-limit" ] ) ) + self.rate_limiting = (int(headers["x-ratelimit-remaining"]), int(headers["x-ratelimit-limit"])) logger = Logging.get_logger() if logger.isEnabledFor(logging.DEBUG): logger.debug(' '.join(map(str, [verb, self.__base_url + url, parameters, input, "==>", status, str(headers), str(output)]))) return status, headers, output - def __completeUrl( self, url, parameters ): - if parameters is None or len( parameters ) == 0: + def __completeUrl(self, url, parameters): + if parameters is None or len(parameters) == 0: return url else: - return url + "?" + urllib.urlencode( parameters ) + return url + "?" + urllib.urlencode(parameters) - def __structuredFromJson( self, data ): - if len( data ) == 0: + def __structuredFromJson(self, data): + if len(data) == 0: return None else: - return json.loads( data ) + return json.loads(data) diff --git a/github/Tag.py b/github/Tag.py index 3ed86186..ab1f6fd3 100644 --- a/github/Tag.py +++ b/github/Tag.py @@ -15,39 +15,40 @@ import GithubObject import Commit -class Tag( GithubObject.BasicGithubObject ): + +class Tag(GithubObject.BasicGithubObject): @property - def commit( self ): - return self._NoneIfNotSet( self._commit ) + def commit(self): + return self._NoneIfNotSet(self._commit) @property - def name( self ): - return self._NoneIfNotSet( self._name ) + def name(self): + return self._NoneIfNotSet(self._name) @property - def tarball_url( self ): - return self._NoneIfNotSet( self._tarball_url ) + def tarball_url(self): + return self._NoneIfNotSet(self._tarball_url) @property - def zipball_url( self ): - return self._NoneIfNotSet( self._zipball_url ) + def zipball_url(self): + return self._NoneIfNotSet(self._zipball_url) - def _initAttributes( self ): + def _initAttributes(self): self._commit = GithubObject.NotSet self._name = GithubObject.NotSet self._tarball_url = GithubObject.NotSet self._zipball_url = GithubObject.NotSet - def _useAttributes( self, attributes ): - if "commit" in attributes: # pragma no branch - assert attributes[ "commit" ] is None or isinstance( attributes[ "commit" ], dict ), attributes[ "commit" ] - self._commit = None if attributes[ "commit" ] is None else Commit.Commit( self._requester, attributes[ "commit" ], completed = False ) - if "name" in attributes: # pragma no branch - assert attributes[ "name" ] is None or isinstance( attributes[ "name" ], ( str, unicode ) ), attributes[ "name" ] - self._name = attributes[ "name" ] - if "tarball_url" in attributes: # pragma no branch - assert attributes[ "tarball_url" ] is None or isinstance( attributes[ "tarball_url" ], ( str, unicode ) ), attributes[ "tarball_url" ] - self._tarball_url = attributes[ "tarball_url" ] - if "zipball_url" in attributes: # pragma no branch - assert attributes[ "zipball_url" ] is None or isinstance( attributes[ "zipball_url" ], ( str, unicode ) ), attributes[ "zipball_url" ] - self._zipball_url = attributes[ "zipball_url" ] + def _useAttributes(self, attributes): + if "commit" in attributes: # pragma no branch + assert attributes["commit"] is None or isinstance(attributes["commit"], dict), attributes["commit"] + self._commit = None if attributes["commit"] is None else Commit.Commit(self._requester, attributes["commit"], completed=False) + if "name" in attributes: # pragma no branch + assert attributes["name"] is None or isinstance(attributes["name"], (str, unicode)), attributes["name"] + self._name = attributes["name"] + if "tarball_url" in attributes: # pragma no branch + assert attributes["tarball_url"] is None or isinstance(attributes["tarball_url"], (str, unicode)), attributes["tarball_url"] + self._tarball_url = attributes["tarball_url"] + if "zipball_url" in attributes: # pragma no branch + assert attributes["zipball_url"] is None or isinstance(attributes["zipball_url"], (str, unicode)), attributes["zipball_url"] + self._zipball_url = attributes["zipball_url"] diff --git a/github/Team.py b/github/Team.py index 671ce655..342ee4ce 100644 --- a/github/Team.py +++ b/github/Team.py @@ -17,39 +17,40 @@ import PaginatedList import Repository import NamedUser -class Team( GithubObject.GithubObject ): + +class Team(GithubObject.GithubObject): @property - def id( self ): - self._completeIfNotSet( self._id ) - return self._NoneIfNotSet( self._id ) + def id(self): + self._completeIfNotSet(self._id) + return self._NoneIfNotSet(self._id) @property - def members_count( self ): - self._completeIfNotSet( self._members_count ) - return self._NoneIfNotSet( self._members_count ) + def members_count(self): + self._completeIfNotSet(self._members_count) + return self._NoneIfNotSet(self._members_count) @property - def name( self ): - self._completeIfNotSet( self._name ) - return self._NoneIfNotSet( self._name ) + def name(self): + self._completeIfNotSet(self._name) + return self._NoneIfNotSet(self._name) @property - def permission( self ): - self._completeIfNotSet( self._permission ) - return self._NoneIfNotSet( self._permission ) + def permission(self): + self._completeIfNotSet(self._permission) + return self._NoneIfNotSet(self._permission) @property - def repos_count( self ): - self._completeIfNotSet( self._repos_count ) - return self._NoneIfNotSet( self._repos_count ) + def repos_count(self): + self._completeIfNotSet(self._repos_count) + return self._NoneIfNotSet(self._repos_count) @property - def url( self ): - self._completeIfNotSet( self._url ) - return self._NoneIfNotSet( self._url ) + def url(self): + self._completeIfNotSet(self._url) + return self._NoneIfNotSet(self._url) - def add_to_members( self, member ): - assert isinstance( member, NamedUser.NamedUser ), member + def add_to_members(self, member): + assert isinstance(member, NamedUser.NamedUser), member headers, data = self._requester.requestAndCheck( "PUT", self.url + "/members/" + member._identity, @@ -57,8 +58,8 @@ class Team( GithubObject.GithubObject ): None ) - def add_to_repos( self, repo ): - assert isinstance( repo, Repository.Repository ), repo + def add_to_repos(self, repo): + assert isinstance(repo, Repository.Repository), repo headers, data = self._requester.requestAndCheck( "PUT", self.url + "/repos/" + repo._identity, @@ -66,7 +67,7 @@ class Team( GithubObject.GithubObject ): None ) - def delete( self ): + def delete(self): headers, data = self._requester.requestAndCheck( "DELETE", self.url, @@ -74,23 +75,23 @@ class Team( GithubObject.GithubObject ): None ) - def edit( self, name, permission = GithubObject.NotSet ): - assert isinstance( name, ( str, unicode ) ), name - assert permission is GithubObject.NotSet or isinstance( permission, ( str, unicode ) ), permission + def edit(self, name, permission=GithubObject.NotSet): + assert isinstance(name, (str, unicode)), name + assert permission is GithubObject.NotSet or isinstance(permission, (str, unicode)), permission post_parameters = { "name": name, } if permission is not GithubObject.NotSet: - post_parameters[ "permission" ] = permission + post_parameters["permission"] = permission headers, data = self._requester.requestAndCheck( "PATCH", self.url, None, post_parameters ) - self._useAttributes( data ) + self._useAttributes(data) - def get_members( self ): + def get_members(self): return PaginatedList.PaginatedList( NamedUser.NamedUser, self._requester, @@ -98,7 +99,7 @@ class Team( GithubObject.GithubObject ): None ) - def get_repos( self ): + def get_repos(self): return PaginatedList.PaginatedList( Repository.Repository, self._requester, @@ -106,8 +107,8 @@ class Team( GithubObject.GithubObject ): None ) - def has_in_members( self, member ): - assert isinstance( member, NamedUser.NamedUser ), member + def has_in_members(self, member): + assert isinstance(member, NamedUser.NamedUser), member status, headers, data = self._requester.requestRaw( "GET", self.url + "/members/" + member._identity, @@ -116,8 +117,8 @@ class Team( GithubObject.GithubObject ): ) return status == 204 - def has_in_repos( self, repo ): - assert isinstance( repo, Repository.Repository ), repo + def has_in_repos(self, repo): + assert isinstance(repo, Repository.Repository), repo status, headers, data = self._requester.requestRaw( "GET", self.url + "/repos/" + repo._identity, @@ -126,8 +127,8 @@ class Team( GithubObject.GithubObject ): ) return status == 204 - def remove_from_members( self, member ): - assert isinstance( member, NamedUser.NamedUser ), member + def remove_from_members(self, member): + assert isinstance(member, NamedUser.NamedUser), member headers, data = self._requester.requestAndCheck( "DELETE", self.url + "/members/" + member._identity, @@ -135,8 +136,8 @@ class Team( GithubObject.GithubObject ): None ) - def remove_from_repos( self, repo ): - assert isinstance( repo, Repository.Repository ), repo + def remove_from_repos(self, repo): + assert isinstance(repo, Repository.Repository), repo headers, data = self._requester.requestAndCheck( "DELETE", self.url + "/repos/" + repo._identity, @@ -145,10 +146,10 @@ class Team( GithubObject.GithubObject ): ) @property - def _identity( self ): + def _identity(self): return self.id - def _initAttributes( self ): + def _initAttributes(self): self._id = GithubObject.NotSet self._members_count = GithubObject.NotSet self._name = GithubObject.NotSet @@ -156,22 +157,22 @@ class Team( GithubObject.GithubObject ): self._repos_count = GithubObject.NotSet self._url = GithubObject.NotSet - def _useAttributes( self, attributes ): - if "id" in attributes: # pragma no branch - assert attributes[ "id" ] is None or isinstance( attributes[ "id" ], int ), attributes[ "id" ] - self._id = attributes[ "id" ] - if "members_count" in attributes: # pragma no branch - assert attributes[ "members_count" ] is None or isinstance( attributes[ "members_count" ], int ), attributes[ "members_count" ] - self._members_count = attributes[ "members_count" ] - if "name" in attributes: # pragma no branch - assert attributes[ "name" ] is None or isinstance( attributes[ "name" ], ( str, unicode ) ), attributes[ "name" ] - self._name = attributes[ "name" ] - if "permission" in attributes: # pragma no branch - assert attributes[ "permission" ] is None or isinstance( attributes[ "permission" ], ( str, unicode ) ), attributes[ "permission" ] - self._permission = attributes[ "permission" ] - if "repos_count" in attributes: # pragma no branch - assert attributes[ "repos_count" ] is None or isinstance( attributes[ "repos_count" ], int ), attributes[ "repos_count" ] - self._repos_count = attributes[ "repos_count" ] - if "url" in attributes: # pragma no branch - assert attributes[ "url" ] is None or isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ] - self._url = attributes[ "url" ] + def _useAttributes(self, attributes): + if "id" in attributes: # pragma no branch + assert attributes["id"] is None or isinstance(attributes["id"], int), attributes["id"] + self._id = attributes["id"] + if "members_count" in attributes: # pragma no branch + assert attributes["members_count"] is None or isinstance(attributes["members_count"], int), attributes["members_count"] + self._members_count = attributes["members_count"] + if "name" in attributes: # pragma no branch + assert attributes["name"] is None or isinstance(attributes["name"], (str, unicode)), attributes["name"] + self._name = attributes["name"] + if "permission" in attributes: # pragma no branch + assert attributes["permission"] is None or isinstance(attributes["permission"], (str, unicode)), attributes["permission"] + self._permission = attributes["permission"] + if "repos_count" in attributes: # pragma no branch + assert attributes["repos_count"] is None or isinstance(attributes["repos_count"], int), attributes["repos_count"] + self._repos_count = attributes["repos_count"] + if "url" in attributes: # pragma no branch + assert attributes["url"] is None or isinstance(attributes["url"], (str, unicode)), attributes["url"] + self._url = attributes["url"] diff --git a/github/UserKey.py b/github/UserKey.py index 6886842a..baaacddd 100644 --- a/github/UserKey.py +++ b/github/UserKey.py @@ -13,33 +13,34 @@ import GithubObject -class UserKey( GithubObject.GithubObject ): + +class UserKey(GithubObject.GithubObject): @property - def id( self ): - self._completeIfNotSet( self._id ) - return self._NoneIfNotSet( self._id ) + def id(self): + self._completeIfNotSet(self._id) + return self._NoneIfNotSet(self._id) @property - def key( self ): - self._completeIfNotSet( self._key ) - return self._NoneIfNotSet( self._key ) + def key(self): + self._completeIfNotSet(self._key) + return self._NoneIfNotSet(self._key) @property - def title( self ): - self._completeIfNotSet( self._title ) - return self._NoneIfNotSet( self._title ) + def title(self): + self._completeIfNotSet(self._title) + return self._NoneIfNotSet(self._title) @property - def url( self ): - self._completeIfNotSet( self._url ) - return self._NoneIfNotSet( self._url ) + def url(self): + self._completeIfNotSet(self._url) + return self._NoneIfNotSet(self._url) @property - def verified( self ): - self._completeIfNotSet( self._verified ) - return self._NoneIfNotSet( self._verified ) + def verified(self): + self._completeIfNotSet(self._verified) + return self._NoneIfNotSet(self._verified) - def delete( self ): + def delete(self): headers, data = self._requester.requestAndCheck( "DELETE", self.url, @@ -47,42 +48,42 @@ class UserKey( GithubObject.GithubObject ): None ) - def edit( self, title = GithubObject.NotSet, key = GithubObject.NotSet ): - assert title is GithubObject.NotSet or isinstance( title, ( str, unicode ) ), title - assert key is GithubObject.NotSet or isinstance( key, ( str, unicode ) ), key + def edit(self, title=GithubObject.NotSet, key=GithubObject.NotSet): + assert title is GithubObject.NotSet or isinstance(title, (str, unicode)), title + assert key is GithubObject.NotSet or isinstance(key, (str, unicode)), key post_parameters = dict() if title is not GithubObject.NotSet: - post_parameters[ "title" ] = title + post_parameters["title"] = title if key is not GithubObject.NotSet: - post_parameters[ "key" ] = key + post_parameters["key"] = key headers, data = self._requester.requestAndCheck( "PATCH", self.url, None, post_parameters ) - self._useAttributes( data ) + self._useAttributes(data) - def _initAttributes( self ): + def _initAttributes(self): self._id = GithubObject.NotSet self._key = GithubObject.NotSet self._title = GithubObject.NotSet self._url = GithubObject.NotSet self._verified = GithubObject.NotSet - def _useAttributes( self, attributes ): - if "id" in attributes: # pragma no branch - assert attributes[ "id" ] is None or isinstance( attributes[ "id" ], int ), attributes[ "id" ] - self._id = attributes[ "id" ] - if "key" in attributes: # pragma no branch - assert attributes[ "key" ] is None or isinstance( attributes[ "key" ], ( str, unicode ) ), attributes[ "key" ] - self._key = attributes[ "key" ] - if "title" in attributes: # pragma no branch - assert attributes[ "title" ] is None or isinstance( attributes[ "title" ], ( str, unicode ) ), attributes[ "title" ] - self._title = attributes[ "title" ] - if "url" in attributes: # pragma no branch - assert attributes[ "url" ] is None or isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ] - self._url = attributes[ "url" ] - if "verified" in attributes: # pragma no branch - assert attributes[ "verified" ] is None or isinstance( attributes[ "verified" ], bool ), attributes[ "verified" ] - self._verified = attributes[ "verified" ] + def _useAttributes(self, attributes): + if "id" in attributes: # pragma no branch + assert attributes["id"] is None or isinstance(attributes["id"], int), attributes["id"] + self._id = attributes["id"] + if "key" in attributes: # pragma no branch + assert attributes["key"] is None or isinstance(attributes["key"], (str, unicode)), attributes["key"] + self._key = attributes["key"] + if "title" in attributes: # pragma no branch + assert attributes["title"] is None or isinstance(attributes["title"], (str, unicode)), attributes["title"] + self._title = attributes["title"] + if "url" in attributes: # pragma no branch + assert attributes["url"] is None or isinstance(attributes["url"], (str, unicode)), attributes["url"] + self._url = attributes["url"] + if "verified" in attributes: # pragma no branch + assert attributes["verified"] is None or isinstance(attributes["verified"], bool), attributes["verified"] + self._verified = attributes["verified"] diff --git a/github/tests/AllTests.py b/github/tests/AllTests.py index dcdc9cdb..c3b5bb3a 100644 --- a/github/tests/AllTests.py +++ b/github/tests/AllTests.py @@ -1,59 +1,59 @@ -# Copyright 2012 Vincent Jacques -# vincent@vincent-jacques.net - -# This file is part of PyGithub. http://vincent-jacques.net/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 . - -from AuthenticatedUser import * -from Authentication import * -from Authorization import * -from Branch import * -from Commit import * -from CommitComment import * -from CommitStatus import * -from ContentFile import * -from Download import * -from Event import * -from Gist import * -from GistComment import * -from GitBlob import * -from GitCommit import * -from Github import * -from GitRef import * -from GitTag import * -from GitTree import * -from Hook import * -from Issue import * -from IssueComment import * -from IssueEvent import * -from Label import * -from Milestone import * -from NamedUser import * -from Markdown import * -from Organization import * -from PullRequest import * -from PullRequestComment import * -from PullRequestFile import * -from RateLimiting import * -from Repository import * -from RepositoryKey import * -from Tag import * -from Team import * -from UserKey import * - -from PaginatedList import * -from Exceptions import * -from Enterprise import * -from Logging import * - -from Issue33 import * -from Issue50 import * -from Issue54 import * -from Issue80 import * +# Copyright 2012 Vincent Jacques +# vincent@vincent-jacques.net + +# This file is part of PyGithub. http://vincent-jacques.net/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 . + +from AuthenticatedUser import * +from Authentication import * +from Authorization import * +from Branch import * +from Commit import * +from CommitComment import * +from CommitStatus import * +from ContentFile import * +from Download import * +from Event import * +from Gist import * +from GistComment import * +from GitBlob import * +from GitCommit import * +from Github import * +from GitRef import * +from GitTag import * +from GitTree import * +from Hook import * +from Issue import * +from IssueComment import * +from IssueEvent import * +from Label import * +from Milestone import * +from NamedUser import * +from Markdown import * +from Organization import * +from PullRequest import * +from PullRequestComment import * +from PullRequestFile import * +from RateLimiting import * +from Repository import * +from RepositoryKey import * +from Tag import * +from Team import * +from UserKey import * + +from PaginatedList import * +from Exceptions import * +from Enterprise import * +from Logging import * + +from Issue33 import * +from Issue50 import * +from Issue54 import * +from Issue80 import * diff --git a/github/tests/AuthenticatedUser.py b/github/tests/AuthenticatedUser.py index 295e0d6f..5cfae067 100644 --- a/github/tests/AuthenticatedUser.py +++ b/github/tests/AuthenticatedUser.py @@ -16,160 +16,161 @@ import Framework import github import datetime -class AuthenticatedUser( Framework.TestCase ): - def setUp( self ): - Framework.TestCase.setUp( self ) + +class AuthenticatedUser(Framework.TestCase): + def setUp(self): + Framework.TestCase.setUp(self) self.user = self.g.get_user() - def testAttributes( self ): - self.assertEqual( self.user.avatar_url, "https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png" ) - self.assertEqual( self.user.bio, "" ) - self.assertEqual( self.user.blog, "http://vincent-jacques.net" ) - self.assertEqual( self.user.collaborators, 0 ) - self.assertEqual( self.user.company, "Criteo" ) - self.assertEqual( self.user.created_at, datetime.datetime( 2010, 7, 9, 6, 10, 6 ) ) - self.assertEqual( self.user.disk_usage, 16692 ) - self.assertEqual( self.user.email, "vincent@vincent-jacques.net" ) - self.assertEqual( self.user.followers, 13 ) - self.assertEqual( self.user.following, 24 ) - self.assertEqual( self.user.gravatar_id, "b68de5ae38616c296fa345d2b9df2225" ) - self.assertEqual( self.user.hireable, False ) - self.assertEqual( self.user.html_url, "https://github.com/jacquev6" ) - self.assertEqual( self.user.id, 327146 ) - self.assertEqual( self.user.location, "Paris, France" ) - self.assertEqual( self.user.login, "jacquev6" ) - self.assertEqual( self.user.name, "Vincent Jacques" ) - self.assertEqual( self.user.owned_private_repos, 5 ) - self.assertEqual( self.user.plan.name, "micro" ) - self.assertEqual( self.user.plan.collaborators, 1 ) - self.assertEqual( self.user.plan.space, 614400 ) - self.assertEqual( self.user.plan.private_repos, 5 ) - self.assertEqual( self.user.private_gists, 5 ) - self.assertEqual( self.user.public_gists, 1 ) - self.assertEqual( self.user.public_repos, 10 ) - self.assertEqual( self.user.total_private_repos, 5 ) - self.assertEqual( self.user.type, "User" ) - self.assertEqual( self.user.url, "https://api.github.com/users/jacquev6" ) + def testAttributes(self): + self.assertEqual(self.user.avatar_url, "https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png") + self.assertEqual(self.user.bio, "") + self.assertEqual(self.user.blog, "http://vincent-jacques.net") + self.assertEqual(self.user.collaborators, 0) + self.assertEqual(self.user.company, "Criteo") + self.assertEqual(self.user.created_at, datetime.datetime(2010, 7, 9, 6, 10, 6)) + self.assertEqual(self.user.disk_usage, 16692) + self.assertEqual(self.user.email, "vincent@vincent-jacques.net") + self.assertEqual(self.user.followers, 13) + self.assertEqual(self.user.following, 24) + self.assertEqual(self.user.gravatar_id, "b68de5ae38616c296fa345d2b9df2225") + self.assertEqual(self.user.hireable, False) + self.assertEqual(self.user.html_url, "https://github.com/jacquev6") + self.assertEqual(self.user.id, 327146) + self.assertEqual(self.user.location, "Paris, France") + self.assertEqual(self.user.login, "jacquev6") + self.assertEqual(self.user.name, "Vincent Jacques") + self.assertEqual(self.user.owned_private_repos, 5) + self.assertEqual(self.user.plan.name, "micro") + self.assertEqual(self.user.plan.collaborators, 1) + self.assertEqual(self.user.plan.space, 614400) + self.assertEqual(self.user.plan.private_repos, 5) + self.assertEqual(self.user.private_gists, 5) + self.assertEqual(self.user.public_gists, 1) + self.assertEqual(self.user.public_repos, 10) + self.assertEqual(self.user.total_private_repos, 5) + self.assertEqual(self.user.type, "User") + self.assertEqual(self.user.url, "https://api.github.com/users/jacquev6") - def testEditWithoutArguments( self ): + def testEditWithoutArguments(self): self.user.edit() - def testEditWithAllArguments( self ): - self.user.edit( "Name edited by PyGithub", "Email edited by PyGithub", "Blog edited by PyGithub", "Company edited by PyGithub", "Location edited by PyGithub", True, "Bio edited by PyGithub" ) - self.assertEqual( self.user.name, "Name edited by PyGithub" ) - self.assertEqual( self.user.email, "Email edited by PyGithub" ) - self.assertEqual( self.user.blog, "Blog edited by PyGithub" ) - self.assertEqual( self.user.company, "Company edited by PyGithub" ) - self.assertEqual( self.user.location, "Location edited by PyGithub" ) - self.assertEqual( self.user.hireable, True ) - self.assertEqual( self.user.bio, "Bio edited by PyGithub" ) + def testEditWithAllArguments(self): + self.user.edit("Name edited by PyGithub", "Email edited by PyGithub", "Blog edited by PyGithub", "Company edited by PyGithub", "Location edited by PyGithub", True, "Bio edited by PyGithub") + self.assertEqual(self.user.name, "Name edited by PyGithub") + self.assertEqual(self.user.email, "Email edited by PyGithub") + self.assertEqual(self.user.blog, "Blog edited by PyGithub") + self.assertEqual(self.user.company, "Company edited by PyGithub") + self.assertEqual(self.user.location, "Location edited by PyGithub") + self.assertEqual(self.user.hireable, True) + self.assertEqual(self.user.bio, "Bio edited by PyGithub") - def testEmails( self ): - self.assertEqual( self.user.get_emails(), [ "vincent@vincent-jacques.net", "github.com@vincent-jacques.net" ] ) - self.user.add_to_emails( "1@foobar.com", "2@foobar.com" ) - self.assertEqual( self.user.get_emails(), [ "vincent@vincent-jacques.net", "1@foobar.com", "2@foobar.com", "github.com@vincent-jacques.net" ] ) - self.user.remove_from_emails( "1@foobar.com", "2@foobar.com" ) - self.assertEqual( self.user.get_emails(), [ "vincent@vincent-jacques.net", "github.com@vincent-jacques.net" ] ) + def testEmails(self): + self.assertEqual(self.user.get_emails(), ["vincent@vincent-jacques.net", "github.com@vincent-jacques.net"]) + self.user.add_to_emails("1@foobar.com", "2@foobar.com") + self.assertEqual(self.user.get_emails(), ["vincent@vincent-jacques.net", "1@foobar.com", "2@foobar.com", "github.com@vincent-jacques.net"]) + self.user.remove_from_emails("1@foobar.com", "2@foobar.com") + self.assertEqual(self.user.get_emails(), ["vincent@vincent-jacques.net", "github.com@vincent-jacques.net"]) - def testFollowing( self ): - nvie = self.g.get_user( "nvie" ) - self.assertListKeyEqual( self.user.get_following(), lambda u: u.login, [ "schacon", "jamis", "chad", "unclebob", "dabrahams", "jnorthrup", "brugidou", "regisb", "walidk", "tanzilli", "fjardon", "r3c", "sdanzan", "vineus", "cjuniet", "gturri", "ant9000", "asquini", "claudyus", "jardon-u", "s-bernard", "kamaradclimber", "Lyloa", "nvie" ] ) - self.assertEqual( self.user.has_in_following( nvie ), True ) - self.user.remove_from_following( nvie ) - self.assertEqual( self.user.has_in_following( nvie ), False ) - self.user.add_to_following( nvie ) - self.assertEqual( self.user.has_in_following( nvie ), True ) - self.assertListKeyEqual( self.user.get_followers(), lambda u: u.login, [ "jnorthrup", "brugidou", "regisb", "walidk", "afzalkhan", "sdanzan", "vineus", "gturri", "fjardon", "cjuniet", "jardon-u", "kamaradclimber", "L42y" ] ) + def testFollowing(self): + nvie = self.g.get_user("nvie") + self.assertListKeyEqual(self.user.get_following(), lambda u: u.login, ["schacon", "jamis", "chad", "unclebob", "dabrahams", "jnorthrup", "brugidou", "regisb", "walidk", "tanzilli", "fjardon", "r3c", "sdanzan", "vineus", "cjuniet", "gturri", "ant9000", "asquini", "claudyus", "jardon-u", "s-bernard", "kamaradclimber", "Lyloa", "nvie"]) + self.assertEqual(self.user.has_in_following(nvie), True) + self.user.remove_from_following(nvie) + self.assertEqual(self.user.has_in_following(nvie), False) + self.user.add_to_following(nvie) + self.assertEqual(self.user.has_in_following(nvie), True) + self.assertListKeyEqual(self.user.get_followers(), lambda u: u.login, ["jnorthrup", "brugidou", "regisb", "walidk", "afzalkhan", "sdanzan", "vineus", "gturri", "fjardon", "cjuniet", "jardon-u", "kamaradclimber", "L42y"]) - def testWatching( self ): - gitflow = self.g.get_user( "nvie" ).get_repo( "gitflow" ) - self.assertListKeyEqual( self.user.get_watched(), lambda r: r.name, [ "git", "boost.php", "capistrano", "boost.perl", "git-subtree", "git-hg", "homebrew", "celtic_knot", "twisted-intro", "markup", "hub", "gitflow", "murder", "boto", "agit", "d3", "pygit2", "git-pulls", "django_mathlatex", "scrumblr", "developer.github.com", "python-github3", "PlantUML", "bootstrap", "drawnby", "django-socketio", "django-realtime", "playground", "BozoCrack", "FatherBeaver", "PyGithub", "django", "django", "TestPyGithub" ] ) - self.assertEqual( self.user.has_in_watched( gitflow ), True ) - self.user.remove_from_watched( gitflow ) - self.assertEqual( self.user.has_in_watched( gitflow ), False ) - self.user.add_to_watched( gitflow ) - self.assertEqual( self.user.has_in_watched( gitflow ), True ) + def testWatching(self): + gitflow = self.g.get_user("nvie").get_repo("gitflow") + self.assertListKeyEqual(self.user.get_watched(), lambda r: r.name, ["git", "boost.php", "capistrano", "boost.perl", "git-subtree", "git-hg", "homebrew", "celtic_knot", "twisted-intro", "markup", "hub", "gitflow", "murder", "boto", "agit", "d3", "pygit2", "git-pulls", "django_mathlatex", "scrumblr", "developer.github.com", "python-github3", "PlantUML", "bootstrap", "drawnby", "django-socketio", "django-realtime", "playground", "BozoCrack", "FatherBeaver", "PyGithub", "django", "django", "TestPyGithub"]) + self.assertEqual(self.user.has_in_watched(gitflow), True) + self.user.remove_from_watched(gitflow) + self.assertEqual(self.user.has_in_watched(gitflow), False) + self.user.add_to_watched(gitflow) + self.assertEqual(self.user.has_in_watched(gitflow), True) - def testStarring( self ): - gitflow = self.g.get_user( "nvie" ).get_repo( "gitflow" ) - self.assertListKeyEqual( self.user.get_starred(), lambda r: r.name, [ "git", "boost.php", "capistrano", "boost.perl", "git-subtree", "git-hg", "homebrew", "celtic_knot", "twisted-intro", "markup", "hub", "gitflow", "murder", "boto", "agit", "d3", "pygit2", "git-pulls", "django_mathlatex", "scrumblr", "developer.github.com", "python-github3", "PlantUML", "bootstrap", "drawnby", "django-socketio", "django-realtime", "playground", "BozoCrack", "FatherBeaver", "amaunet", "django", "django", "moviePlanning", "folly" ] ) - self.assertEqual( self.user.has_in_starred( gitflow ), True ) - self.user.remove_from_starred( gitflow ) - self.assertEqual( self.user.has_in_starred( gitflow ), False ) - self.user.add_to_starred( gitflow ) - self.assertEqual( self.user.has_in_starred( gitflow ), True ) + def testStarring(self): + gitflow = self.g.get_user("nvie").get_repo("gitflow") + self.assertListKeyEqual(self.user.get_starred(), lambda r: r.name, ["git", "boost.php", "capistrano", "boost.perl", "git-subtree", "git-hg", "homebrew", "celtic_knot", "twisted-intro", "markup", "hub", "gitflow", "murder", "boto", "agit", "d3", "pygit2", "git-pulls", "django_mathlatex", "scrumblr", "developer.github.com", "python-github3", "PlantUML", "bootstrap", "drawnby", "django-socketio", "django-realtime", "playground", "BozoCrack", "FatherBeaver", "amaunet", "django", "django", "moviePlanning", "folly"]) + self.assertEqual(self.user.has_in_starred(gitflow), True) + self.user.remove_from_starred(gitflow) + self.assertEqual(self.user.has_in_starred(gitflow), False) + self.user.add_to_starred(gitflow) + self.assertEqual(self.user.has_in_starred(gitflow), True) - def testSubscriptions( self ): - gitflow = self.g.get_user( "nvie" ).get_repo( "gitflow" ) - self.assertListKeyEqual( self.user.get_subscriptions(), lambda r: r.name, [ "gitflow", "ViDE", "Boost.HierarchicalEnum", "QuadProgMm", "DrawSyntax", "DrawTurksHead", "PrivateStuff", "vincent-jacques.net", "Hacking", "C4Planner", "developer.github.com", "PyGithub", "PyGithub", "django", "CinePlanning", "PyGithub", "PyGithub", "PyGithub", "IpMap", "PyGithub", "PyGithub", "PyGithub", "PyGithub", "PyGithub", "PyGithub", "PyGithub", "PyGithub", "PyGithub", "PyGithub", "PyGithub", "PyGithub" ] ) - self.assertEqual( self.user.has_in_subscriptions( gitflow ), True ) - self.user.remove_from_subscriptions( gitflow ) - self.assertEqual( self.user.has_in_subscriptions( gitflow ), False ) - self.user.add_to_subscriptions( gitflow ) - self.assertEqual( self.user.has_in_subscriptions( gitflow ), True ) + def testSubscriptions(self): + gitflow = self.g.get_user("nvie").get_repo("gitflow") + self.assertListKeyEqual(self.user.get_subscriptions(), lambda r: r.name, ["gitflow", "ViDE", "Boost.HierarchicalEnum", "QuadProgMm", "DrawSyntax", "DrawTurksHead", "PrivateStuff", "vincent-jacques.net", "Hacking", "C4Planner", "developer.github.com", "PyGithub", "PyGithub", "django", "CinePlanning", "PyGithub", "PyGithub", "PyGithub", "IpMap", "PyGithub", "PyGithub", "PyGithub", "PyGithub", "PyGithub", "PyGithub", "PyGithub", "PyGithub", "PyGithub", "PyGithub", "PyGithub", "PyGithub"]) + self.assertEqual(self.user.has_in_subscriptions(gitflow), True) + self.user.remove_from_subscriptions(gitflow) + self.assertEqual(self.user.has_in_subscriptions(gitflow), False) + self.user.add_to_subscriptions(gitflow) + self.assertEqual(self.user.has_in_subscriptions(gitflow), True) - def testGetAuthorizations( self ): - self.assertListKeyEqual( self.user.get_authorizations(), lambda a: a.id, [ 372294 ] ) + def testGetAuthorizations(self): + self.assertListKeyEqual(self.user.get_authorizations(), lambda a: a.id, [372294]) - def testCreateRepository( self ): - repo = self.user.create_repo( "TestPyGithub" ) - self.assertEqual( repo.url, "https://api.github.com/repos/jacquev6/TestPyGithub" ) + def testCreateRepository(self): + repo = self.user.create_repo("TestPyGithub") + self.assertEqual(repo.url, "https://api.github.com/repos/jacquev6/TestPyGithub") - def testCreateRepositoryWithAllArguments( self ): - repo = self.user.create_repo( "TestPyGithub", "Repo created by PyGithub", "http://foobar.com", private = False, has_issues = False, has_wiki = False, has_downloads = False ) - self.assertEqual( repo.url, "https://api.github.com/repos/jacquev6/TestPyGithub" ) + def testCreateRepositoryWithAllArguments(self): + repo = self.user.create_repo("TestPyGithub", "Repo created by PyGithub", "http://foobar.com", private=False, has_issues=False, has_wiki=False, has_downloads=False) + self.assertEqual(repo.url, "https://api.github.com/repos/jacquev6/TestPyGithub") - def testCreateAuthorizationWithoutArguments( self ): + def testCreateAuthorizationWithoutArguments(self): authorization = self.user.create_authorization() - self.assertEqual( authorization.id, 372259 ) + self.assertEqual(authorization.id, 372259) - def testCreateAuthorizationWithAllArguments( self ): - authorization = self.user.create_authorization( [ "repo" ], "Note created by PyGithub", "http://vincent-jacques.net/PyGithub" ) - self.assertEqual( authorization.id, 372294 ) + def testCreateAuthorizationWithAllArguments(self): + authorization = self.user.create_authorization(["repo"], "Note created by PyGithub", "http://vincent-jacques.net/PyGithub") + self.assertEqual(authorization.id, 372294) - def testCreateGist( self ): - gist = self.user.create_gist( True, { "foobar.txt": github.InputFileContent( "File created by PyGithub" ) }, "Gist created by PyGithub" ) - self.assertEqual( gist.description, "Gist created by PyGithub" ) - self.assertEqual( gist.files.keys(), [ "foobar.txt" ] ) - self.assertEqual( gist.files[ "foobar.txt" ].content, "File created by PyGithub" ) + def testCreateGist(self): + gist = self.user.create_gist(True, {"foobar.txt": github.InputFileContent("File created by PyGithub")}, "Gist created by PyGithub") + self.assertEqual(gist.description, "Gist created by PyGithub") + self.assertEqual(gist.files.keys(), ["foobar.txt"]) + self.assertEqual(gist.files["foobar.txt"].content, "File created by PyGithub") - def testCreateGistWithoutDescription( self ): - gist = self.user.create_gist( True, { "foobar.txt": github.InputFileContent( "File created by PyGithub" ) } ) - self.assertEqual( gist.description, None ) - self.assertEqual( gist.files.keys(), [ "foobar.txt" ] ) - self.assertEqual( gist.files[ "foobar.txt" ].content, "File created by PyGithub" ) + def testCreateGistWithoutDescription(self): + gist = self.user.create_gist(True, {"foobar.txt": github.InputFileContent("File created by PyGithub")}) + self.assertEqual(gist.description, None) + self.assertEqual(gist.files.keys(), ["foobar.txt"]) + self.assertEqual(gist.files["foobar.txt"].content, "File created by PyGithub") - def testCreateKey( self ): - key = self.user.create_key( "Key added through PyGithub", "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA2Mm0RjTNAYFfSCtUpO54usdseroUSIYg5KX4JoseTpqyiB/hqewjYLAdUq/tNIQzrkoEJWSyZrQt0ma7/YCyMYuNGd3DU6q6ZAyBeY3E9RyCiKjO3aTL2VKQGFvBVVmGdxGVSCITRphAcsKc/PF35/fg9XP9S0anMXcEFtdfMHz41SSw+XtE+Vc+6cX9FuI5qUfLGbkv8L1v3g4uw9VXlzq4GfTA+1S7D6mcoGHopAIXFlVr+2RfDKdSURMcB22z41fljO1MW4+zUS/4FyUTpL991es5fcwKXYoiE+x06VJeJJ1Krwx+DZj45uweV6cHXt2JwJEI9fWB6WyBlDejWw== vincent@IDEE" ) - self.assertEqual( key.id, 2626650 ) + def testCreateKey(self): + key = self.user.create_key("Key added through PyGithub", "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA2Mm0RjTNAYFfSCtUpO54usdseroUSIYg5KX4JoseTpqyiB/hqewjYLAdUq/tNIQzrkoEJWSyZrQt0ma7/YCyMYuNGd3DU6q6ZAyBeY3E9RyCiKjO3aTL2VKQGFvBVVmGdxGVSCITRphAcsKc/PF35/fg9XP9S0anMXcEFtdfMHz41SSw+XtE+Vc+6cX9FuI5qUfLGbkv8L1v3g4uw9VXlzq4GfTA+1S7D6mcoGHopAIXFlVr+2RfDKdSURMcB22z41fljO1MW4+zUS/4FyUTpL991es5fcwKXYoiE+x06VJeJJ1Krwx+DZj45uweV6cHXt2JwJEI9fWB6WyBlDejWw== vincent@IDEE") + self.assertEqual(key.id, 2626650) - def testGetEvents( self ): - self.assertListKeyBegin( self.user.get_events(), lambda e: e.type, [ "PushEvent", "IssuesEvent", "IssueCommentEvent", "PushEvent" ] ) + def testGetEvents(self): + self.assertListKeyBegin(self.user.get_events(), lambda e: e.type, ["PushEvent", "IssuesEvent", "IssueCommentEvent", "PushEvent"]) - def testGetOrganizationEvents( self ): - self.assertListKeyBegin( self.user.get_organization_events( self.g.get_organization( "BeaverSoftware" ) ), lambda e: e.type, [ "CreateEvent", "CreateEvent", "PushEvent", "PushEvent" ] ) + def testGetOrganizationEvents(self): + self.assertListKeyBegin(self.user.get_organization_events(self.g.get_organization("BeaverSoftware")), lambda e: e.type, ["CreateEvent", "CreateEvent", "PushEvent", "PushEvent"]) - def testGetGists( self ): - self.assertListKeyEqual( self.user.get_gists(), lambda g: g.id, [ "2793505", "2793179", "11cb445f8197e17d303d", "1942384", "dcb7de17e8a52b74541d" ] ) + def testGetGists(self): + self.assertListKeyEqual(self.user.get_gists(), lambda g: g.id, ["2793505", "2793179", "11cb445f8197e17d303d", "1942384", "dcb7de17e8a52b74541d"]) - def testGetStarredGists( self ): - self.assertListKeyEqual( self.user.get_starred_gists(), lambda g: g.id, [ "1942384", "dcb7de17e8a52b74541d" ] ) + def testGetStarredGists(self): + self.assertListKeyEqual(self.user.get_starred_gists(), lambda g: g.id, ["1942384", "dcb7de17e8a52b74541d"]) - def testGetIssues( self ): - self.assertListKeyEqual( self.user.get_issues(), lambda i: ( i.id, i.repository.name ), [ ( 4639931, "PyGithub" ), ( 4452000, "PyGithub" ), ( 4356743, "PyGithub" ), ( 3716033, "PyGithub" ), ( 3715946, "PyGithub" ), ( 3643837, "PyGithub" ), ( 3628022, "PyGithub" ), ( 3624595, "PyGithub" ), ( 3624570, "PyGithub" ), ( 3624561, "PyGithub" ), ( 3624556, "PyGithub" ), ( 3619973, "PyGithub" ), ( 3527266, "PyGithub" ), ( 3527245, "PyGithub" ), ( 3527231, "PyGithub" ) ] ) + def testGetIssues(self): + self.assertListKeyEqual(self.user.get_issues(), lambda i: (i.id, i.repository.name), [(4639931, "PyGithub"), (4452000, "PyGithub"), (4356743, "PyGithub"), (3716033, "PyGithub"), (3715946, "PyGithub"), (3643837, "PyGithub"), (3628022, "PyGithub"), (3624595, "PyGithub"), (3624570, "PyGithub"), (3624561, "PyGithub"), (3624556, "PyGithub"), (3619973, "PyGithub"), (3527266, "PyGithub"), (3527245, "PyGithub"), (3527231, "PyGithub")]) - def testGetKeys( self ): - self.assertListKeyEqual( self.user.get_keys(), lambda k: k.title, [ "vincent@home", "vincent@gandi", "vincent@aws", "vincent@macbook" ] ) + def testGetKeys(self): + self.assertListKeyEqual(self.user.get_keys(), lambda k: k.title, ["vincent@home", "vincent@gandi", "vincent@aws", "vincent@macbook"]) - def testGetOrgs( self ): - self.assertListKeyEqual( self.user.get_orgs(), lambda o: o.login, [ "BeaverSoftware" ] ) + def testGetOrgs(self): + self.assertListKeyEqual(self.user.get_orgs(), lambda o: o.login, ["BeaverSoftware"]) - def testGetRepos( self ): - self.assertListKeyEqual( self.user.get_repos(), lambda r: r.name, [ "TestPyGithub", "django", "PyGithub", "developer.github.com", "acme-public-website", "C4Planner", "Hacking", "vincent-jacques.net", "Contests", "Candidates", "Tests", "DrawTurksHead", "DrawSyntax", "QuadProgMm", "Boost.HierarchicalEnum", "ViDE" ] ) + def testGetRepos(self): + self.assertListKeyEqual(self.user.get_repos(), lambda r: r.name, ["TestPyGithub", "django", "PyGithub", "developer.github.com", "acme-public-website", "C4Planner", "Hacking", "vincent-jacques.net", "Contests", "Candidates", "Tests", "DrawTurksHead", "DrawSyntax", "QuadProgMm", "Boost.HierarchicalEnum", "ViDE"]) - def testGetReposWithArguments( self ): - self.assertListKeyEqual( self.user.get_repos( "public", "full_name", "desc" ), lambda r: r.name, [ "ViDE", "QuadProgMm", "PyGithub", "DrawTurksHead", "DrawSyntax", "django", "developer.github.com", "C4Planner", "Boost.HierarchicalEnum", "acme-public-website" ] ) + def testGetReposWithArguments(self): + self.assertListKeyEqual(self.user.get_repos("public", "full_name", "desc"), lambda r: r.name, ["ViDE", "QuadProgMm", "PyGithub", "DrawTurksHead", "DrawSyntax", "django", "developer.github.com", "C4Planner", "Boost.HierarchicalEnum", "acme-public-website"]) - def testCreateFork( self ): - repo = self.user.create_fork( self.g.get_user( "nvie" ).get_repo( "gitflow" ) ) - self.assertEqual( repo.source.full_name, "nvie/gitflow" ) + def testCreateFork(self): + repo = self.user.create_fork(self.g.get_user("nvie").get_repo("gitflow")) + self.assertEqual(repo.source.full_name, "nvie/gitflow") diff --git a/github/tests/Authentication.py b/github/tests/Authentication.py index 1414bb79..cc8e7b06 100644 --- a/github/tests/Authentication.py +++ b/github/tests/Authentication.py @@ -14,15 +14,16 @@ import Framework import github -class Authentication( Framework.BasicTestCase ): - def testNoAuthentication( self ): + +class Authentication(Framework.BasicTestCase): + def testNoAuthentication(self): g = github.Github() - self.assertEqual( g.get_user( "jacquev6" ).name, "Vincent Jacques" ) + self.assertEqual(g.get_user("jacquev6").name, "Vincent Jacques") - def testBasicAuthentication( self ): - g = github.Github( self.login, self.password ) - self.assertEqual( g.get_user( "jacquev6" ).name, "Vincent Jacques" ) + def testBasicAuthentication(self): + g = github.Github(self.login, self.password) + self.assertEqual(g.get_user("jacquev6").name, "Vincent Jacques") - def testOAuthAuthentication( self ): - g = github.Github( self.oauth_token ) - self.assertEqual( g.get_user( "jacquev6" ).name, "Vincent Jacques" ) + def testOAuthAuthentication(self): + g = github.Github(self.oauth_token) + self.assertEqual(g.get_user("jacquev6").name, "Vincent Jacques") diff --git a/github/tests/Authorization.py b/github/tests/Authorization.py index 524abfd1..c23f2a0c 100644 --- a/github/tests/Authorization.py +++ b/github/tests/Authorization.py @@ -15,37 +15,38 @@ import Framework import datetime -class Authorization( Framework.TestCase ): - def setUp( self ): - Framework.TestCase.setUp( self ) - self.authorization = self.g.get_user().get_authorization( 372259 ) - def testAttributes( self ): - self.assertEqual( self.authorization.app.url, "http://developer.github.com/v3/oauth/#oauth-authorizations-api" ) - self.assertEqual( self.authorization.app.name, "GitHub API" ) - self.assertEqual( self.authorization.created_at, datetime.datetime( 2012, 5, 22, 18, 3, 17 ) ) - self.assertEqual( self.authorization.id, 372259 ) - self.assertEqual( self.authorization.note, None ) - self.assertEqual( self.authorization.note_url, None ) - self.assertEqual( self.authorization.scopes, [] ) - self.assertEqual( self.authorization.token, "82459c4500086f8f0cc67d2936c17d1e27ad1c33" ) - self.assertEqual( self.authorization.updated_at, datetime.datetime( 2012, 5, 22, 18, 3, 17 ) ) - self.assertEqual( self.authorization.url, "https://api.github.com/authorizations/372259" ) +class Authorization(Framework.TestCase): + def setUp(self): + Framework.TestCase.setUp(self) + self.authorization = self.g.get_user().get_authorization(372259) - def testEdit( self ): + def testAttributes(self): + self.assertEqual(self.authorization.app.url, "http://developer.github.com/v3/oauth/#oauth-authorizations-api") + self.assertEqual(self.authorization.app.name, "GitHub API") + self.assertEqual(self.authorization.created_at, datetime.datetime(2012, 5, 22, 18, 3, 17)) + self.assertEqual(self.authorization.id, 372259) + self.assertEqual(self.authorization.note, None) + self.assertEqual(self.authorization.note_url, None) + self.assertEqual(self.authorization.scopes, []) + self.assertEqual(self.authorization.token, "82459c4500086f8f0cc67d2936c17d1e27ad1c33") + self.assertEqual(self.authorization.updated_at, datetime.datetime(2012, 5, 22, 18, 3, 17)) + self.assertEqual(self.authorization.url, "https://api.github.com/authorizations/372259") + + def testEdit(self): self.authorization.edit() - self.assertEqual( self.authorization.scopes, [] ) - self.authorization.edit( scopes = [ "user" ] ) - self.assertEqual( self.authorization.scopes, [ "user" ] ) - self.authorization.edit( add_scopes = [ "repo" ] ) - self.assertEqual( self.authorization.scopes, [ "user", "repo" ] ) - self.authorization.edit( remove_scopes = [ "repo" ] ) - self.assertEqual( self.authorization.scopes, [ "user" ] ) - self.assertEqual( self.authorization.note, None ) - self.assertEqual( self.authorization.note_url, None ) - self.authorization.edit( note = "Note created by PyGithub", note_url = "http://vincent-jacques.net/PyGithub" ) - self.assertEqual( self.authorization.note, "Note created by PyGithub" ) - self.assertEqual( self.authorization.note_url, "http://vincent-jacques.net/PyGithub" ) + self.assertEqual(self.authorization.scopes, []) + self.authorization.edit(scopes=["user"]) + self.assertEqual(self.authorization.scopes, ["user"]) + self.authorization.edit(add_scopes=["repo"]) + self.assertEqual(self.authorization.scopes, ["user", "repo"]) + self.authorization.edit(remove_scopes=["repo"]) + self.assertEqual(self.authorization.scopes, ["user"]) + self.assertEqual(self.authorization.note, None) + self.assertEqual(self.authorization.note_url, None) + self.authorization.edit(note="Note created by PyGithub", note_url="http://vincent-jacques.net/PyGithub") + self.assertEqual(self.authorization.note, "Note created by PyGithub") + self.assertEqual(self.authorization.note_url, "http://vincent-jacques.net/PyGithub") - def testDelete( self ): + def testDelete(self): self.authorization.delete() diff --git a/github/tests/Branch.py b/github/tests/Branch.py index 4983cbcb..9b84ee5b 100644 --- a/github/tests/Branch.py +++ b/github/tests/Branch.py @@ -13,11 +13,12 @@ import Framework -class Branch( Framework.TestCase ): - def setUp( self ): - Framework.TestCase.setUp( self ) - self.branch = self.g.get_user().get_repo( "PyGithub" ).get_branches()[ 0 ] - def testAttributes( self ): - self.assertEqual( self.branch.name, "topic/RewriteWithGeneratedCode" ) - self.assertEqual( self.branch.commit.sha, "1292bf0e22c796e91cc3d6e24b544aece8c21f2a" ) +class Branch(Framework.TestCase): + def setUp(self): + Framework.TestCase.setUp(self) + self.branch = self.g.get_user().get_repo("PyGithub").get_branches()[0] + + def testAttributes(self): + self.assertEqual(self.branch.name, "topic/RewriteWithGeneratedCode") + self.assertEqual(self.branch.commit.sha, "1292bf0e22c796e91cc3d6e24b544aece8c21f2a") diff --git a/github/tests/Commit.py b/github/tests/Commit.py index ddf04752..4c242858 100644 --- a/github/tests/Commit.py +++ b/github/tests/Commit.py @@ -13,68 +13,69 @@ import Framework -class Commit( Framework.TestCase ): - def setUp( self ): - Framework.TestCase.setUp( self ) - self.commit = self.g.get_user().get_repo( "PyGithub" ).get_commit( "1292bf0e22c796e91cc3d6e24b544aece8c21f2a" ) - self.commit.author.login # to force lazy completion - def testAttributes( self ): - self.assertEqual( self.commit.author.login, "jacquev6" ) - self.assertEqual( self.commit.commit.url, "https://api.github.com/repos/jacquev6/PyGithub/git/commits/1292bf0e22c796e91cc3d6e24b544aece8c21f2a" ) - self.assertEqual( self.commit.committer.login, "jacquev6" ) - self.assertEqual( len( self.commit.files ), 1 ) - self.assertEqual( self.commit.files[ 0 ].additions, 0 ) - self.assertEqual( self.commit.files[ 0 ].blob_url, "https://github.com/jacquev6/PyGithub/blob/1292bf0e22c796e91cc3d6e24b544aece8c21f2a/github/GithubObjects/GitAuthor.py" ) - self.assertEqual( self.commit.files[ 0 ].changes, 20 ) - self.assertEqual( self.commit.files[ 0 ].deletions, 20 ) - self.assertEqual( self.commit.files[ 0 ].filename, "github/GithubObjects/GitAuthor.py" ) - self.assertTrue( isinstance( self.commit.files[ 0 ].patch, ( str, unicode ) ) ) - self.assertEqual( self.commit.files[ 0 ].raw_url, "https://github.com/jacquev6/PyGithub/raw/1292bf0e22c796e91cc3d6e24b544aece8c21f2a/github/GithubObjects/GitAuthor.py" ) - self.assertEqual( self.commit.files[ 0 ].sha, "1292bf0e22c796e91cc3d6e24b544aece8c21f2a" ) - self.assertEqual( self.commit.files[ 0 ].status, "modified" ) - self.assertEqual( len( self.commit.parents ), 1 ) - self.assertEqual( self.commit.parents[ 0 ].sha, "b46ed0dfde5ad02d3b91eb54a41c5ed960710eae" ) - self.assertEqual( self.commit.sha, "1292bf0e22c796e91cc3d6e24b544aece8c21f2a" ) - self.assertEqual( self.commit.stats.deletions, 20 ) - self.assertEqual( self.commit.stats.additions, 0 ) - self.assertEqual( self.commit.stats.total, 20 ) - self.assertEqual( self.commit.url, "https://api.github.com/repos/jacquev6/PyGithub/commits/1292bf0e22c796e91cc3d6e24b544aece8c21f2a" ) +class Commit(Framework.TestCase): + def setUp(self): + Framework.TestCase.setUp(self) + self.commit = self.g.get_user().get_repo("PyGithub").get_commit("1292bf0e22c796e91cc3d6e24b544aece8c21f2a") + self.commit.author.login # to force lazy completion - def testGetComments( self ): - self.assertListKeyEqual( self.commit.get_comments(), lambda c: c.id, [ 1347033, 1347083, 1347397, 1349654 ] ) + def testAttributes(self): + self.assertEqual(self.commit.author.login, "jacquev6") + self.assertEqual(self.commit.commit.url, "https://api.github.com/repos/jacquev6/PyGithub/git/commits/1292bf0e22c796e91cc3d6e24b544aece8c21f2a") + self.assertEqual(self.commit.committer.login, "jacquev6") + self.assertEqual(len(self.commit.files), 1) + self.assertEqual(self.commit.files[0].additions, 0) + self.assertEqual(self.commit.files[0].blob_url, "https://github.com/jacquev6/PyGithub/blob/1292bf0e22c796e91cc3d6e24b544aece8c21f2a/github/GithubObjects/GitAuthor.py") + self.assertEqual(self.commit.files[0].changes, 20) + self.assertEqual(self.commit.files[0].deletions, 20) + self.assertEqual(self.commit.files[0].filename, "github/GithubObjects/GitAuthor.py") + self.assertTrue(isinstance(self.commit.files[0].patch, (str, unicode))) + self.assertEqual(self.commit.files[0].raw_url, "https://github.com/jacquev6/PyGithub/raw/1292bf0e22c796e91cc3d6e24b544aece8c21f2a/github/GithubObjects/GitAuthor.py") + self.assertEqual(self.commit.files[0].sha, "1292bf0e22c796e91cc3d6e24b544aece8c21f2a") + self.assertEqual(self.commit.files[0].status, "modified") + self.assertEqual(len(self.commit.parents), 1) + self.assertEqual(self.commit.parents[0].sha, "b46ed0dfde5ad02d3b91eb54a41c5ed960710eae") + self.assertEqual(self.commit.sha, "1292bf0e22c796e91cc3d6e24b544aece8c21f2a") + self.assertEqual(self.commit.stats.deletions, 20) + self.assertEqual(self.commit.stats.additions, 0) + self.assertEqual(self.commit.stats.total, 20) + self.assertEqual(self.commit.url, "https://api.github.com/repos/jacquev6/PyGithub/commits/1292bf0e22c796e91cc3d6e24b544aece8c21f2a") - def testCreateComment( self ): - comment = self.commit.create_comment( "Comment created by PyGithub" ) - self.assertEqual( comment.id, 1361949 ) - self.assertEqual( comment.line, None ) - self.assertEqual( comment.path, None ) - self.assertEqual( comment.position, None ) + def testGetComments(self): + self.assertListKeyEqual(self.commit.get_comments(), lambda c: c.id, [1347033, 1347083, 1347397, 1349654]) - def testCreateCommentOnFileLine( self ): - comment = self.commit.create_comment( "Comment created by PyGithub", path = "codegen/templates/GithubObject.MethodBody.UseResult.py", line = 26 ) - self.assertEqual( comment.id, 1362000 ) - self.assertEqual( comment.line, 26 ) - self.assertEqual( comment.path, "codegen/templates/GithubObject.MethodBody.UseResult.py" ) - self.assertEqual( comment.position, None ) + def testCreateComment(self): + comment = self.commit.create_comment("Comment created by PyGithub") + self.assertEqual(comment.id, 1361949) + self.assertEqual(comment.line, None) + self.assertEqual(comment.path, None) + self.assertEqual(comment.position, None) - def testCreateCommentOnFilePosition( self ): - comment = self.commit.create_comment( "Comment also created by PyGithub", path = "codegen/templates/GithubObject.MethodBody.UseResult.py", position = 3 ) - self.assertEqual( comment.id, 1362001 ) - self.assertEqual( comment.line, None ) - self.assertEqual( comment.path, "codegen/templates/GithubObject.MethodBody.UseResult.py" ) - self.assertEqual( comment.position, 3 ) + def testCreateCommentOnFileLine(self): + comment = self.commit.create_comment("Comment created by PyGithub", path="codegen/templates/GithubObject.MethodBody.UseResult.py", line=26) + self.assertEqual(comment.id, 1362000) + self.assertEqual(comment.line, 26) + self.assertEqual(comment.path, "codegen/templates/GithubObject.MethodBody.UseResult.py") + self.assertEqual(comment.position, None) - def testCreateStatusWithoutOptionalParameters( self ): - status = self.commit.create_status( "pending" ) - self.assertEqual( status.id, 277031 ) - self.assertEqual( status.state, "pending" ) - self.assertEqual( status.target_url, None ) - self.assertEqual( status.description, None ) + def testCreateCommentOnFilePosition(self): + comment = self.commit.create_comment("Comment also created by PyGithub", path="codegen/templates/GithubObject.MethodBody.UseResult.py", position=3) + self.assertEqual(comment.id, 1362001) + self.assertEqual(comment.line, None) + self.assertEqual(comment.path, "codegen/templates/GithubObject.MethodBody.UseResult.py") + self.assertEqual(comment.position, 3) - def testCreateStatusWithAllParameters( self ): - status = self.commit.create_status( "success", "https://github.com/jacquev6/PyGithub/issues/67", "Status successfuly created by PyGithub" ) - self.assertEqual( status.id, 277040 ) - self.assertEqual( status.state, "success" ) - self.assertEqual( status.target_url, "https://github.com/jacquev6/PyGithub/issues/67" ) - self.assertEqual( status.description, "Status successfuly created by PyGithub" ) + def testCreateStatusWithoutOptionalParameters(self): + status = self.commit.create_status("pending") + self.assertEqual(status.id, 277031) + self.assertEqual(status.state, "pending") + self.assertEqual(status.target_url, None) + self.assertEqual(status.description, None) + + def testCreateStatusWithAllParameters(self): + status = self.commit.create_status("success", "https://github.com/jacquev6/PyGithub/issues/67", "Status successfuly created by PyGithub") + self.assertEqual(status.id, 277040) + self.assertEqual(status.state, "success") + self.assertEqual(status.target_url, "https://github.com/jacquev6/PyGithub/issues/67") + self.assertEqual(status.description, "Status successfuly created by PyGithub") diff --git a/github/tests/CommitComment.py b/github/tests/CommitComment.py index 423f6152..83068c2b 100644 --- a/github/tests/CommitComment.py +++ b/github/tests/CommitComment.py @@ -15,26 +15,27 @@ import Framework import datetime -class CommitComment( Framework.TestCase ): - def setUp( self ): - Framework.TestCase.setUp( self ) - self.comment = self.g.get_user().get_repo( "PyGithub" ).get_comment( 1361949 ) - def testAttributes( self ): - self.assertEqual( self.comment.body, "Comment created by PyGithub" ) - self.assertEqual( self.comment.commit_id, "6945921c529be14c3a8f566dd1e483674516d46d" ) - self.assertEqual( self.comment.created_at, datetime.datetime( 2012, 5, 22, 18, 40, 18 ) ) - self.assertEqual( self.comment.html_url, "https://github.com/jacquev6/PyGithub/commit/6945921c529be14c3a8f566dd1e483674516d46d#commitcomment-1361949" ) - self.assertEqual( self.comment.id, 1361949 ) - self.assertEqual( self.comment.line, None ) - self.assertEqual( self.comment.path, None ) - self.assertEqual( self.comment.position, None ) - self.assertEqual( self.comment.updated_at, datetime.datetime( 2012, 5, 22, 18, 40, 18 ) ) - self.assertEqual( self.comment.url, "https://api.github.com/repos/jacquev6/PyGithub/comments/1361949" ) - self.assertEqual( self.comment.user.login, "jacquev6" ) +class CommitComment(Framework.TestCase): + def setUp(self): + Framework.TestCase.setUp(self) + self.comment = self.g.get_user().get_repo("PyGithub").get_comment(1361949) - def testEdit( self ): - self.comment.edit( "Comment edited by PyGithub" ) + def testAttributes(self): + self.assertEqual(self.comment.body, "Comment created by PyGithub") + self.assertEqual(self.comment.commit_id, "6945921c529be14c3a8f566dd1e483674516d46d") + self.assertEqual(self.comment.created_at, datetime.datetime(2012, 5, 22, 18, 40, 18)) + self.assertEqual(self.comment.html_url, "https://github.com/jacquev6/PyGithub/commit/6945921c529be14c3a8f566dd1e483674516d46d#commitcomment-1361949") + self.assertEqual(self.comment.id, 1361949) + self.assertEqual(self.comment.line, None) + self.assertEqual(self.comment.path, None) + self.assertEqual(self.comment.position, None) + self.assertEqual(self.comment.updated_at, datetime.datetime(2012, 5, 22, 18, 40, 18)) + self.assertEqual(self.comment.url, "https://api.github.com/repos/jacquev6/PyGithub/comments/1361949") + self.assertEqual(self.comment.user.login, "jacquev6") - def testDelete( self ): + def testEdit(self): + self.comment.edit("Comment edited by PyGithub") + + def testDelete(self): self.comment.delete() diff --git a/github/tests/CommitStatus.py b/github/tests/CommitStatus.py index 30e5eb22..49691267 100644 --- a/github/tests/CommitStatus.py +++ b/github/tests/CommitStatus.py @@ -1,34 +1,35 @@ -# Copyright 2012 Vincent Jacques -# vincent@vincent-jacques.net - -# This file is part of PyGithub. http://vincent-jacques.net/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 Framework - -import github -import datetime - -class CommitStatus( Framework.TestCase ): - def setUp( self ): - Framework.TestCase.setUp( self ) - self.statuses = list( self.g.get_user().get_repo( "PyGithub" ).get_commit( "1292bf0e22c796e91cc3d6e24b544aece8c21f2a" ).get_statuses() ) - - def testAttributes( self ): - self.assertEqual( self.statuses[ 0 ].created_at, datetime.datetime( 2012, 9, 8, 11, 30, 56 ) ) - self.assertEqual( self.statuses[ 0 ].updated_at, datetime.datetime( 2012, 9, 8, 11, 30, 56 ) ) - self.assertEqual( self.statuses[ 0 ].creator.login, "jacquev6" ) - self.assertEqual( self.statuses[ 0 ].description, "Status successfuly created by PyGithub" ) - self.assertEqual( self.statuses[ 1 ].description, None ) - self.assertEqual( self.statuses[ 0 ].id, 277040 ) - self.assertEqual( self.statuses[ 0 ].state, "success" ) - self.assertEqual( self.statuses[ 1 ].state, "pending" ) - self.assertEqual( self.statuses[ 0 ].target_url, "https://github.com/jacquev6/PyGithub/issues/67" ) - self.assertEqual( self.statuses[ 1 ].target_url, None ) +# Copyright 2012 Vincent Jacques +# vincent@vincent-jacques.net + +# This file is part of PyGithub. http://vincent-jacques.net/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 Framework + +import github +import datetime + + +class CommitStatus(Framework.TestCase): + def setUp(self): + Framework.TestCase.setUp(self) + self.statuses = list(self.g.get_user().get_repo("PyGithub").get_commit("1292bf0e22c796e91cc3d6e24b544aece8c21f2a").get_statuses()) + + def testAttributes(self): + self.assertEqual(self.statuses[0].created_at, datetime.datetime(2012, 9, 8, 11, 30, 56)) + self.assertEqual(self.statuses[0].updated_at, datetime.datetime(2012, 9, 8, 11, 30, 56)) + self.assertEqual(self.statuses[0].creator.login, "jacquev6") + self.assertEqual(self.statuses[0].description, "Status successfuly created by PyGithub") + self.assertEqual(self.statuses[1].description, None) + self.assertEqual(self.statuses[0].id, 277040) + self.assertEqual(self.statuses[0].state, "success") + self.assertEqual(self.statuses[1].state, "pending") + self.assertEqual(self.statuses[0].target_url, "https://github.com/jacquev6/PyGithub/issues/67") + self.assertEqual(self.statuses[1].target_url, None) diff --git a/github/tests/ContentFile.py b/github/tests/ContentFile.py index e5ad1d3c..1616c6eb 100644 --- a/github/tests/ContentFile.py +++ b/github/tests/ContentFile.py @@ -1,33 +1,34 @@ -# Copyright 2012 Vincent Jacques -# vincent@vincent-jacques.net - -# This file is part of PyGithub. http://vincent-jacques.net/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 base64 - -import Framework - -import github -import datetime - -class ContentFile( Framework.TestCase ): - def setUp( self ): - Framework.TestCase.setUp( self ) - self.file = self.g.get_user().get_repo( "PyGithub" ).get_readme() - - def testAttributes( self ): - self.assertEqual( self.file.type, "file" ) - self.assertEqual( self.file.encoding, "base64" ) - self.assertEqual( self.file.size, 7531 ) - self.assertEqual( self.file.name, "ReadMe.md" ) - self.assertEqual( self.file.path, "ReadMe.md" ) - self.assertEqual( len( base64.b64decode( self.file.content ) ), 7531 ) - self.assertEqual( self.file.sha, "5628799a7d517a4aaa0c1a7004d07569cd154df0" ) +# Copyright 2012 Vincent Jacques +# vincent@vincent-jacques.net + +# This file is part of PyGithub. http://vincent-jacques.net/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 base64 + +import Framework + +import github +import datetime + + +class ContentFile(Framework.TestCase): + def setUp(self): + Framework.TestCase.setUp(self) + self.file = self.g.get_user().get_repo("PyGithub").get_readme() + + def testAttributes(self): + self.assertEqual(self.file.type, "file") + self.assertEqual(self.file.encoding, "base64") + self.assertEqual(self.file.size, 7531) + self.assertEqual(self.file.name, "ReadMe.md") + self.assertEqual(self.file.path, "ReadMe.md") + self.assertEqual(len(base64.b64decode(self.file.content)), 7531) + self.assertEqual(self.file.sha, "5628799a7d517a4aaa0c1a7004d07569cd154df0") diff --git a/github/tests/Download.py b/github/tests/Download.py index ba80fb36..975d6f20 100644 --- a/github/tests/Download.py +++ b/github/tests/Download.py @@ -15,32 +15,33 @@ import Framework import datetime -class Download( Framework.TestCase ): - def setUp( self ): - Framework.TestCase.setUp( self ) - self.download = self.g.get_user().get_repo( "PyGithub" ).get_download( 242550 ) - def testAttributes( self ): - self.assertEqual( self.download.accesskeyid, None ) - self.assertEqual( self.download.acl, None ) - self.assertEqual( self.download.bucket, None ) - self.assertEqual( self.download.content_type, "text/plain" ) - self.assertEqual( self.download.created_at, datetime.datetime( 2012, 5, 22, 18, 58, 32 ) ) - self.assertEqual( self.download.description, None ) - self.assertEqual( self.download.download_count, 0 ) - self.assertEqual( self.download.expirationdate, None ) - self.assertEqual( self.download.html_url, "https://github.com/downloads/jacquev6/PyGithub/Foobar.txt" ) - self.assertEqual( self.download.id, 242550 ) - self.assertEqual( self.download.mime_type, None ) - self.assertEqual( self.download.name, "Foobar.txt" ) - self.assertEqual( self.download.path, None ) - self.assertEqual( self.download.policy, None ) - self.assertEqual( self.download.prefix, None ) - self.assertEqual( self.download.redirect, None ) - self.assertEqual( self.download.s3_url, None ) - self.assertEqual( self.download.signature, None ) - self.assertEqual( self.download.size, 1024 ) - self.assertEqual( self.download.url, "https://api.github.com/repos/jacquev6/PyGithub/downloads/242550" ) +class Download(Framework.TestCase): + def setUp(self): + Framework.TestCase.setUp(self) + self.download = self.g.get_user().get_repo("PyGithub").get_download(242550) - def testDelete( self ): + def testAttributes(self): + self.assertEqual(self.download.accesskeyid, None) + self.assertEqual(self.download.acl, None) + self.assertEqual(self.download.bucket, None) + self.assertEqual(self.download.content_type, "text/plain") + self.assertEqual(self.download.created_at, datetime.datetime(2012, 5, 22, 18, 58, 32)) + self.assertEqual(self.download.description, None) + self.assertEqual(self.download.download_count, 0) + self.assertEqual(self.download.expirationdate, None) + self.assertEqual(self.download.html_url, "https://github.com/downloads/jacquev6/PyGithub/Foobar.txt") + self.assertEqual(self.download.id, 242550) + self.assertEqual(self.download.mime_type, None) + self.assertEqual(self.download.name, "Foobar.txt") + self.assertEqual(self.download.path, None) + self.assertEqual(self.download.policy, None) + self.assertEqual(self.download.prefix, None) + self.assertEqual(self.download.redirect, None) + self.assertEqual(self.download.s3_url, None) + self.assertEqual(self.download.signature, None) + self.assertEqual(self.download.size, 1024) + self.assertEqual(self.download.url, "https://api.github.com/repos/jacquev6/PyGithub/downloads/242550") + + def testDelete(self): self.download.delete() diff --git a/github/tests/Enterprise.py b/github/tests/Enterprise.py index 9058c608..5552f14b 100644 --- a/github/tests/Enterprise.py +++ b/github/tests/Enterprise.py @@ -15,22 +15,23 @@ import github import Framework + # Replay data for this test case is forged, because I don't have access to a real Github Enterprise install -class Enterprise( Framework.BasicTestCase ): - def testHttps( self ): - g = github.Github( self.login, self.password, base_url = "https://my.enterprise.com" ) - self.assertListKeyEqual( g.get_user().get_repos(), lambda r: r.name, [ "TestPyGithub", "django", "PyGithub", "developer.github.com", "acme-public-website", "C4Planner", "Hacking", "vincent-jacques.net", "Contests", "Candidates", "Tests", "DrawTurksHead", "DrawSyntax", "QuadProgMm", "Boost.HierarchicalEnum", "ViDE" ] ) +class Enterprise(Framework.BasicTestCase): + def testHttps(self): + g = github.Github(self.login, self.password, base_url="https://my.enterprise.com") + self.assertListKeyEqual(g.get_user().get_repos(), lambda r: r.name, ["TestPyGithub", "django", "PyGithub", "developer.github.com", "acme-public-website", "C4Planner", "Hacking", "vincent-jacques.net", "Contests", "Candidates", "Tests", "DrawTurksHead", "DrawSyntax", "QuadProgMm", "Boost.HierarchicalEnum", "ViDE"]) - def testHttp( self ): - g = github.Github( self.login, self.password, base_url = "http://my.enterprise.com" ) - self.assertListKeyEqual( g.get_user().get_repos(), lambda r: r.name, [ "TestPyGithub", "django", "PyGithub", "developer.github.com", "acme-public-website", "C4Planner", "Hacking", "vincent-jacques.net", "Contests", "Candidates", "Tests", "DrawTurksHead", "DrawSyntax", "QuadProgMm", "Boost.HierarchicalEnum", "ViDE" ] ) + def testHttp(self): + g = github.Github(self.login, self.password, base_url="http://my.enterprise.com") + self.assertListKeyEqual(g.get_user().get_repos(), lambda r: r.name, ["TestPyGithub", "django", "PyGithub", "developer.github.com", "acme-public-website", "C4Planner", "Hacking", "vincent-jacques.net", "Contests", "Candidates", "Tests", "DrawTurksHead", "DrawSyntax", "QuadProgMm", "Boost.HierarchicalEnum", "ViDE"]) - def testLongUrl( self ): - g = github.Github( self.login, self.password, base_url = "http://my.enterprise.com/path/to/github" ) + def testLongUrl(self): + g = github.Github(self.login, self.password, base_url="http://my.enterprise.com/path/to/github") repos = g.get_user().get_repos() - self.assertListKeyEqual( repos, lambda r: r.name, [ "TestPyGithub", "django", "PyGithub", "developer.github.com", "acme-public-website", "C4Planner", "Hacking", "vincent-jacques.net", "Contests", "Candidates", "Tests", "DrawTurksHead", "DrawSyntax", "QuadProgMm", "Boost.HierarchicalEnum", "ViDE" ] ) - self.assertEqual( repos[ 0 ].owner.name, "Vincent Jacques" ) + self.assertListKeyEqual(repos, lambda r: r.name, ["TestPyGithub", "django", "PyGithub", "developer.github.com", "acme-public-website", "C4Planner", "Hacking", "vincent-jacques.net", "Contests", "Candidates", "Tests", "DrawTurksHead", "DrawSyntax", "QuadProgMm", "Boost.HierarchicalEnum", "ViDE"]) + self.assertEqual(repos[0].owner.name, "Vincent Jacques") - def testSpecificPort( self ): - g = github.Github( self.login, self.password, base_url = "http://my.enterprise.com:8080" ) - self.assertListKeyEqual( g.get_user().get_repos(), lambda r: r.name, [ "TestPyGithub", "django", "PyGithub", "developer.github.com", "acme-public-website", "C4Planner", "Hacking", "vincent-jacques.net", "Contests", "Candidates", "Tests", "DrawTurksHead", "DrawSyntax", "QuadProgMm", "Boost.HierarchicalEnum", "ViDE" ] ) + def testSpecificPort(self): + g = github.Github(self.login, self.password, base_url="http://my.enterprise.com:8080") + self.assertListKeyEqual(g.get_user().get_repos(), lambda r: r.name, ["TestPyGithub", "django", "PyGithub", "developer.github.com", "acme-public-website", "C4Planner", "Hacking", "vincent-jacques.net", "Contests", "Candidates", "Tests", "DrawTurksHead", "DrawSyntax", "QuadProgMm", "Boost.HierarchicalEnum", "ViDE"]) diff --git a/github/tests/Event.py b/github/tests/Event.py index fa17c2a3..5bc0d6c7 100644 --- a/github/tests/Event.py +++ b/github/tests/Event.py @@ -15,17 +15,18 @@ import Framework import datetime -class Event( Framework.TestCase ): - def setUp( self ): - Framework.TestCase.setUp( self ) - self.event = self.g.get_user( "jacquev6" ).get_events()[ 0 ] - def testAttributes( self ): - self.assertEqual( self.event.actor.login, "jacquev6" ) - self.assertEqual( self.event.created_at, datetime.datetime( 2012, 5, 26, 10, 1, 39 ) ) - self.assertEqual( self.event.id, "1556114751" ) - self.assertEqual( self.event.org, None ) - self.assertEqual( self.event.payload, {u'commits': [{u'url': u'https://api.github.com/repos/jacquev6/PyGithub/commits/5bb654d26dd014d36794acd1e6ecf3736f12aad7', u'sha': u'5bb654d26dd014d36794acd1e6ecf3736f12aad7', u'message': u'Implement the three authentication schemes', u'distinct': False, u'author': {u'name': u'Vincent Jacques', u'email': u'vincent@vincent-jacques.net'}}, {u'url': u'https://api.github.com/repos/jacquev6/PyGithub/commits/cb0313157bf904f2d364377d35d9397b269547a5', u'sha': u'cb0313157bf904f2d364377d35d9397b269547a5', u'message': u"Merge branch 'topic/Authentication' into develop", u'distinct': False, u'author': {u'name': u'Vincent Jacques', u'email': u'vincent@vincent-jacques.net'}}, {u'url': u'https://api.github.com/repos/jacquev6/PyGithub/commits/0cec0d25e606c023a62a4fc7cdc815309ebf6d16', u'sha': u'0cec0d25e606c023a62a4fc7cdc815309ebf6d16', u'message': u'Publish version 0.7', u'distinct': False, u'author': {u'name': u'Vincent Jacques', u'email': u'vincent@vincent-jacques.net'}}, {u'url': u'https://api.github.com/repos/jacquev6/PyGithub/commits/ecda065e01876209d2bdf5fe4e91cee8ffaa9ff7', u'sha': u'ecda065e01876209d2bdf5fe4e91cee8ffaa9ff7', u'message': u"Merge branch 'develop'", u'distinct': False, u'author': {u'name': u'Vincent Jacques', u'email': u'vincent@vincent-jacques.net'}}, {u'url': u'https://api.github.com/repos/jacquev6/PyGithub/commits/3a3bf4763192ee1234eb0557628133e06f3dfc76', u'sha': u'3a3bf4763192ee1234eb0557628133e06f3dfc76', u'message': u"Merge branch 'master' into topic/RewriteWithGeneratedCode\n\nConflicts:\n\tgithub/Github.py\n\tgithub/Requester.py", u'distinct': True, u'author': {u'name': u'Vincent Jacques', u'email': u'vincent@vincent-jacques.net'}}, {u'url': u'https://api.github.com/repos/jacquev6/PyGithub/commits/608f17794664f61693a3dc05e6056fea8fbef0ff', u'sha': u'608f17794664f61693a3dc05e6056fea8fbef0ff', u'message': u'Restore some form of Authorization header in replay data', u'distinct': True, u'author': {u'name': u'Vincent Jacques', u'email': u'vincent@vincent-jacques.net'}}, {u'url': u'https://api.github.com/repos/jacquev6/PyGithub/commits/2c04b8adbd91d38eef4f0767337ab7a12b2f684b', u'sha': u'2c04b8adbd91d38eef4f0767337ab7a12b2f684b', u'message': u'Allow test without pre-set-up Github', u'distinct': True, u'author': {u'name': u'Vincent Jacques', u'email': u'vincent@vincent-jacques.net'}}, {u'url': u'https://api.github.com/repos/jacquev6/PyGithub/commits/5b97389988b6fe43e15a079702f6f1671257fb28', u'sha': u'5b97389988b6fe43e15a079702f6f1671257fb28', u'message': u'Test three authentication schemes', u'distinct': True, u'author': {u'name': u'Vincent Jacques', u'email': u'vincent@vincent-jacques.net'}}, {u'url': u'https://api.github.com/repos/jacquev6/PyGithub/commits/12747613c5ec00deccf296b8619ad507f7050475', u'sha': u'12747613c5ec00deccf296b8619ad507f7050475', u'message': u'Test Issue.getComments', u'distinct': True, u'author': {u'name': u'Vincent Jacques', u'email': u'vincent@vincent-jacques.net'}}, {u'url': u'https://api.github.com/repos/jacquev6/PyGithub/commits/2982fa96c5ca75abe717d974d83f9135d664232e', u'sha': u'2982fa96c5ca75abe717d974d83f9135d664232e', u'message': u'Test the new Repository.full_name attribute', u'distinct': True, u'author': {u'name': u'Vincent Jacques', u'email': u'vincent@vincent-jacques.net'}}, {u'url': u'https://api.github.com/repos/jacquev6/PyGithub/commits/619eae8d51c5988f0d2889fc767fa677438ba95d', u'sha': u'619eae8d51c5988f0d2889fc767fa677438ba95d', u'message': u'Improve coverage of AuthenticatedUser', u'distinct': True, u'author': {u'name': u'Vincent Jacques', u'email': u'vincent@vincent-jacques.net'}}], u'head': u'619eae8d51c5988f0d2889fc767fa677438ba95d', u'push_id': 80673538, u'ref': u'refs/heads/topic/RewriteWithGeneratedCode', u'size': 11} ) - self.assertEqual( self.event.public, True ) - self.assertEqual( self.event.repo.name, "jacquev6/PyGithub" ) - self.assertEqual( self.event.type, "PushEvent" ) +class Event(Framework.TestCase): + def setUp(self): + Framework.TestCase.setUp(self) + self.event = self.g.get_user("jacquev6").get_events()[0] + + def testAttributes(self): + self.assertEqual(self.event.actor.login, "jacquev6") + self.assertEqual(self.event.created_at, datetime.datetime(2012, 5, 26, 10, 1, 39)) + self.assertEqual(self.event.id, "1556114751") + self.assertEqual(self.event.org, None) + self.assertEqual(self.event.payload, {u'commits': [{u'url': u'https://api.github.com/repos/jacquev6/PyGithub/commits/5bb654d26dd014d36794acd1e6ecf3736f12aad7', u'sha': u'5bb654d26dd014d36794acd1e6ecf3736f12aad7', u'message': u'Implement the three authentication schemes', u'distinct': False, u'author': {u'name': u'Vincent Jacques', u'email': u'vincent@vincent-jacques.net'}}, {u'url': u'https://api.github.com/repos/jacquev6/PyGithub/commits/cb0313157bf904f2d364377d35d9397b269547a5', u'sha': u'cb0313157bf904f2d364377d35d9397b269547a5', u'message': u"Merge branch 'topic/Authentication' into develop", u'distinct': False, u'author': {u'name': u'Vincent Jacques', u'email': u'vincent@vincent-jacques.net'}}, {u'url': u'https://api.github.com/repos/jacquev6/PyGithub/commits/0cec0d25e606c023a62a4fc7cdc815309ebf6d16', u'sha': u'0cec0d25e606c023a62a4fc7cdc815309ebf6d16', u'message': u'Publish version 0.7', u'distinct': False, u'author': {u'name': u'Vincent Jacques', u'email': u'vincent@vincent-jacques.net'}}, {u'url': u'https://api.github.com/repos/jacquev6/PyGithub/commits/ecda065e01876209d2bdf5fe4e91cee8ffaa9ff7', u'sha': u'ecda065e01876209d2bdf5fe4e91cee8ffaa9ff7', u'message': u"Merge branch 'develop'", u'distinct': False, u'author': {u'name': u'Vincent Jacques', u'email': u'vincent@vincent-jacques.net'}}, {u'url': u'https://api.github.com/repos/jacquev6/PyGithub/commits/3a3bf4763192ee1234eb0557628133e06f3dfc76', u'sha': u'3a3bf4763192ee1234eb0557628133e06f3dfc76', u'message': u"Merge branch 'master' into topic/RewriteWithGeneratedCode\n\nConflicts:\n\tgithub/Github.py\n\tgithub/Requester.py", u'distinct': True, u'author': {u'name': u'Vincent Jacques', u'email': u'vincent@vincent-jacques.net'}}, {u'url': u'https://api.github.com/repos/jacquev6/PyGithub/commits/608f17794664f61693a3dc05e6056fea8fbef0ff', u'sha': u'608f17794664f61693a3dc05e6056fea8fbef0ff', u'message': u'Restore some form of Authorization header in replay data', u'distinct': True, u'author': {u'name': u'Vincent Jacques', u'email': u'vincent@vincent-jacques.net'}}, {u'url': u'https://api.github.com/repos/jacquev6/PyGithub/commits/2c04b8adbd91d38eef4f0767337ab7a12b2f684b', u'sha': u'2c04b8adbd91d38eef4f0767337ab7a12b2f684b', u'message': u'Allow test without pre-set-up Github', u'distinct': True, u'author': {u'name': u'Vincent Jacques', u'email': u'vincent@vincent-jacques.net'}}, {u'url': u'https://api.github.com/repos/jacquev6/PyGithub/commits/5b97389988b6fe43e15a079702f6f1671257fb28', u'sha': u'5b97389988b6fe43e15a079702f6f1671257fb28', u'message': u'Test three authentication schemes', u'distinct': True, u'author': {u'name': u'Vincent Jacques', u'email': u'vincent@vincent-jacques.net'}}, {u'url': u'https://api.github.com/repos/jacquev6/PyGithub/commits/12747613c5ec00deccf296b8619ad507f7050475', u'sha': u'12747613c5ec00deccf296b8619ad507f7050475', u'message': u'Test Issue.getComments', u'distinct': True, u'author': {u'name': u'Vincent Jacques', u'email': u'vincent@vincent-jacques.net'}}, {u'url': u'https://api.github.com/repos/jacquev6/PyGithub/commits/2982fa96c5ca75abe717d974d83f9135d664232e', u'sha': u'2982fa96c5ca75abe717d974d83f9135d664232e', u'message': u'Test the new Repository.full_name attribute', u'distinct': True, u'author': {u'name': u'Vincent Jacques', u'email': u'vincent@vincent-jacques.net'}}, {u'url': u'https://api.github.com/repos/jacquev6/PyGithub/commits/619eae8d51c5988f0d2889fc767fa677438ba95d', u'sha': u'619eae8d51c5988f0d2889fc767fa677438ba95d', u'message': u'Improve coverage of AuthenticatedUser', u'distinct': True, u'author': {u'name': u'Vincent Jacques', u'email': u'vincent@vincent-jacques.net'}}], u'head': u'619eae8d51c5988f0d2889fc767fa677438ba95d', u'push_id': 80673538, u'ref': u'refs/heads/topic/RewriteWithGeneratedCode', u'size': 11}) + self.assertEqual(self.event.public, True) + self.assertEqual(self.event.repo.name, "jacquev6/PyGithub") + self.assertEqual(self.event.type, "PushEvent") diff --git a/github/tests/Exceptions.py b/github/tests/Exceptions.py index e94b4bd8..b30cff58 100644 --- a/github/tests/Exceptions.py +++ b/github/tests/Exceptions.py @@ -18,14 +18,14 @@ import Framework atLeastPython26 = sys.hexversion >= 0x02060000 -# To stay compatible with Python 2.6, we do not use self.assertRaises with only one argument -class Exceptions( Framework.TestCase ): - def testInvalidInput( self ): + +class Exceptions(Framework.TestCase): # To stay compatible with Python 2.6, we do not use self.assertRaises with only one argument + def testInvalidInput(self): try: - self.g.get_user().create_key( "Bad key", "xxx" ) - self.fail( "Should have raised" ) + self.g.get_user().create_key("Bad key", "xxx") + self.fail("Should have raised") except github.GithubException, exception: - self.assertEqual( exception.status, 422 ) + self.assertEqual(exception.status, 422) self.assertEqual( exception.data, { @@ -41,42 +41,42 @@ class Exceptions( Framework.TestCase ): } ) if atLeastPython26: - self.assertEqual( str( exception ), "422 {u\'message\': u\'Validation Failed\', u\'errors\': [{u\'field\': u\'key\', u\'message\': u\"key is invalid. It must begin with \'ssh-rsa\' or \'ssh-dss\'. Check that you\'re copying the public half of the key\", u\'code\': u\'custom\', u\'resource\': u\'PublicKey\'}]}" ) + self.assertEqual(str(exception), "422 {u\'message\': u\'Validation Failed\', u\'errors\': [{u\'field\': u\'key\', u\'message\': u\"key is invalid. It must begin with \'ssh-rsa\' or \'ssh-dss\'. Check that you\'re copying the public half of the key\", u\'code\': u\'custom\', u\'resource\': u\'PublicKey\'}]}") else: - self.assertEqual( str( exception ), "422 {\'message\': \'Validation Failed\', \'errors\': [{\'field\': \'key\', \'message\': \"key is invalid. It must begin with \'ssh-rsa\' or \'ssh-dss\'. Check that you\'re copying the public half of the key\", \'code\': \'custom\', \'resource\': \'PublicKey\'}]}" ) + self.assertEqual(str(exception), "422 {\'message\': \'Validation Failed\', \'errors\': [{\'field\': \'key\', \'message\': \"key is invalid. It must begin with \'ssh-rsa\' or \'ssh-dss\'. Check that you\'re copying the public half of the key\", \'code\': \'custom\', \'resource\': \'PublicKey\'}]}") - def testUnknownObject( self ): + def testUnknownObject(self): try: - self.g.get_user().get_repo( "Xxx" ) - self.fail( "Should have raised" ) + self.g.get_user().get_repo("Xxx") + self.fail("Should have raised") except github.GithubException, exception: - self.assertEqual( exception.status, 404 ) - self.assertEqual( exception.data, { "message": "Not Found" } ) + self.assertEqual(exception.status, 404) + self.assertEqual(exception.data, {"message": "Not Found"}) if atLeastPython26: - self.assertEqual( str( exception ), "404 {u'message': u'Not Found'}" ) + self.assertEqual(str(exception), "404 {u'message': u'Not Found'}") else: - self.assertEqual( str( exception ), "404 {'message': 'Not Found'}" ) + self.assertEqual(str(exception), "404 {'message': 'Not Found'}") - def testUnknownUser( self ): + def testUnknownUser(self): try: - self.g.get_user( "ThisUserShouldReallyNotExist" ) - self.fail( "Should have raised" ) + self.g.get_user("ThisUserShouldReallyNotExist") + self.fail("Should have raised") except github.GithubException, exception: - self.assertEqual( exception.status, 404 ) - self.assertEqual( exception.data, { "message": "Not Found" } ) + self.assertEqual(exception.status, 404) + self.assertEqual(exception.data, {"message": "Not Found"}) if atLeastPython26: - self.assertEqual( str( exception ), "404 {u'message': u'Not Found'}" ) + self.assertEqual(str(exception), "404 {u'message': u'Not Found'}") else: - self.assertEqual( str( exception ), "404 {'message': 'Not Found'}" ) + self.assertEqual(str(exception), "404 {'message': 'Not Found'}") - def testBadAuthentication( self ): + def testBadAuthentication(self): try: - github.Github( "BadUser", "BadPassword" ).get_user().login - self.fail( "Should have raised" ) + github.Github("BadUser", "BadPassword").get_user().login + self.fail("Should have raised") except github.GithubException, exception: - self.assertEqual( exception.status, 401 ) - self.assertEqual( exception.data, { "message": "Bad credentials" } ) + self.assertEqual(exception.status, 401) + self.assertEqual(exception.data, {"message": "Bad credentials"}) if atLeastPython26: - self.assertEqual( str( exception ), "401 {u'message': u'Bad credentials'}" ) + self.assertEqual(str(exception), "401 {u'message': u'Bad credentials'}") else: - self.assertEqual( str( exception ), "401 {'message': 'Bad credentials'}" ) + self.assertEqual(str(exception), "401 {'message': 'Bad credentials'}") diff --git a/github/tests/Framework.py b/github/tests/Framework.py index cf1dc896..ae8c3878 100644 --- a/github/tests/Framework.py +++ b/github/tests/Framework.py @@ -19,42 +19,45 @@ import traceback import github + class FakeHttpResponse: - def __init__( self, status, headers, output ): + def __init__(self, status, headers, output): self.status = status self.__headers = headers self.__output = output - def getheaders( self ): + def getheaders(self): return self.__headers - def read( self ): + def read(self): return self.__output -def fixAuthorizationHeader( headers ): + +def fixAuthorizationHeader(headers): if "Authorization" in headers: - if headers[ "Authorization" ].startswith( "token " ): - headers[ "Authorization" ] = "token private_token_removed" - elif headers[ "Authorization" ].startswith( "Basic " ): - headers[ "Authorization" ] = "Basic login_and_password_removed" + if headers["Authorization"].startswith("token "): + headers["Authorization"] = "token private_token_removed" + elif headers["Authorization"].startswith("Basic "): + headers["Authorization"] = "Basic login_and_password_removed" else: assert False + class RecordingConnection: - def __init__( self, file, protocol, host, port, *args, **kwds ): + def __init__(self, file, protocol, host, port, *args, **kwds): self.__file = file self.__protocol = protocol self.__host = host - self.__port = str( port ) - self.__cnx = self._realConnection( host, port, *args, **kwds ) + self.__port = str(port) + self.__cnx = self._realConnection(host, port, *args, **kwds) - def request( self, verb, url, input, headers ): + def request(self, verb, url, input, headers): print verb, url, input, headers, - self.__cnx.request( verb, url, input, headers ) - fixAuthorizationHeader( headers ) - self.__file.write( self.__protocol + " " + verb + " " + self.__host + " " + self.__port + " " + url + " " + str( headers ) + " " + input + "\n" ) + self.__cnx.request(verb, url, input, headers) + fixAuthorizationHeader(headers) + self.__file.write(self.__protocol + " " + verb + " " + self.__host + " " + self.__port + " " + url + " " + str(headers) + " " + input + "\n") - def getresponse( self ): + def getresponse(self): res = self.__cnx.getresponse() status = res.status @@ -62,69 +65,75 @@ class RecordingConnection: headers = res.getheaders() output = res.read() - self.__file.write( str( status ) + "\n" ) - self.__file.write( str( headers ) + "\n" ) - self.__file.write( str( output ) + "\n" ) + self.__file.write(str(status) + "\n") + self.__file.write(str(headers) + "\n") + self.__file.write(str(output) + "\n") - return FakeHttpResponse( status, headers, output ) + return FakeHttpResponse(status, headers, output) - def close( self ): - self.__file.write( "\n" ) + def close(self): + self.__file.write("\n") return self.__cnx.close() -class RecordingHttpConnection( RecordingConnection ): + +class RecordingHttpConnection(RecordingConnection): _realConnection = httplib.HTTPConnection - def __init__( self, file, *args, **kwds ): - RecordingConnection.__init__( self, file, "http", *args, **kwds ) + def __init__(self, file, *args, **kwds): + RecordingConnection.__init__(self, file, "http", *args, **kwds) -class RecordingHttpsConnection( RecordingConnection ): + +class RecordingHttpsConnection(RecordingConnection): _realConnection = httplib.HTTPSConnection - def __init__( self, file, *args, **kwds ): + def __init__(self, file, *args, **kwds): print args, kwds - RecordingConnection.__init__( self, file, "https", *args, **kwds ) + RecordingConnection.__init__(self, file, "https", *args, **kwds) + class ReplayingConnection: - def __init__( self, testCase, file, protocol, host, port, *args, **kwds ): + def __init__(self, testCase, file, protocol, host, port, *args, **kwds): self.__testCase = testCase self.__file = file self.__protocol = protocol self.__host = host - self.__port = str( port ) + self.__port = str(port) - def request( self, verb, url, input, headers ): - fixAuthorizationHeader( headers ) + def request(self, verb, url, input, headers): + fixAuthorizationHeader(headers) expectation = self.__file.readline().strip() - self.__testCase.assertEqual( self.__protocol + " " + verb + " " + self.__host + " " + self.__port + " " + url + " " + str( headers ) + " " + input, expectation ) + self.__testCase.assertEqual(self.__protocol + " " + verb + " " + self.__host + " " + self.__port + " " + url + " " + str(headers) + " " + input, expectation) - def getresponse( self ): - status = int( self.__file.readline().strip() ) - headers = eval( self.__file.readline().strip() ) + def getresponse(self): + status = int(self.__file.readline().strip()) + headers = eval(self.__file.readline().strip()) output = self.__file.readline().strip() - return FakeHttpResponse( status, headers, output ) + return FakeHttpResponse(status, headers, output) - def close( self ): + def close(self): self.__file.readline() -def ReplayingHttpConnection( testCase, file, *args, **kwds ): - return ReplayingConnection( testCase, file, "http", *args, **kwds ) -def ReplayingHttpsConnection( testCase, file, *args, **kwds ): - return ReplayingConnection( testCase, file, "https", *args, **kwds ) +def ReplayingHttpConnection(testCase, file, *args, **kwds): + return ReplayingConnection(testCase, file, "http", *args, **kwds) -class BasicTestCase( unittest.TestCase ): + +def ReplayingHttpsConnection(testCase, file, *args, **kwds): + return ReplayingConnection(testCase, file, "https", *args, **kwds) + + +class BasicTestCase(unittest.TestCase): recordMode = False - def setUp( self ): - unittest.TestCase.setUp( self ) + def setUp(self): + unittest.TestCase.setUp(self) self.__fileName = "" self.__file = None if self.recordMode: github.Requester.Requester.injectConnectionClasses( - lambda ignored, *args, **kwds: RecordingHttpConnection( self.__openFile( "wb" ), *args, **kwds ), - lambda ignored, *args, **kwds: RecordingHttpsConnection( self.__openFile( "wb" ), *args, **kwds ) + lambda ignored, *args, **kwds: RecordingHttpConnection(self.__openFile("wb"), *args, **kwds), + lambda ignored, *args, **kwds: RecordingHttpsConnection(self.__openFile("wb"), *args, **kwds) ) import GithubCredentials self.login = GithubCredentials.login @@ -132,46 +141,48 @@ class BasicTestCase( unittest.TestCase ): self.oauth_token = GithubCredentials.oauth_token else: github.Requester.Requester.injectConnectionClasses( - lambda ignored, *args, **kwds: ReplayingHttpConnection( self, self.__openFile( "r" ), *args, **kwds ), - lambda ignored, *args, **kwds: ReplayingHttpsConnection( self, self.__openFile( "r" ), *args, **kwds ) + lambda ignored, *args, **kwds: ReplayingHttpConnection(self, self.__openFile("r"), *args, **kwds), + lambda ignored, *args, **kwds: ReplayingHttpsConnection(self, self.__openFile("r"), *args, **kwds) ) self.login = "login" self.password = "password" self.oauth_token = "oauth_token" - def tearDown( self ): - unittest.TestCase.tearDown( self ) + def tearDown(self): + unittest.TestCase.tearDown(self) self.__closeReplayFileIfNeeded() - def __openFile( self, mode ): - for ( _, _, functionName, _ ) in traceback.extract_stack(): - if functionName.startswith( "test" ) or functionName == "setUp" or functionName == "tearDown": - if functionName != "test": # because in class Hook( Framework.TestCase ), method testTest calls Hook.test - fileName = os.path.join( os.path.dirname( __file__ ), "ReplayData", self.__class__.__name__ + "." + functionName + ".txt" ) + def __openFile(self, mode): + for (_, _, functionName, _) in traceback.extract_stack(): + if functionName.startswith("test") or functionName == "setUp" or functionName == "tearDown": + if functionName != "test": # because in class Hook(Framework.TestCase), method testTest calls Hook.test + fileName = os.path.join(os.path.dirname(__file__), "ReplayData", self.__class__.__name__ + "." + functionName + ".txt") if fileName != self.__fileName: self.__closeReplayFileIfNeeded() self.__fileName = fileName - self.__file = open( self.__fileName, mode ) + self.__file = open(self.__fileName, mode) return self.__file - def __closeReplayFileIfNeeded( self ): + def __closeReplayFileIfNeeded(self): if self.__file is not None: if not self.recordMode: - self.assertEqual( self.__file.readline(), "" ) + self.assertEqual(self.__file.readline(), "") self.__file.close() - def assertListKeyEqual( self, elements, key, expectedKeys ): - realKeys = [ key( element ) for element in elements ] - self.assertEqual( realKeys, expectedKeys ) + def assertListKeyEqual(self, elements, key, expectedKeys): + realKeys = [key(element) for element in elements] + self.assertEqual(realKeys, expectedKeys) - def assertListKeyBegin( self, elements, key, expectedKeys ): - realKeys = [ key( element ) for element in elements[ : len( expectedKeys ) ] ] - self.assertEqual( realKeys, expectedKeys ) + def assertListKeyBegin(self, elements, key, expectedKeys): + realKeys = [key(element) for element in elements[: len(expectedKeys)]] + self.assertEqual(realKeys, expectedKeys) + + +class TestCase(BasicTestCase): + def setUp(self): + BasicTestCase.setUp(self) + self.g = github.Github(self.login, self.password) -class TestCase( BasicTestCase ): - def setUp( self ): - BasicTestCase.setUp( self ) - self.g = github.Github( self.login, self.password ) def activateRecordMode(): BasicTestCase.recordMode = True diff --git a/github/tests/Gist.py b/github/tests/Gist.py index 76341e8d..98ba0e60 100644 --- a/github/tests/Gist.py +++ b/github/tests/Gist.py @@ -16,71 +16,72 @@ import Framework import github import datetime -class Gist( Framework.TestCase ): - def setUp( self ): - Framework.TestCase.setUp( self ) - self.gist = self.g.get_gist( "2729810" ) - def testAttributes( self ): - self.assertEquals( self.gist.comments, 0 ) - self.assertEquals( self.gist.created_at, datetime.datetime( 2012, 2, 29, 16, 47, 12 ) ) - self.assertEquals( self.gist.description, "How to error 500 Github API v3, as requested by Rick (GitHub Staff)" ) - self.assertEquals( self.gist.files.keys(), [ "fail_github.py" ] ) - self.assertEquals( self.gist.files[ "fail_github.py" ].size, 1636 ) - self.assertEquals( self.gist.files[ "fail_github.py" ].filename, "fail_github.py" ) - self.assertEquals( self.gist.files[ "fail_github.py" ].language, "Python" ) - self.assertEquals( self.gist.files[ "fail_github.py" ].content, 'import httplib\nimport base64\nimport json\n\nlogin = ""\npassword = ""\norgName = ""\nrepoName = "FailGithubApi"\n\ndef doRequest( verb, url, input ):\n input = json.dumps( input )\n cnx = httplib.HTTPSConnection( "api.github.com", strict = True )\n cnx.request( verb, url, input, { "Authorization" : "Basic " + base64.b64encode( login + ":" + password ).replace( \'\\n\', \'\' ) } )\n response = cnx.getresponse()\n status = response.status\n output = response.read()\n cnx.close()\n print verb, url, input, "=>", status, output\n print\n if status < 200 or status >= 300:\n exit( 1 )\n return json.loads( output )\n\n# Create a repo\ndoRequest( "POST", "/user/repos", { "name": repoName } )\n\n# Create a blob, a tree, a commit and the master branch\nb = doRequest(\n "POST", "/repos/%s/%s/git/blobs" % ( login, repoName ),\n { "content": "Content of the blob", "encoding": "latin1" }\n)\nt = doRequest(\n "POST", "/repos/%s/%s/git/trees" % ( login, repoName ),\n { "tree" : [ { "path": "foo.bar", "type": "blob", "mode": "100644", "sha": b["sha"] } ] }\n)\nc = doRequest(\n "POST", "/repos/%s/%s/git/commits" % ( login, repoName ),\n { "parents": [], "message": "Message of the commit", "tree": t["sha"] }\n)\ndoRequest(\n "POST", "/repos/%s/%s/git/refs" % ( login, repoName ),\n { "ref": "refs/heads/master", "sha": c["sha"] }\n)\n\n# Fork the repo\ndoRequest( "POST", "/repos/%s/%s/forks?org=%s" % ( login, repoName, orgName ), None )\n\n# Create a new blob => BOOM error 500\ndoRequest(\n "POST", "/repos/%s/%s/git/blobs" % ( orgName, repoName ),\n { "content": "Content of the new blob", "encoding": "latin1" }\n)\n' ) - self.assertEquals( self.gist.files[ "fail_github.py" ].raw_url, "https://gist.github.com/raw/2729810/2fb3aa84e0efa50dc0f4c18b5df5b7b9ab27076b/fail_github.py" ) - self.assertEquals( self.gist.forks, [] ) - self.assertEquals( self.gist.git_pull_url, "git://gist.github.com/2729810.git" ) - self.assertEquals( self.gist.git_push_url, "git@gist.github.com:2729810.git" ) - self.assertEquals( len( self.gist.history ), 1 ) - self.assertEquals( self.gist.history[ 0 ].change_status.additions, 52 ) - self.assertEquals( self.gist.history[ 0 ].change_status.deletions, 0 ) - self.assertEquals( self.gist.history[ 0 ].change_status.total, 52 ) - self.assertEquals( self.gist.history[ 0 ].committed_at, datetime.datetime( 2012, 2, 29, 16, 47, 12 ) ) - self.assertEquals( self.gist.history[ 0 ].url, "https://api.github.com/gists/2729810/a40de483e42ba33bda308371c0ef8383db73be9e" ) - self.assertEquals( self.gist.history[ 0 ].user.login, "jacquev6" ) - self.assertEquals( self.gist.history[ 0 ].version, "a40de483e42ba33bda308371c0ef8383db73be9e" ) - self.assertEquals( self.gist.html_url, "https://gist.github.com/2729810" ) - self.assertEquals( self.gist.id, "2729810" ) - self.assertEquals( self.gist.public, True ) - self.assertEquals( self.gist.updated_at, datetime.datetime( 2012, 2, 29, 16, 47, 12 ) ) - self.assertEquals( self.gist.url, "https://api.github.com/gists/2729810" ) - self.assertEquals( self.gist.user.login, "jacquev6" ) +class Gist(Framework.TestCase): + def setUp(self): + Framework.TestCase.setUp(self) + self.gist = self.g.get_gist("2729810") - def testEditWithoutParameters( self ): + def testAttributes(self): + self.assertEquals(self.gist.comments, 0) + self.assertEquals(self.gist.created_at, datetime.datetime(2012, 2, 29, 16, 47, 12)) + self.assertEquals(self.gist.description, "How to error 500 Github API v3, as requested by Rick (GitHub Staff)") + self.assertEquals(self.gist.files.keys(), ["fail_github.py"]) + self.assertEquals(self.gist.files["fail_github.py"].size, 1636) + self.assertEquals(self.gist.files["fail_github.py"].filename, "fail_github.py") + self.assertEquals(self.gist.files["fail_github.py"].language, "Python") + self.assertEquals(self.gist.files["fail_github.py"].content, 'import httplib\nimport base64\nimport json\n\nlogin = ""\npassword = ""\norgName = ""\nrepoName = "FailGithubApi"\n\ndef doRequest( verb, url, input ):\n input = json.dumps( input )\n cnx = httplib.HTTPSConnection( "api.github.com", strict = True )\n cnx.request( verb, url, input, { "Authorization" : "Basic " + base64.b64encode( login + ":" + password ).replace( \'\\n\', \'\' ) } )\n response = cnx.getresponse()\n status = response.status\n output = response.read()\n cnx.close()\n print verb, url, input, "=>", status, output\n print\n if status < 200 or status >= 300:\n exit( 1 )\n return json.loads( output )\n\n# Create a repo\ndoRequest( "POST", "/user/repos", { "name": repoName } )\n\n# Create a blob, a tree, a commit and the master branch\nb = doRequest(\n "POST", "/repos/%s/%s/git/blobs" % ( login, repoName ),\n { "content": "Content of the blob", "encoding": "latin1" }\n)\nt = doRequest(\n "POST", "/repos/%s/%s/git/trees" % ( login, repoName ),\n { "tree" : [ { "path": "foo.bar", "type": "blob", "mode": "100644", "sha": b["sha"] } ] }\n)\nc = doRequest(\n "POST", "/repos/%s/%s/git/commits" % ( login, repoName ),\n { "parents": [], "message": "Message of the commit", "tree": t["sha"] }\n)\ndoRequest(\n "POST", "/repos/%s/%s/git/refs" % ( login, repoName ),\n { "ref": "refs/heads/master", "sha": c["sha"] }\n)\n\n# Fork the repo\ndoRequest( "POST", "/repos/%s/%s/forks?org=%s" % ( login, repoName, orgName ), None )\n\n# Create a new blob => BOOM error 500\ndoRequest(\n "POST", "/repos/%s/%s/git/blobs" % ( orgName, repoName ),\n { "content": "Content of the new blob", "encoding": "latin1" }\n)\n' ) + self.assertEquals(self.gist.files["fail_github.py"].raw_url, "https://gist.github.com/raw/2729810/2fb3aa84e0efa50dc0f4c18b5df5b7b9ab27076b/fail_github.py") + self.assertEquals(self.gist.forks, []) + self.assertEquals(self.gist.git_pull_url, "git://gist.github.com/2729810.git") + self.assertEquals(self.gist.git_push_url, "git@gist.github.com:2729810.git") + self.assertEquals(len(self.gist.history), 1) + self.assertEquals(self.gist.history[0].change_status.additions, 52) + self.assertEquals(self.gist.history[0].change_status.deletions, 0) + self.assertEquals(self.gist.history[0].change_status.total, 52) + self.assertEquals(self.gist.history[0].committed_at, datetime.datetime(2012, 2, 29, 16, 47, 12)) + self.assertEquals(self.gist.history[0].url, "https://api.github.com/gists/2729810/a40de483e42ba33bda308371c0ef8383db73be9e") + self.assertEquals(self.gist.history[0].user.login, "jacquev6") + self.assertEquals(self.gist.history[0].version, "a40de483e42ba33bda308371c0ef8383db73be9e") + self.assertEquals(self.gist.html_url, "https://gist.github.com/2729810") + self.assertEquals(self.gist.id, "2729810") + self.assertEquals(self.gist.public, True) + self.assertEquals(self.gist.updated_at, datetime.datetime(2012, 2, 29, 16, 47, 12)) + self.assertEquals(self.gist.url, "https://api.github.com/gists/2729810") + self.assertEquals(self.gist.user.login, "jacquev6") + + def testEditWithoutParameters(self): self.gist.edit() - self.assertEquals( self.gist.description, "Gist created by PyGithub" ) - self.assertEquals( self.gist.updated_at, datetime.datetime( 2012, 5, 19, 7, 0, 58 ) ) + self.assertEquals(self.gist.description, "Gist created by PyGithub") + self.assertEquals(self.gist.updated_at, datetime.datetime(2012, 5, 19, 7, 0, 58)) - def testEditWithAllParameters( self ): - self.gist.edit( "Description edited by PyGithub", { "barbaz.txt": github.InputFileContent( "File also created by PyGithub" ) } ) - self.assertEquals( self.gist.description, "Description edited by PyGithub" ) - self.assertEquals( self.gist.updated_at, datetime.datetime( 2012, 5, 19, 7, 6, 10 ) ) - self.assertEquals( self.gist.files.keys(), [ "foobar.txt", "barbaz.txt" ] ) + def testEditWithAllParameters(self): + self.gist.edit("Description edited by PyGithub", {"barbaz.txt": github.InputFileContent("File also created by PyGithub")}) + self.assertEquals(self.gist.description, "Description edited by PyGithub") + self.assertEquals(self.gist.updated_at, datetime.datetime(2012, 5, 19, 7, 6, 10)) + self.assertEquals(self.gist.files.keys(), ["foobar.txt", "barbaz.txt"]) - def testCreateComment( self ): - comment = self.gist.create_comment( "Comment created by PyGithub" ) - self.assertEquals( comment.id, 323629 ) + def testCreateComment(self): + comment = self.gist.create_comment("Comment created by PyGithub") + self.assertEquals(comment.id, 323629) - def testGetComments( self ): - self.assertListKeyEqual( self.gist.get_comments(), lambda c: c.id, [ 323637 ] ) + def testGetComments(self): + self.assertListKeyEqual(self.gist.get_comments(), lambda c: c.id, [323637]) - def testStarring( self ): - self.assertFalse( self.gist.is_starred() ) + def testStarring(self): + self.assertFalse(self.gist.is_starred()) self.gist.set_starred() - self.assertTrue( self.gist.is_starred() ) + self.assertTrue(self.gist.is_starred()) self.gist.reset_starred() - self.assertFalse( self.gist.is_starred() ) + self.assertFalse(self.gist.is_starred()) - def testFork( self ): - gist = self.g.get_gist( "2729818" ) # Random gist + def testFork(self): + gist = self.g.get_gist("2729818") # Random gist myGist = gist.create_fork() - self.assertEquals( myGist.id, "2729865" ) - self.assertEquals( myGist.fork_of, None ) # WTF - sameGist = self.g.get_gist( "2729865" ) - self.assertEquals( sameGist.fork_of.id, "2729818" ) + self.assertEquals(myGist.id, "2729865") + self.assertEquals(myGist.fork_of, None) # WTF + sameGist = self.g.get_gist("2729865") + self.assertEquals(sameGist.fork_of.id, "2729818") - def testDelete( self ): + def testDelete(self): self.gist.delete() diff --git a/github/tests/GistComment.py b/github/tests/GistComment.py index 4fb3122b..08ab183d 100644 --- a/github/tests/GistComment.py +++ b/github/tests/GistComment.py @@ -15,23 +15,24 @@ import Framework import datetime -class GistComment( Framework.TestCase ): - def setUp( self ): - Framework.TestCase.setUp( self ) - self.comment = self.g.get_gist( "2729810" ).get_comment( 323629 ) - def testAttributes( self ): - self.assertEquals( self.comment.body, "Comment created by PyGithub" ) - self.assertEquals( self.comment.created_at, datetime.datetime( 2012, 5, 19, 7, 7, 57 ) ) - self.assertEquals( self.comment.id, 323629 ) - self.assertEquals( self.comment.updated_at, datetime.datetime( 2012, 5, 19, 7, 7, 57 ) ) - self.assertEquals( self.comment.url, "https://api.github.com/gists/comments/323629" ) - self.assertEquals( self.comment.user.login, "jacquev6" ) +class GistComment(Framework.TestCase): + def setUp(self): + Framework.TestCase.setUp(self) + self.comment = self.g.get_gist("2729810").get_comment(323629) - def testEdit( self ): - self.comment.edit( "Comment edited by PyGithub" ) - self.assertEquals( self.comment.body, "Comment edited by PyGithub" ) - self.assertEquals( self.comment.updated_at, datetime.datetime( 2012, 5, 19, 7, 12, 32 ) ) + def testAttributes(self): + self.assertEquals(self.comment.body, "Comment created by PyGithub") + self.assertEquals(self.comment.created_at, datetime.datetime(2012, 5, 19, 7, 7, 57)) + self.assertEquals(self.comment.id, 323629) + self.assertEquals(self.comment.updated_at, datetime.datetime(2012, 5, 19, 7, 7, 57)) + self.assertEquals(self.comment.url, "https://api.github.com/gists/comments/323629") + self.assertEquals(self.comment.user.login, "jacquev6") - def testDelete( self ): + def testEdit(self): + self.comment.edit("Comment edited by PyGithub") + self.assertEquals(self.comment.body, "Comment edited by PyGithub") + self.assertEquals(self.comment.updated_at, datetime.datetime(2012, 5, 19, 7, 12, 32)) + + def testDelete(self): self.comment.delete() diff --git a/github/tests/GitBlob.py b/github/tests/GitBlob.py index 64ef55d3..92e495ae 100644 --- a/github/tests/GitBlob.py +++ b/github/tests/GitBlob.py @@ -13,16 +13,17 @@ import Framework -class GitBlob( Framework.TestCase ): - def setUp( self ): - Framework.TestCase.setUp( self ) - self.blob = self.g.get_user().get_repo( "PyGithub" ).get_git_blob( "53bce9fa919b4544e67275089b3ec5b44be20667" ) - def testAttributes( self ): - self.assertTrue( self.blob.content.startswith( "IyEvdXNyL2Jpbi9lbnYgcHl0aG9uCgpmcm9tIGRpc3R1dGlscy5jb3JlIGlt\ncG9ydCBzZXR1cAppbXBvcnQgdGV4dHdyYXAKCnNldHVwKAogICAgbmFtZSA9\n" ) ) - self.assertTrue( self.blob.content.endswith( "Z3JhbW1pbmcgTGFuZ3VhZ2UgOjogUHl0aG9uIiwKICAgICAgICAiVG9waWMg\nOjogU29mdHdhcmUgRGV2ZWxvcG1lbnQiLAogICAgXSwKKQo=\n" ) ) - self.assertEqual( len( self.blob.content ), 1757 ) - self.assertEqual( self.blob.encoding, "base64" ) - self.assertEqual( self.blob.size, 1295 ) - self.assertEqual( self.blob.sha, "53bce9fa919b4544e67275089b3ec5b44be20667" ) - self.assertEqual( self.blob.url, "https://api.github.com/repos/jacquev6/PyGithub/git/blobs/53bce9fa919b4544e67275089b3ec5b44be20667" ) +class GitBlob(Framework.TestCase): + def setUp(self): + Framework.TestCase.setUp(self) + self.blob = self.g.get_user().get_repo("PyGithub").get_git_blob("53bce9fa919b4544e67275089b3ec5b44be20667") + + def testAttributes(self): + self.assertTrue(self.blob.content.startswith("IyEvdXNyL2Jpbi9lbnYgcHl0aG9uCgpmcm9tIGRpc3R1dGlscy5jb3JlIGlt\ncG9ydCBzZXR1cAppbXBvcnQgdGV4dHdyYXAKCnNldHVwKAogICAgbmFtZSA9\n")) + self.assertTrue(self.blob.content.endswith("Z3JhbW1pbmcgTGFuZ3VhZ2UgOjogUHl0aG9uIiwKICAgICAgICAiVG9waWMg\nOjogU29mdHdhcmUgRGV2ZWxvcG1lbnQiLAogICAgXSwKKQo=\n")) + self.assertEqual(len(self.blob.content), 1757) + self.assertEqual(self.blob.encoding, "base64") + self.assertEqual(self.blob.size, 1295) + self.assertEqual(self.blob.sha, "53bce9fa919b4544e67275089b3ec5b44be20667") + self.assertEqual(self.blob.url, "https://api.github.com/repos/jacquev6/PyGithub/git/blobs/53bce9fa919b4544e67275089b3ec5b44be20667") diff --git a/github/tests/GitCommit.py b/github/tests/GitCommit.py index f85a667e..d2d71871 100644 --- a/github/tests/GitCommit.py +++ b/github/tests/GitCommit.py @@ -15,22 +15,23 @@ import datetime import Framework -class GitCommit( Framework.TestCase ): - def setUp( self ): - Framework.TestCase.setUp( self ) - self.commit = self.g.get_user().get_repo( "PyGithub" ).get_git_commit( "4303c5b90e2216d927155e9609436ccb8984c495" ) - def testAttributes( self ): - self.assertEqual( self.commit.author.name, "Vincent Jacques" ) - self.assertEqual( self.commit.author.email, "vincent@vincent-jacques.net" ) - self.assertEqual( self.commit.author.date, datetime.datetime( 2012, 4, 17, 17, 55, 16 ) ) - self.assertEqual( self.commit.committer.name, "Vincent Jacques" ) - self.assertEqual( self.commit.committer.email, "vincent@vincent-jacques.net" ) - self.assertEqual( self.commit.committer.date, datetime.datetime( 2012, 4, 17, 17, 55, 16 ) ) - self.assertEqual( self.commit.message, "Merge branch 'develop'\n" ) - self.assertEqual( len( self.commit.parents ), 2 ) - self.assertEqual( self.commit.parents[ 0 ].sha, "936f4a97f1a86392637ec002bbf89ff036a5062d" ) - self.assertEqual( self.commit.parents[ 1 ].sha, "2a7e80e6421c5d4d201d60619068dea6bae612cb" ) - self.assertEqual( self.commit.sha, "4303c5b90e2216d927155e9609436ccb8984c495" ) - self.assertEqual( self.commit.tree.sha, "f492784d8ca837779650d1fb406a1a3587a764ad" ) - self.assertEqual( self.commit.url, "https://api.github.com/repos/jacquev6/PyGithub/git/commits/4303c5b90e2216d927155e9609436ccb8984c495" ) +class GitCommit(Framework.TestCase): + def setUp(self): + Framework.TestCase.setUp(self) + self.commit = self.g.get_user().get_repo("PyGithub").get_git_commit("4303c5b90e2216d927155e9609436ccb8984c495") + + def testAttributes(self): + self.assertEqual(self.commit.author.name, "Vincent Jacques") + self.assertEqual(self.commit.author.email, "vincent@vincent-jacques.net") + self.assertEqual(self.commit.author.date, datetime.datetime(2012, 4, 17, 17, 55, 16)) + self.assertEqual(self.commit.committer.name, "Vincent Jacques") + self.assertEqual(self.commit.committer.email, "vincent@vincent-jacques.net") + self.assertEqual(self.commit.committer.date, datetime.datetime(2012, 4, 17, 17, 55, 16)) + self.assertEqual(self.commit.message, "Merge branch 'develop'\n") + self.assertEqual(len(self.commit.parents), 2) + self.assertEqual(self.commit.parents[0].sha, "936f4a97f1a86392637ec002bbf89ff036a5062d") + self.assertEqual(self.commit.parents[1].sha, "2a7e80e6421c5d4d201d60619068dea6bae612cb") + self.assertEqual(self.commit.sha, "4303c5b90e2216d927155e9609436ccb8984c495") + self.assertEqual(self.commit.tree.sha, "f492784d8ca837779650d1fb406a1a3587a764ad") + self.assertEqual(self.commit.url, "https://api.github.com/repos/jacquev6/PyGithub/git/commits/4303c5b90e2216d927155e9609436ccb8984c495") diff --git a/github/tests/GitRef.py b/github/tests/GitRef.py index df53f017..67e4ddc0 100644 --- a/github/tests/GitRef.py +++ b/github/tests/GitRef.py @@ -13,23 +13,24 @@ import Framework -class GitRef( Framework.TestCase ): - def setUp( self ): - Framework.TestCase.setUp( self ) - self.ref = self.g.get_user().get_repo( "PyGithub" ).get_git_ref( "refs/heads/BranchCreatedByPyGithub" ) - def testAttributes( self ): - self.assertEqual( self.ref.object.sha, "1292bf0e22c796e91cc3d6e24b544aece8c21f2a" ) - self.assertEqual( self.ref.object.type, "commit" ) - self.assertEqual( self.ref.object.url, "https://api.github.com/repos/jacquev6/PyGithub/git/commits/1292bf0e22c796e91cc3d6e24b544aece8c21f2a" ) - self.assertEqual( self.ref.ref, "refs/heads/BranchCreatedByPyGithub" ) - self.assertEqual( self.ref.url, "https://api.github.com/repos/jacquev6/PyGithub/git/refs/heads/BranchCreatedByPyGithub" ) +class GitRef(Framework.TestCase): + def setUp(self): + Framework.TestCase.setUp(self) + self.ref = self.g.get_user().get_repo("PyGithub").get_git_ref("refs/heads/BranchCreatedByPyGithub") - def testEdit( self ): - self.ref.edit( "04cde900a0775b51f762735637bd30de392a2793" ) + def testAttributes(self): + self.assertEqual(self.ref.object.sha, "1292bf0e22c796e91cc3d6e24b544aece8c21f2a") + self.assertEqual(self.ref.object.type, "commit") + self.assertEqual(self.ref.object.url, "https://api.github.com/repos/jacquev6/PyGithub/git/commits/1292bf0e22c796e91cc3d6e24b544aece8c21f2a") + self.assertEqual(self.ref.ref, "refs/heads/BranchCreatedByPyGithub") + self.assertEqual(self.ref.url, "https://api.github.com/repos/jacquev6/PyGithub/git/refs/heads/BranchCreatedByPyGithub") - def testEditWithForce( self ): - self.ref.edit( "4303c5b90e2216d927155e9609436ccb8984c495", force = True ) + def testEdit(self): + self.ref.edit("04cde900a0775b51f762735637bd30de392a2793") - def testDelete( self ): + def testEditWithForce(self): + self.ref.edit("4303c5b90e2216d927155e9609436ccb8984c495", force=True) + + def testDelete(self): self.ref.delete() diff --git a/github/tests/GitTag.py b/github/tests/GitTag.py index f7fb6f84..eb20977c 100644 --- a/github/tests/GitTag.py +++ b/github/tests/GitTag.py @@ -15,19 +15,20 @@ import datetime import Framework -class GitTag( Framework.TestCase ): - def setUp( self ): - Framework.TestCase.setUp( self ) - self.tag = self.g.get_user().get_repo( "PyGithub" ).get_git_tag( "f5f37322407b02a80de4526ad88d5f188977bc3c" ) - def testAttributes( self ): - self.assertEqual( self.tag.message, "Version 0.6\n" ) - self.assertEqual( self.tag.object.sha, "4303c5b90e2216d927155e9609436ccb8984c495" ) - self.assertEqual( self.tag.object.type, "commit" ) - self.assertEqual( self.tag.object.url, "https://api.github.com/repos/jacquev6/PyGithub/git/commits/4303c5b90e2216d927155e9609436ccb8984c495" ) - self.assertEqual( self.tag.sha, "f5f37322407b02a80de4526ad88d5f188977bc3c" ) - self.assertEqual( self.tag.tag, "v0.6" ) - self.assertEqual( self.tag.tagger.date, datetime.datetime( 2012, 5, 10, 18, 14, 15 ) ) - self.assertEqual( self.tag.tagger.email, "vincent@vincent-jacques.net" ) - self.assertEqual( self.tag.tagger.name, "Vincent Jacques" ) - self.assertEqual( self.tag.url, "https://api.github.com/repos/jacquev6/PyGithub/git/tags/f5f37322407b02a80de4526ad88d5f188977bc3c" ) +class GitTag(Framework.TestCase): + def setUp(self): + Framework.TestCase.setUp(self) + self.tag = self.g.get_user().get_repo("PyGithub").get_git_tag("f5f37322407b02a80de4526ad88d5f188977bc3c") + + def testAttributes(self): + self.assertEqual(self.tag.message, "Version 0.6\n") + self.assertEqual(self.tag.object.sha, "4303c5b90e2216d927155e9609436ccb8984c495") + self.assertEqual(self.tag.object.type, "commit") + self.assertEqual(self.tag.object.url, "https://api.github.com/repos/jacquev6/PyGithub/git/commits/4303c5b90e2216d927155e9609436ccb8984c495") + self.assertEqual(self.tag.sha, "f5f37322407b02a80de4526ad88d5f188977bc3c") + self.assertEqual(self.tag.tag, "v0.6") + self.assertEqual(self.tag.tagger.date, datetime.datetime(2012, 5, 10, 18, 14, 15)) + self.assertEqual(self.tag.tagger.email, "vincent@vincent-jacques.net") + self.assertEqual(self.tag.tagger.name, "Vincent Jacques") + self.assertEqual(self.tag.url, "https://api.github.com/repos/jacquev6/PyGithub/git/tags/f5f37322407b02a80de4526ad88d5f188977bc3c") diff --git a/github/tests/GitTree.py b/github/tests/GitTree.py index f660125c..7a512d8d 100644 --- a/github/tests/GitTree.py +++ b/github/tests/GitTree.py @@ -13,24 +13,25 @@ import Framework -class GitTree( Framework.TestCase ): - def setUp( self ): - Framework.TestCase.setUp( self ) - self.tree = self.g.get_user().get_repo( "PyGithub" ).get_git_tree( "f492784d8ca837779650d1fb406a1a3587a764ad" ) - def testAttributes( self ): - self.assertEqual( self.tree.sha, "f492784d8ca837779650d1fb406a1a3587a764ad" ) - self.assertEqual( len( self.tree.tree ), 11 ) - self.assertEqual( self.tree.tree[ 0 ].mode, "100644" ) - self.assertEqual( self.tree.tree[ 0 ].path, ".gitignore" ) - self.assertEqual( self.tree.tree[ 0 ].sha, "8a9af1462c3f4e3358315c2d2e6ef1e7334c59dd" ) - self.assertEqual( self.tree.tree[ 0 ].size, 53 ) - self.assertEqual( self.tree.tree[ 0 ].type, "blob" ) - self.assertEqual( self.tree.tree[ 0 ].url, "https://api.github.com/repos/jacquev6/PyGithub/git/blobs/8a9af1462c3f4e3358315c2d2e6ef1e7334c59dd" ) - self.assertEqual( self.tree.tree[ 6 ].mode, "040000" ) - self.assertEqual( self.tree.tree[ 6 ].path, "ReplayDataForIntegrationTest" ) - self.assertEqual( self.tree.tree[ 6 ].sha, "60b4602b2c2070246c5df078fb7a5150b45815eb" ) - self.assertEqual( self.tree.tree[ 6 ].size, None ) - self.assertEqual( self.tree.tree[ 6 ].type, "tree" ) - self.assertEqual( self.tree.tree[ 6 ].url, "https://api.github.com/repos/jacquev6/PyGithub/git/trees/60b4602b2c2070246c5df078fb7a5150b45815eb" ) - self.assertEqual( self.tree.url, "https://api.github.com/repos/jacquev6/PyGithub/git/trees/f492784d8ca837779650d1fb406a1a3587a764ad" ) +class GitTree(Framework.TestCase): + def setUp(self): + Framework.TestCase.setUp(self) + self.tree = self.g.get_user().get_repo("PyGithub").get_git_tree("f492784d8ca837779650d1fb406a1a3587a764ad") + + def testAttributes(self): + self.assertEqual(self.tree.sha, "f492784d8ca837779650d1fb406a1a3587a764ad") + self.assertEqual(len(self.tree.tree), 11) + self.assertEqual(self.tree.tree[0].mode, "100644") + self.assertEqual(self.tree.tree[0].path, ".gitignore") + self.assertEqual(self.tree.tree[0].sha, "8a9af1462c3f4e3358315c2d2e6ef1e7334c59dd") + self.assertEqual(self.tree.tree[0].size, 53) + self.assertEqual(self.tree.tree[0].type, "blob") + self.assertEqual(self.tree.tree[0].url, "https://api.github.com/repos/jacquev6/PyGithub/git/blobs/8a9af1462c3f4e3358315c2d2e6ef1e7334c59dd") + self.assertEqual(self.tree.tree[6].mode, "040000") + self.assertEqual(self.tree.tree[6].path, "ReplayDataForIntegrationTest") + self.assertEqual(self.tree.tree[6].sha, "60b4602b2c2070246c5df078fb7a5150b45815eb") + self.assertEqual(self.tree.tree[6].size, None) + self.assertEqual(self.tree.tree[6].type, "tree") + self.assertEqual(self.tree.tree[6].url, "https://api.github.com/repos/jacquev6/PyGithub/git/trees/60b4602b2c2070246c5df078fb7a5150b45815eb") + self.assertEqual(self.tree.url, "https://api.github.com/repos/jacquev6/PyGithub/git/trees/f492784d8ca837779650d1fb406a1a3587a764ad") diff --git a/github/tests/Github.py b/github/tests/Github.py index 79bb107e..899b7beb 100644 --- a/github/tests/Github.py +++ b/github/tests/Github.py @@ -15,77 +15,78 @@ import datetime import Framework -class Github( Framework.TestCase ): - def testGetGists( self ): - self.assertListKeyBegin( self.g.get_gists(), lambda g: g.id, [ "2729695", "2729656", "2729597", "2729584", "2729569", "2729554", "2729543", "2729537", "2729536", "2729533", "2729525", "2729522", "2729519", "2729515", "2729506", "2729487", "2729484", "2729482", "2729441", "2729432", "2729420", "2729398", "2729372", "2729371", "2729351", "2729346", "2729316", "2729304", "2729296", "2729276", "2729272", "2729265", "2729195", "2729160", "2729143", "2729127", "2729119", "2729113", "2729103", "2729069", "2729059", "2729051", "2729029", "2729027", "2729026", "2729022", "2729002", "2728985", "2728979", "2728964", "2728937", "2728933", "2728884", "2728869", "2728866", "2728855", "2728854", "2728853", "2728846", "2728825", "2728814", "2728813", "2728812", "2728805", "2728802", "2728800", "2728798", "2728797", "2728796", "2728793", "2728758", "2728754", "2728751", "2728748", "2728721", "2728716", "2728715", "2728705", "2728701", "2728699", "2728697", "2728688", "2728683", "2728677", "2728649", "2728640", "2728625", "2728620", "2728615", "2728614", "2728565", "2728564", "2728554", "2728523", "2728519", "2728511", "2728497", "2728496", "2728495", "2728487" ] ) - def testLegacySearchRepos( self ): - repos = self.g.legacy_search_repos( "github api v3" ) - self.assertListKeyBegin( repos, lambda r: r.name, [ "octokit", "github-v3-api", "github_v3_api" ] ) - self.assertEqual( repos[ 0 ].full_name, "pengwynn/octokit" ) +class Github(Framework.TestCase): + def testGetGists(self): + self.assertListKeyBegin(self.g.get_gists(), lambda g: g.id, ["2729695", "2729656", "2729597", "2729584", "2729569", "2729554", "2729543", "2729537", "2729536", "2729533", "2729525", "2729522", "2729519", "2729515", "2729506", "2729487", "2729484", "2729482", "2729441", "2729432", "2729420", "2729398", "2729372", "2729371", "2729351", "2729346", "2729316", "2729304", "2729296", "2729276", "2729272", "2729265", "2729195", "2729160", "2729143", "2729127", "2729119", "2729113", "2729103", "2729069", "2729059", "2729051", "2729029", "2729027", "2729026", "2729022", "2729002", "2728985", "2728979", "2728964", "2728937", "2728933", "2728884", "2728869", "2728866", "2728855", "2728854", "2728853", "2728846", "2728825", "2728814", "2728813", "2728812", "2728805", "2728802", "2728800", "2728798", "2728797", "2728796", "2728793", "2728758", "2728754", "2728751", "2728748", "2728721", "2728716", "2728715", "2728705", "2728701", "2728699", "2728697", "2728688", "2728683", "2728677", "2728649", "2728640", "2728625", "2728620", "2728615", "2728614", "2728565", "2728564", "2728554", "2728523", "2728519", "2728511", "2728497", "2728496", "2728495", "2728487"]) + + def testLegacySearchRepos(self): + repos = self.g.legacy_search_repos("github api v3") + self.assertListKeyBegin(repos, lambda r: r.name, ["octokit", "github-v3-api", "github_v3_api"]) + self.assertEqual(repos[0].full_name, "pengwynn/octokit") # Attributes retrieved from legacy API without lazy completion call - self.assertEqual( repos[ 1 ].created_at, datetime.datetime( 2011, 6, 23, 22, 52, 33 ) ) - self.assertEqual( repos[ 1 ].name, "github-v3-api" ) - self.assertEqual( repos[ 1 ].watchers, 35 ) - self.assertEqual( repos[ 1 ].has_downloads, True ) - self.assertEqual( repos[ 3 ].homepage, "http://peter-murach.github.com/github" ) - self.assertEqual( repos[ 1 ].url, "/repos/jwilger/github-v3-api" ) - self.assertEqual( repos[ 1 ].fork, False ) - self.assertEqual( repos[ 1 ].has_issues, True ) - self.assertEqual( repos[ 1 ].has_wiki, False ) - self.assertEqual( repos[ 1 ].forks, 13 ) - self.assertEqual( repos[ 1 ].size, 212 ) - self.assertEqual( repos[ 1 ].private, False ) - self.assertEqual( repos[ 1 ].open_issues, 2 ) - self.assertEqual( repos[ 3 ].pushed_at, datetime.datetime( 2012, 6, 28, 21, 26, 31 ) ) - self.assertEqual( repos[ 1 ].description, "Ruby Client for the GitHub v3 API" ) - self.assertEqual( repos[ 1 ].language, "Ruby" ) - self.assertEqual( repos[ 1 ].owner.login, "jwilger" ) - self.assertEqual( repos[ 1 ].owner.url, "/users/jwilger" ) + self.assertEqual(repos[1].created_at, datetime.datetime(2011, 6, 23, 22, 52, 33)) + self.assertEqual(repos[1].name, "github-v3-api") + self.assertEqual(repos[1].watchers, 35) + self.assertEqual(repos[1].has_downloads, True) + self.assertEqual(repos[3].homepage, "http://peter-murach.github.com/github") + self.assertEqual(repos[1].url, "/repos/jwilger/github-v3-api") + self.assertEqual(repos[1].fork, False) + self.assertEqual(repos[1].has_issues, True) + self.assertEqual(repos[1].has_wiki, False) + self.assertEqual(repos[1].forks, 13) + self.assertEqual(repos[1].size, 212) + self.assertEqual(repos[1].private, False) + self.assertEqual(repos[1].open_issues, 2) + self.assertEqual(repos[3].pushed_at, datetime.datetime(2012, 6, 28, 21, 26, 31)) + self.assertEqual(repos[1].description, "Ruby Client for the GitHub v3 API") + self.assertEqual(repos[1].language, "Ruby") + self.assertEqual(repos[1].owner.login, "jwilger") + self.assertEqual(repos[1].owner.url, "/users/jwilger") - def testLegacySearchReposPagination( self ): - repos = self.g.legacy_search_repos( "document" ) - self.assertListKeyBegin( repos, lambda r: r.name, [ "git", "nimbus", "kss", "sstoolkit", "lawnchair", "appledoc", "jQ.Mobi", "ipython", "mongoengine", "ravendb", "substance", "symfony-docs", "JavaScript-Garden", "DocSets-for-iOS", "yard", "phpDocumentor2", "phpsh", "Tangle", "Ingredients", "documentjs", "xhp", "couchdb-lucene", "dox", "magento2", "javascriptmvc", "FastPdfKit", "roar", "DocumentUp", "NoRM", "jsdoc", "tagger", "mongodb-csharp", "php-github-api", "beautiful-docs", "mongodb-odm", "iodocs", "seesaw", "bcx-api", "developer.github.com", "amqp", "docsplit", "pycco", "standards-and-practices", "tidy-html5", "redis-doc", "tomdoc", "docs", "flourish", "userguide", "swagger-ui", "rfc", "Weasel-Diesel", "yuidoc", "apigen", "document-viewer", "develop.github.com", "Shanty-Mongo", "PTShowcaseViewController", "gravatar_image_tag", "api-wow-docs", "mongoid-tree", "safari-json-formatter", "mayan", "orm-documentation", "jsfiddle-docs-alpha", "core", "documentcloud", "flexible-nav", "writeCapture", "readium", "xmldocument", "Documentation-Examples", "grails-doc", "stdeb", "aws-autoscaling", "voteable_mongo", "review", "spreadsheet_on_rails", "UKSyntaxColoredTextDocument", "mandango", "bdoc", "Documentation", "documents.com", "rghost", "ticket_mule", "vendo", "khan-api", "spring-data-document-examples", "rspec_api_documentation", "axlsx", "phpdox", "documentation", "Sami", "innershiv", "doxyclean", "documents", "rvm-site", "jqapi", "documentation", "hadoopy", "VichUploaderBundle", "pdoc", "documentation", "wii-js", "oss-docs", "scala-maven-plugin", "Documents", "documenter", "behemoth", "documentation", "documentation", "propelorm.github.com", "Kobold2D", "AutoObjectDocumentation", "php-mongodb-admin", "django-mongokit", "puppet-docs", "docs", "Document", "vendorer", "symfony1-docs", "shocco", "documentation", "jog", "docs", "documentation", "documentation", "documentation", "documentation", "Documentation", "documentation", "documentation", "phpunit-documentation", "ADCtheme", "NelmioApiDocBundle", "iCloud-Singleton-CloudMe", "Documentation", "document", "document_mapper", "heroku-docs", "couchdb-odm", "documentation", "documentation", "document", "documentation", "NanoStore", "documentation", "Documentation", "documentation", "Documentation", "documentation", "document", "documentation", "documentation", "Documentation", "Documentation", "grendel", "ceylon-compiler", "mbtiles-spec", "documentation", "documents", "documents", "Documents", "Documentation", "documentation", "Documentation", "documentation", "documents", "Documentation", "documentation", "documentation", "documents", "Documentation", "documentation", "documenter", "documentation", "documents", "Documents", "documents", "documents", "documentation", "Document", "document", "rdoc", "mongoid_token", "travis-ci.github.com", "Documents", "Documents", "documents", "Document", "Documentation", "documents", "Documents", "Documentation", "documents", "documents", "documents", "documentation", "Documents", "Document", "documents", "documents", "Documentation", "Documentation", "Document", "documents", "Documents", "Documents", "Documentation", "Documents", "documents", "Documents", "document", "documents", "Documentation", "Documents", "documents", "documents", "Documents", "documents", "Documentation", "documentation", "Document", "Documents", "documents", "documents", "documents", "Documentation", "Documentation", "Documents", "Documents", "Documents", "Documenter", "document", "Documentation", "Documents", "Documents", "documentation", "documentation", "Document", "Documents", "Documentation", "Documentation", "Documents", "documents", "Documents", "document", "documentation", "Documents", "documentation", "documentation", "documentation", "Documentation", "Documents", "Documents", "documentation", "Documents", "Documents", "documentation", "documentation", "documents", "Documentation", "documents", "documentation", "Documentation", "Documents", "documentation", "documentation", "documents", "documentation", "Umbraco5Docs", "documents", "Documents", "Documentation", "documents", "document", "documents", "document", "documents", "documentation", "Documents", "documents", "document", "Documents", "Documentation", "Documentation", "documentation", "Documentation", "document", "documentation", "documents", "documents", "Documentations", "document", "documentation", "Documentation", "Document", "Documents", "Documents", "Document" ] ) + def testLegacySearchReposPagination(self): + repos = self.g.legacy_search_repos("document") + self.assertListKeyBegin(repos, lambda r: r.name, ["git", "nimbus", "kss", "sstoolkit", "lawnchair", "appledoc", "jQ.Mobi", "ipython", "mongoengine", "ravendb", "substance", "symfony-docs", "JavaScript-Garden", "DocSets-for-iOS", "yard", "phpDocumentor2", "phpsh", "Tangle", "Ingredients", "documentjs", "xhp", "couchdb-lucene", "dox", "magento2", "javascriptmvc", "FastPdfKit", "roar", "DocumentUp", "NoRM", "jsdoc", "tagger", "mongodb-csharp", "php-github-api", "beautiful-docs", "mongodb-odm", "iodocs", "seesaw", "bcx-api", "developer.github.com", "amqp", "docsplit", "pycco", "standards-and-practices", "tidy-html5", "redis-doc", "tomdoc", "docs", "flourish", "userguide", "swagger-ui", "rfc", "Weasel-Diesel", "yuidoc", "apigen", "document-viewer", "develop.github.com", "Shanty-Mongo", "PTShowcaseViewController", "gravatar_image_tag", "api-wow-docs", "mongoid-tree", "safari-json-formatter", "mayan", "orm-documentation", "jsfiddle-docs-alpha", "core", "documentcloud", "flexible-nav", "writeCapture", "readium", "xmldocument", "Documentation-Examples", "grails-doc", "stdeb", "aws-autoscaling", "voteable_mongo", "review", "spreadsheet_on_rails", "UKSyntaxColoredTextDocument", "mandango", "bdoc", "Documentation", "documents.com", "rghost", "ticket_mule", "vendo", "khan-api", "spring-data-document-examples", "rspec_api_documentation", "axlsx", "phpdox", "documentation", "Sami", "innershiv", "doxyclean", "documents", "rvm-site", "jqapi", "documentation", "hadoopy", "VichUploaderBundle", "pdoc", "documentation", "wii-js", "oss-docs", "scala-maven-plugin", "Documents", "documenter", "behemoth", "documentation", "documentation", "propelorm.github.com", "Kobold2D", "AutoObjectDocumentation", "php-mongodb-admin", "django-mongokit", "puppet-docs", "docs", "Document", "vendorer", "symfony1-docs", "shocco", "documentation", "jog", "docs", "documentation", "documentation", "documentation", "documentation", "Documentation", "documentation", "documentation", "phpunit-documentation", "ADCtheme", "NelmioApiDocBundle", "iCloud-Singleton-CloudMe", "Documentation", "document", "document_mapper", "heroku-docs", "couchdb-odm", "documentation", "documentation", "document", "documentation", "NanoStore", "documentation", "Documentation", "documentation", "Documentation", "documentation", "document", "documentation", "documentation", "Documentation", "Documentation", "grendel", "ceylon-compiler", "mbtiles-spec", "documentation", "documents", "documents", "Documents", "Documentation", "documentation", "Documentation", "documentation", "documents", "Documentation", "documentation", "documentation", "documents", "Documentation", "documentation", "documenter", "documentation", "documents", "Documents", "documents", "documents", "documentation", "Document", "document", "rdoc", "mongoid_token", "travis-ci.github.com", "Documents", "Documents", "documents", "Document", "Documentation", "documents", "Documents", "Documentation", "documents", "documents", "documents", "documentation", "Documents", "Document", "documents", "documents", "Documentation", "Documentation", "Document", "documents", "Documents", "Documents", "Documentation", "Documents", "documents", "Documents", "document", "documents", "Documentation", "Documents", "documents", "documents", "Documents", "documents", "Documentation", "documentation", "Document", "Documents", "documents", "documents", "documents", "Documentation", "Documentation", "Documents", "Documents", "Documents", "Documenter", "document", "Documentation", "Documents", "Documents", "documentation", "documentation", "Document", "Documents", "Documentation", "Documentation", "Documents", "documents", "Documents", "document", "documentation", "Documents", "documentation", "documentation", "documentation", "Documentation", "Documents", "Documents", "documentation", "Documents", "Documents", "documentation", "documentation", "documents", "Documentation", "documents", "documentation", "Documentation", "Documents", "documentation", "documentation", "documents", "documentation", "Umbraco5Docs", "documents", "Documents", "Documentation", "documents", "document", "documents", "document", "documents", "documentation", "Documents", "documents", "document", "Documents", "Documentation", "Documentation", "documentation", "Documentation", "document", "documentation", "documents", "documents", "Documentations", "document", "documentation", "Documentation", "Document", "Documents", "Documents", "Document"]) - def testLegacySearchReposExplicitPagination( self ): - repos = self.g.legacy_search_repos( "python" ) - self.assertEqual( [ r.name for r in repos.get_page( 4 ) ], [ "assetic", "cartodb", "cuisine", "gae-sessions", "geoalchemy2", "Multicorn", "wmfr-timeline", "redis-rdb-tools", "applet-workflows", "TweetBuff", "groovy-core", "StarTrekGame", "Nuevo", "Cupid", "node-sqlserver", "Magnet2Torrent", "GroundControl", "mock-django", "4bit", "mock-django", "Fabulous", "SFML", "pydicas", "flixel", "up", "mongrel2", "SimpleHTTPServerJs", "ultimos", "Archipel", "JSbooks", "nova", "nodebox", "simplehttp", "dablooms", "solarized", "landslide", "jQuery-File-Upload", "jQuery-File-Upload", "jQuery-File-Upload", "password-manager", "electrum", "twitter_nlp", "djangbone", "pyxfst", "node-gyp", "flare", "www.gittip.com", "wymeditor", "Kokobox", "MyCQ", "runwalk", "git-sweep", "HPCPythonSC2012", "sundown", "node2dm", "statirator", "fantastic-futures", "chainsaw", "itcursos-gerenciador-tarefas", "TideSDK", "genmaybot", "melpa", "ConnectedWire", "tarantool", "anserindicus_sn", "luvit", "Minecraft-Overviewer", "Iconic", "pyist.net", "wikibok", "mejorenvo-scraper", "NewsBlur", "SocketRocket", "spf13-vim", "IWantToWorkAtGloboCom", "ruby-style-guide", "aery32-refguide", "fafsite", "compsense_demo", "enaml", "mpi4py", "fi.pycon.org", "scikits-image", "scikits-image", "uni", "mako.vim", "mako.vim", "slumber", "de-composer", "nvm", "helloshopply", "Alianza", "vimfiles", "socorro-crashstats", "menu", "analytics", "elFinder", "riak_wiki", "livestreamer", "git-goggles" ] ) + def testLegacySearchReposExplicitPagination(self): + repos = self.g.legacy_search_repos("python") + self.assertEqual([r.name for r in repos.get_page(4)], ["assetic", "cartodb", "cuisine", "gae-sessions", "geoalchemy2", "Multicorn", "wmfr-timeline", "redis-rdb-tools", "applet-workflows", "TweetBuff", "groovy-core", "StarTrekGame", "Nuevo", "Cupid", "node-sqlserver", "Magnet2Torrent", "GroundControl", "mock-django", "4bit", "mock-django", "Fabulous", "SFML", "pydicas", "flixel", "up", "mongrel2", "SimpleHTTPServerJs", "ultimos", "Archipel", "JSbooks", "nova", "nodebox", "simplehttp", "dablooms", "solarized", "landslide", "jQuery-File-Upload", "jQuery-File-Upload", "jQuery-File-Upload", "password-manager", "electrum", "twitter_nlp", "djangbone", "pyxfst", "node-gyp", "flare", "www.gittip.com", "wymeditor", "Kokobox", "MyCQ", "runwalk", "git-sweep", "HPCPythonSC2012", "sundown", "node2dm", "statirator", "fantastic-futures", "chainsaw", "itcursos-gerenciador-tarefas", "TideSDK", "genmaybot", "melpa", "ConnectedWire", "tarantool", "anserindicus_sn", "luvit", "Minecraft-Overviewer", "Iconic", "pyist.net", "wikibok", "mejorenvo-scraper", "NewsBlur", "SocketRocket", "spf13-vim", "IWantToWorkAtGloboCom", "ruby-style-guide", "aery32-refguide", "fafsite", "compsense_demo", "enaml", "mpi4py", "fi.pycon.org", "scikits-image", "scikits-image", "uni", "mako.vim", "mako.vim", "slumber", "de-composer", "nvm", "helloshopply", "Alianza", "vimfiles", "socorro-crashstats", "menu", "analytics", "elFinder", "riak_wiki", "livestreamer", "git-goggles"]) - def testLegacySearchReposWithLanguage( self ): - repos = self.g.legacy_search_repos( "document", language = "Python" ) - self.assertListKeyBegin( repos, lambda r: r.name, [ "ipython", "mongoengine", "tagger" ] ) - self.assertEqual( repos[ 0 ].full_name, "ipython/ipython" ) + def testLegacySearchReposWithLanguage(self): + repos = self.g.legacy_search_repos("document", language="Python") + self.assertListKeyBegin(repos, lambda r: r.name, ["ipython", "mongoengine", "tagger"]) + self.assertEqual(repos[0].full_name, "ipython/ipython") - def testLegacySearchUsers( self ): - users = self.g.legacy_search_users( "vincent" ) - self.assertListKeyBegin( users, lambda u: u.login, [ "nvie", "obra", "lusis" ] ) + def testLegacySearchUsers(self): + users = self.g.legacy_search_users("vincent") + self.assertListKeyBegin(users, lambda u: u.login, ["nvie", "obra", "lusis"]) # Attributes retrieved from legacy API without lazy completion call - self.assertEqual( users[ 0 ].gravatar_id, "c5a7f21b46df698f3db31c37ed0cf55a" ) - self.assertEqual( users[ 0 ].name, "Vincent Driessen" ) - self.assertEqual( users[ 0 ].created_at, datetime.datetime( 2009, 5, 12, 21, 19, 38 ) ) - self.assertEqual( users[ 0 ].location, "Netherlands" ) - self.assertEqual( users[ 0 ].followers, 310 ) - self.assertEqual( users[ 0 ].public_repos, 63 ) - self.assertEqual( users[ 0 ].login, "nvie" ) + self.assertEqual(users[0].gravatar_id, "c5a7f21b46df698f3db31c37ed0cf55a") + self.assertEqual(users[0].name, "Vincent Driessen") + self.assertEqual(users[0].created_at, datetime.datetime(2009, 5, 12, 21, 19, 38)) + self.assertEqual(users[0].location, "Netherlands") + self.assertEqual(users[0].followers, 310) + self.assertEqual(users[0].public_repos, 63) + self.assertEqual(users[0].login, "nvie") - def testLegacySearchUsersPagination( self ): - self.assertEqual( len( list( self.g.legacy_search_users( "Lucy" ) ) ), 146 ) + def testLegacySearchUsersPagination(self): + self.assertEqual(len(list(self.g.legacy_search_users("Lucy"))), 146) - def testLegacySearchUsersExplicitPagination( self ): - users = self.g.legacy_search_users( "Lucy" ) - self.assertEqual( [ u.login for u in users.get_page( 1 ) ], [ "lucievh", "lucyim", "Lucief", "RevolverUpstairs", "seriousprogramming", "reicul", "davincidubai", "LucianaNascimentodoPrado", "lucia-huenchunao", "kraji20", "Lucywolo", "Luciel", "sunnysummer", "elush", "oprealuci", "Flika", "lsher", "datadrivenjournalism", "nill2020", "doobi", "lucilu", "deldeldel", "lucianacocca", "lucyli-sfdc", "lucysatchell", "UBM", "kolousek", "lucyzhang", "lmegia", "luisolivo", "Lucyzhen", "Luhzinha", "beautifly", "lucybm96", "BuonocoreL", "lucywilliams", "ZxOxZ", "Motwinb", "johnlucy", "Aquanimation", "alaltaieri", "lucylin", "lucychambers", "JuanSesma", "cdwwebware", "ZachWills" ] ) + def testLegacySearchUsersExplicitPagination(self): + users = self.g.legacy_search_users("Lucy") + self.assertEqual([u.login for u in users.get_page(1)], ["lucievh", "lucyim", "Lucief", "RevolverUpstairs", "seriousprogramming", "reicul", "davincidubai", "LucianaNascimentodoPrado", "lucia-huenchunao", "kraji20", "Lucywolo", "Luciel", "sunnysummer", "elush", "oprealuci", "Flika", "lsher", "datadrivenjournalism", "nill2020", "doobi", "lucilu", "deldeldel", "lucianacocca", "lucyli-sfdc", "lucysatchell", "UBM", "kolousek", "lucyzhang", "lmegia", "luisolivo", "Lucyzhen", "Luhzinha", "beautifly", "lucybm96", "BuonocoreL", "lucywilliams", "ZxOxZ", "Motwinb", "johnlucy", "Aquanimation", "alaltaieri", "lucylin", "lucychambers", "JuanSesma", "cdwwebware", "ZachWills"]) - def testLegacySearchUserByEmail( self ): - user = self.g.legacy_search_user_by_email( "vincent@vincent-jacques.net" ) - self.assertEqual( user.login, "jacquev6" ) - self.assertEqual( user.followers, 13 ) + def testLegacySearchUserByEmail(self): + user = self.g.legacy_search_user_by_email("vincent@vincent-jacques.net") + self.assertEqual(user.login, "jacquev6") + self.assertEqual(user.followers, 13) - def testGetHooks( self ): + def testGetHooks(self): hooks = self.g.get_hooks() - hook = hooks[ 0 ] - self.assertEqual( hook.name, "activecollab" ) - self.assertEqual( hook.supported_events, [ "push" ] ) - self.assertEqual( hook.events, [ "push" ] ) - self.assertEqual( hook.schema, [ [ "string", "url" ], [ "string", "token" ], [ "string", "project_id" ], [ "string", "milestone_id" ], [ "string", "category_id" ] ] ) + hook = hooks[0] + self.assertEqual(hook.name, "activecollab") + self.assertEqual(hook.supported_events, ["push"]) + self.assertEqual(hook.events, ["push"]) + self.assertEqual(hook.schema, [["string", "url"], ["string", "token"], ["string", "project_id"], ["string", "milestone_id"], ["string", "category_id"]]) diff --git a/github/tests/Hook.py b/github/tests/Hook.py index f3b3c8b3..38e114a2 100644 --- a/github/tests/Hook.py +++ b/github/tests/Hook.py @@ -15,41 +15,42 @@ import Framework import datetime -class Hook( Framework.TestCase ): - def setUp( self ): - Framework.TestCase.setUp( self ) - self.hook = self.g.get_user().get_repo( "PyGithub" ).get_hook( 257993 ) - def testAttributes( self ): - self.assertEqual( self.hook.active, True ) # WTF - self.assertEqual( self.hook.config, { "url": "http://foobar.com" } ) - self.assertEqual( self.hook.created_at, datetime.datetime( 2012, 5, 19, 6, 1, 45 ) ) - self.assertEqual( self.hook.events, [ "push" ] ) - self.assertEqual( self.hook.id, 257993 ) - self.assertEqual( self.hook.last_response.status, "ok" ) - self.assertEqual( self.hook.last_response.message, "OK" ) - self.assertEqual( self.hook.last_response.code, 200 ) - self.assertEqual( self.hook.name, "web" ) - self.assertEqual( self.hook.updated_at, datetime.datetime( 2012, 5, 29, 18, 49, 47 ) ) - self.assertEqual( self.hook.url, "https://api.github.com/repos/jacquev6/PyGithub/hooks/257993" ) +class Hook(Framework.TestCase): + def setUp(self): + Framework.TestCase.setUp(self) + self.hook = self.g.get_user().get_repo("PyGithub").get_hook(257993) - def testEditWithMinimalParameters( self ): - self.hook.edit( "web", { "url": "http://foobar.com/hook" } ) - self.assertEqual( self.hook.config, { "url": "http://foobar.com/hook" } ) - self.assertEqual( self.hook.updated_at, datetime.datetime( 2012, 5, 19, 5, 8, 16 ) ) + def testAttributes(self): + self.assertEqual(self.hook.active, True) # WTF + self.assertEqual(self.hook.config, {"url": "http://foobar.com"}) + self.assertEqual(self.hook.created_at, datetime.datetime(2012, 5, 19, 6, 1, 45)) + self.assertEqual(self.hook.events, ["push"]) + self.assertEqual(self.hook.id, 257993) + self.assertEqual(self.hook.last_response.status, "ok") + self.assertEqual(self.hook.last_response.message, "OK") + self.assertEqual(self.hook.last_response.code, 200) + self.assertEqual(self.hook.name, "web") + self.assertEqual(self.hook.updated_at, datetime.datetime(2012, 5, 29, 18, 49, 47)) + self.assertEqual(self.hook.url, "https://api.github.com/repos/jacquev6/PyGithub/hooks/257993") - def testDelete( self ): + def testEditWithMinimalParameters(self): + self.hook.edit("web", {"url": "http://foobar.com/hook"}) + self.assertEqual(self.hook.config, {"url": "http://foobar.com/hook"}) + self.assertEqual(self.hook.updated_at, datetime.datetime(2012, 5, 19, 5, 8, 16)) + + def testDelete(self): self.hook.delete() - def testTest( self ): - self.hook.test() # This does not update attributes of hook + def testTest(self): + self.hook.test() # This does not update attributes of hook - def testEditWithAllParameters( self ): - self.hook.edit( "web", { "url": "http://foobar.com" }, events = [ "fork", "push" ] ) - self.assertEqual( self.hook.events, [ "fork", "push" ] ) - self.hook.edit( "web", { "url": "http://foobar.com" }, add_events = [ "push" ] ) - self.assertEqual( self.hook.events, [ "fork", "push" ] ) - self.hook.edit( "web", { "url": "http://foobar.com" }, remove_events = [ "fork" ] ) - self.assertEqual( self.hook.events, [ "push" ] ) - self.hook.edit( "web", { "url": "http://foobar.com" }, active = True ) - self.assertEqual( self.hook.active, True ) + def testEditWithAllParameters(self): + self.hook.edit("web", {"url": "http://foobar.com"}, events=["fork", "push"]) + self.assertEqual(self.hook.events, ["fork", "push"]) + self.hook.edit("web", {"url": "http://foobar.com"}, add_events=["push"]) + self.assertEqual(self.hook.events, ["fork", "push"]) + self.hook.edit("web", {"url": "http://foobar.com"}, remove_events=["fork"]) + self.assertEqual(self.hook.events, ["push"]) + self.hook.edit("web", {"url": "http://foobar.com"}, active=True) + self.assertEqual(self.hook.active, True) diff --git a/github/tests/IntegrationTest.py b/github/tests/IntegrationTest.py index 9e5cb5b7..a7ff3600 100755 --- a/github/tests/IntegrationTest.py +++ b/github/tests/IntegrationTest.py @@ -15,6 +15,7 @@ import Framework + from AuthenticatedUser import * from Authentication import * from Authorization import * diff --git a/github/tests/Issue.py b/github/tests/Issue.py index 6ee4871d..95eec520 100644 --- a/github/tests/Issue.py +++ b/github/tests/Issue.py @@ -15,85 +15,86 @@ import Framework import datetime -class Issue( Framework.TestCase ): - def setUp( self ): - Framework.TestCase.setUp( self ) - self.repo = self.g.get_user().get_repo( "PyGithub" ) - self.issue = self.repo.get_issue( 28 ) - def testAttributes( self ): - self.assertEqual( self.issue.assignee.login, "jacquev6" ) - self.assertEqual( self.issue.body, "Body edited by PyGithub" ) - self.assertEqual( self.issue.closed_at, datetime.datetime( 2012, 5, 26, 14, 59, 33 ) ) - self.assertEqual( self.issue.closed_by.login, "jacquev6" ) - self.assertEqual( self.issue.comments, 0 ) - self.assertEqual( self.issue.created_at, datetime.datetime( 2012, 5, 19, 10, 38, 23 ) ) - self.assertEqual( self.issue.html_url, "https://github.com/jacquev6/PyGithub/issues/28" ) - self.assertEqual( self.issue.id, 4653757 ) - self.assertListKeyEqual( self.issue.labels, lambda l: l.name, [ "Bug", "Project management", "Question" ] ) - self.assertEqual( self.issue.milestone.title, "Version 0.4" ) - self.assertEqual( self.issue.number, 28 ) - self.assertEqual( self.issue.pull_request.diff_url, None ) - self.assertEqual( self.issue.pull_request.patch_url, None ) - self.assertEqual( self.issue.pull_request.html_url, None ) - self.assertEqual( self.issue.state, "closed" ) - self.assertEqual( self.issue.title, "Issue created by PyGithub" ) - self.assertEqual( self.issue.updated_at, datetime.datetime( 2012, 5, 26, 14, 59, 33 ) ) - self.assertEqual( self.issue.url, "https://api.github.com/repos/jacquev6/PyGithub/issues/28" ) - self.assertEqual( self.issue.user.login, "jacquev6" ) +class Issue(Framework.TestCase): + def setUp(self): + Framework.TestCase.setUp(self) + self.repo = self.g.get_user().get_repo("PyGithub") + self.issue = self.repo.get_issue(28) - def testEditWithoutParameters( self ): + def testAttributes(self): + self.assertEqual(self.issue.assignee.login, "jacquev6") + self.assertEqual(self.issue.body, "Body edited by PyGithub") + self.assertEqual(self.issue.closed_at, datetime.datetime(2012, 5, 26, 14, 59, 33)) + self.assertEqual(self.issue.closed_by.login, "jacquev6") + self.assertEqual(self.issue.comments, 0) + self.assertEqual(self.issue.created_at, datetime.datetime(2012, 5, 19, 10, 38, 23)) + self.assertEqual(self.issue.html_url, "https://github.com/jacquev6/PyGithub/issues/28") + self.assertEqual(self.issue.id, 4653757) + self.assertListKeyEqual(self.issue.labels, lambda l: l.name, ["Bug", "Project management", "Question"]) + self.assertEqual(self.issue.milestone.title, "Version 0.4") + self.assertEqual(self.issue.number, 28) + self.assertEqual(self.issue.pull_request.diff_url, None) + self.assertEqual(self.issue.pull_request.patch_url, None) + self.assertEqual(self.issue.pull_request.html_url, None) + self.assertEqual(self.issue.state, "closed") + self.assertEqual(self.issue.title, "Issue created by PyGithub") + self.assertEqual(self.issue.updated_at, datetime.datetime(2012, 5, 26, 14, 59, 33)) + self.assertEqual(self.issue.url, "https://api.github.com/repos/jacquev6/PyGithub/issues/28") + self.assertEqual(self.issue.user.login, "jacquev6") + + def testEditWithoutParameters(self): self.issue.edit() - def testEditWithAllParameters( self ): - user = self.g.get_user( "jacquev6" ) - milestone = self.repo.get_milestone( 2 ) - self.issue.edit( "Title edited by PyGithub", "Body edited by PyGithub", user, "open", milestone, [ "Bug" ] ) - self.assertEqual( self.issue.assignee.login, "jacquev6" ) - self.assertEqual( self.issue.body, "Body edited by PyGithub" ) - self.assertEqual( self.issue.state, "open" ) - self.assertEqual( self.issue.title, "Title edited by PyGithub" ) - self.assertListKeyEqual( self.issue.labels, lambda l: l.name, [ "Bug" ] ) + def testEditWithAllParameters(self): + user = self.g.get_user("jacquev6") + milestone = self.repo.get_milestone(2) + self.issue.edit("Title edited by PyGithub", "Body edited by PyGithub", user, "open", milestone, ["Bug"]) + self.assertEqual(self.issue.assignee.login, "jacquev6") + self.assertEqual(self.issue.body, "Body edited by PyGithub") + self.assertEqual(self.issue.state, "open") + self.assertEqual(self.issue.title, "Title edited by PyGithub") + self.assertListKeyEqual(self.issue.labels, lambda l: l.name, ["Bug"]) - def testEditResetMilestone( self ): - self.assertEqual( self.issue.milestone.title, "Version 0.4" ) - self.issue.edit( milestone = None ) - self.assertEqual( self.issue.milestone, None ) + def testEditResetMilestone(self): + self.assertEqual(self.issue.milestone.title, "Version 0.4") + self.issue.edit(milestone=None) + self.assertEqual(self.issue.milestone, None) - def testEditResetAssignee( self ): - self.assertEqual( self.issue.assignee.login, "jacquev6" ) - self.issue.edit( assignee = None ) - self.assertEqual( self.issue.assignee, None ) + def testEditResetAssignee(self): + self.assertEqual(self.issue.assignee.login, "jacquev6") + self.issue.edit(assignee=None) + self.assertEqual(self.issue.assignee, None) - def testCreateComment( self ): - comment = self.issue.create_comment( "Comment created by PyGithub" ) - self.assertEqual( comment.id, 5808311 ) + def testCreateComment(self): + comment = self.issue.create_comment("Comment created by PyGithub") + self.assertEqual(comment.id, 5808311) - def testGetComments( self ): - self.assertListKeyEqual( self.issue.get_comments(), lambda c: c.user.login, [ "jacquev6", "roskakori" ] ) + def testGetComments(self): + self.assertListKeyEqual(self.issue.get_comments(), lambda c: c.user.login, ["jacquev6", "roskakori"]) - def testGetEvents( self ): - self.assertListKeyEqual( self.issue.get_events(), lambda e: e.id, [ 15819975, 15820048 ] ) + def testGetEvents(self): + self.assertListKeyEqual(self.issue.get_events(), lambda e: e.id, [15819975, 15820048]) - def testGetLabels( self ): - self.assertListKeyEqual( self.issue.get_labels(), lambda l: l.name, [ "Bug", "Project management", "Question" ] ) + def testGetLabels(self): + self.assertListKeyEqual(self.issue.get_labels(), lambda l: l.name, ["Bug", "Project management", "Question"]) - def testAddAndRemoveLabels( self ): - bug = self.repo.get_label( "Bug" ) - question = self.repo.get_label( "Question" ) - self.assertListKeyEqual( self.issue.get_labels(), lambda l: l.name, [ "Bug", "Project management", "Question" ] ) - self.issue.remove_from_labels( bug ) - self.assertListKeyEqual( self.issue.get_labels(), lambda l: l.name, [ "Project management", "Question" ] ) - self.issue.remove_from_labels( question ) - self.assertListKeyEqual( self.issue.get_labels(), lambda l: l.name, [ "Project management" ] ) - self.issue.add_to_labels( bug, question ) - self.assertListKeyEqual( self.issue.get_labels(), lambda l: l.name, [ "Bug", "Project management", "Question" ] ) + def testAddAndRemoveLabels(self): + bug = self.repo.get_label("Bug") + question = self.repo.get_label("Question") + self.assertListKeyEqual(self.issue.get_labels(), lambda l: l.name, ["Bug", "Project management", "Question"]) + self.issue.remove_from_labels(bug) + self.assertListKeyEqual(self.issue.get_labels(), lambda l: l.name, ["Project management", "Question"]) + self.issue.remove_from_labels(question) + self.assertListKeyEqual(self.issue.get_labels(), lambda l: l.name, ["Project management"]) + self.issue.add_to_labels(bug, question) + self.assertListKeyEqual(self.issue.get_labels(), lambda l: l.name, ["Bug", "Project management", "Question"]) - def testDeleteAndSetLabels( self ): - bug = self.repo.get_label( "Bug" ) - question = self.repo.get_label( "Question" ) - self.assertListKeyEqual( self.issue.get_labels(), lambda l: l.name, [ "Bug", "Project management", "Question" ] ) + def testDeleteAndSetLabels(self): + bug = self.repo.get_label("Bug") + question = self.repo.get_label("Question") + self.assertListKeyEqual(self.issue.get_labels(), lambda l: l.name, ["Bug", "Project management", "Question"]) self.issue.delete_labels() - self.assertListKeyEqual( self.issue.get_labels(), lambda l: l.name, [] ) - self.issue.set_labels( bug, question ) - self.assertListKeyEqual( self.issue.get_labels(), lambda l: l.name, [ "Bug", "Question" ] ) + self.assertListKeyEqual(self.issue.get_labels(), lambda l: l.name, []) + self.issue.set_labels(bug, question) + self.assertListKeyEqual(self.issue.get_labels(), lambda l: l.name, ["Bug", "Question"]) diff --git a/github/tests/Issue33.py b/github/tests/Issue33.py index c5e9ac0f..2e29d2e1 100644 --- a/github/tests/Issue33.py +++ b/github/tests/Issue33.py @@ -13,13 +13,14 @@ import Framework -class Issue33( Framework.TestCase ): # https://github.com/jacquev6/PyGithub/issues/33 - def setUp( self ): - Framework.TestCase.setUp( self ) - self.repo = self.g.get_user( "openframeworks" ).get_repo( "openFrameworks" ) - def testOpenIssues( self ): - self.assertEqual( len( list( self.repo.get_issues() ) ), 338 ) +class Issue33(Framework.TestCase): # https://github.com/jacquev6/PyGithub/issues/33 + def setUp(self): + Framework.TestCase.setUp(self) + self.repo = self.g.get_user("openframeworks").get_repo("openFrameworks") - def testClosedIssues( self ): - self.assertEqual( len( list( self.repo.get_issues( state = "closed" ) ) ), 950 ) + def testOpenIssues(self): + self.assertEqual(len(list(self.repo.get_issues())), 338) + + def testClosedIssues(self): + self.assertEqual(len(list(self.repo.get_issues(state="closed"))), 950) diff --git a/github/tests/Issue50.py b/github/tests/Issue50.py index e4dbf492..519a2195 100644 --- a/github/tests/Issue50.py +++ b/github/tests/Issue50.py @@ -15,43 +15,44 @@ import github import Framework -class Issue50( Framework.TestCase ): # https://github.com/jacquev6/PyGithub/issues/50 - def setUp( self ): - Framework.TestCase.setUp( self ) - self.repo = self.g.get_user().get_repo( "PyGithub" ) - self.issue = self.repo.get_issue( 50 ) + +class Issue50(Framework.TestCase): # https://github.com/jacquev6/PyGithub/issues/50 + def setUp(self): + Framework.TestCase.setUp(self) + self.repo = self.g.get_user().get_repo("PyGithub") + self.issue = self.repo.get_issue(50) self.labelName = "Label with spaces and strange characters (&*#$)" - def testCreateLabel( self ): - label = self.repo.create_label( self.labelName, "ffff00" ) - self.assertEqual( label.name, self.labelName ) + def testCreateLabel(self): + label = self.repo.create_label(self.labelName, "ffff00") + self.assertEqual(label.name, self.labelName) - def testGetLabel( self ): - label = self.repo.get_label( self.labelName ) - self.assertEqual( label.name, self.labelName ) + def testGetLabel(self): + label = self.repo.get_label(self.labelName) + self.assertEqual(label.name, self.labelName) - def testGetLabels( self ): - self.assertListKeyEqual( self.repo.get_labels(), lambda l: l.name, [ "Refactoring", "Public interface", "Functionalities", "Project management", "Bug", "Question", "RequestedByUser", self.labelName ] ) + def testGetLabels(self): + self.assertListKeyEqual(self.repo.get_labels(), lambda l: l.name, ["Refactoring", "Public interface", "Functionalities", "Project management", "Bug", "Question", "RequestedByUser", self.labelName]) - def testAddLabelToIssue( self ): - self.issue.add_to_labels( self.repo.get_label( self.labelName ) ) + def testAddLabelToIssue(self): + self.issue.add_to_labels(self.repo.get_label(self.labelName)) - def testRemoveLabelFromIssue( self ): - self.issue.remove_from_labels( self.repo.get_label( self.labelName ) ) + def testRemoveLabelFromIssue(self): + self.issue.remove_from_labels(self.repo.get_label(self.labelName)) - def testSetIssueLabels( self ): - self.issue.set_labels( self.repo.get_label( "Bug" ), self.repo.get_label( "RequestedByUser" ), self.repo.get_label( self.labelName ) ) + def testSetIssueLabels(self): + self.issue.set_labels(self.repo.get_label("Bug"), self.repo.get_label("RequestedByUser"), self.repo.get_label(self.labelName)) - def testIssueLabels( self ): - self.assertListKeyEqual( self.issue.labels, lambda l: l.name, [ "Bug", self.labelName, "RequestedByUser" ] ) + def testIssueLabels(self): + self.assertListKeyEqual(self.issue.labels, lambda l: l.name, ["Bug", self.labelName, "RequestedByUser"]) - def testIssueGetLabels( self ): - self.assertListKeyEqual( self.issue.get_labels(), lambda l: l.name, [ "Bug", self.labelName, "RequestedByUser" ] ) + def testIssueGetLabels(self): + self.assertListKeyEqual(self.issue.get_labels(), lambda l: l.name, ["Bug", self.labelName, "RequestedByUser"]) - def testGetIssuesWithLabel( self ): - self.assertListKeyEqual( self.repo.get_issues( labels = [ self.repo.get_label( self.labelName ) ] ), lambda i: i.number, [ 52, 50 ] ) + def testGetIssuesWithLabel(self): + self.assertListKeyEqual(self.repo.get_issues(labels=[self.repo.get_label(self.labelName)]), lambda i: i.number, [52, 50]) - def testCreateIssueWithLabel( self ): - issue = self.repo.create_issue( "Issue created by PyGithub to test issue #50", labels = [ self.repo.get_label( self.labelName ) ] ) - self.assertListKeyEqual( issue.labels, lambda l: l.name, [ self.labelName ] ) - self.assertEqual( issue.number, 52 ) + def testCreateIssueWithLabel(self): + issue = self.repo.create_issue("Issue created by PyGithub to test issue #50", labels=[self.repo.get_label(self.labelName)]) + self.assertListKeyEqual(issue.labels, lambda l: l.name, [self.labelName]) + self.assertEqual(issue.number, 52) diff --git a/github/tests/Issue54.py b/github/tests/Issue54.py index c759831d..a8d0888a 100644 --- a/github/tests/Issue54.py +++ b/github/tests/Issue54.py @@ -15,12 +15,13 @@ import datetime import Framework -class Issue54( Framework.TestCase ): - def setUp( self ): - Framework.TestCase.setUp( self ) - self.repo = self.g.get_user().get_repo( "TestRepo" ) - def testConversion( self ): - commit = self.repo.get_git_commit( "73f320ae06cd565cf38faca34b6a482addfc721b" ) - self.assertEqual( commit.message, "Test commit created around Fri, 13 Jul 2012 18:43:21 GMT, that is vendredi 13 juillet 2012 20:43:21 GMT+2\n" ) - self.assertEqual( commit.author.date, datetime.datetime( 2012, 7, 13, 18, 47, 10 ) ) +class Issue54(Framework.TestCase): + def setUp(self): + Framework.TestCase.setUp(self) + self.repo = self.g.get_user().get_repo("TestRepo") + + def testConversion(self): + commit = self.repo.get_git_commit("73f320ae06cd565cf38faca34b6a482addfc721b") + self.assertEqual(commit.message, "Test commit created around Fri, 13 Jul 2012 18:43:21 GMT, that is vendredi 13 juillet 2012 20:43:21 GMT+2\n") + self.assertEqual(commit.author.date, datetime.datetime(2012, 7, 13, 18, 47, 10)) diff --git a/github/tests/Issue80.py b/github/tests/Issue80.py index b51841bf..d5a63322 100644 --- a/github/tests/Issue80.py +++ b/github/tests/Issue80.py @@ -15,15 +15,16 @@ import github import Framework -class Issue80( Framework.BasicTestCase ): # https://github.com/jacquev6/PyGithub/issues/80 - def testIgnoreHttpsFromGithubEnterprise( self ): - g = github.Github( self.login, self.password, base_url = "http://my.enterprise.com/some/prefix" ) # http here - org = g.get_organization( "BeaverSoftware" ) - self.assertEqual( org.url, "https://my.enterprise.com/some/prefix/orgs/BeaverSoftware" ) # https returned - self.assertListKeyEqual( org.get_repos(), lambda r: r.name, [ "FatherBeaver", "TestPyGithub" ] ) # But still http in second request based on org.url - def testIgnoreHttpsFromGithubEnterpriseWithPort( self ): - g = github.Github( self.login, self.password, base_url = "http://my.enterprise.com:1234/some/prefix" ) # http here - org = g.get_organization( "BeaverSoftware" ) - self.assertEqual( org.url, "https://my.enterprise.com:1234/some/prefix/orgs/BeaverSoftware" ) # https returned - self.assertListKeyEqual( org.get_repos(), lambda r: r.name, [ "FatherBeaver", "TestPyGithub" ] ) # But still http in second request based on org.url +class Issue80(Framework.BasicTestCase): # https://github.com/jacquev6/PyGithub/issues/80 + def testIgnoreHttpsFromGithubEnterprise(self): + g = github.Github(self.login, self.password, base_url="http://my.enterprise.com/some/prefix") # http here + org = g.get_organization("BeaverSoftware") + self.assertEqual(org.url, "https://my.enterprise.com/some/prefix/orgs/BeaverSoftware") # https returned + self.assertListKeyEqual(org.get_repos(), lambda r: r.name, ["FatherBeaver", "TestPyGithub"]) # But still http in second request based on org.url + + def testIgnoreHttpsFromGithubEnterpriseWithPort(self): + g = github.Github(self.login, self.password, base_url="http://my.enterprise.com:1234/some/prefix") # http here + org = g.get_organization("BeaverSoftware") + self.assertEqual(org.url, "https://my.enterprise.com:1234/some/prefix/orgs/BeaverSoftware") # https returned + self.assertListKeyEqual(org.get_repos(), lambda r: r.name, ["FatherBeaver", "TestPyGithub"]) # But still http in second request based on org.url diff --git a/github/tests/IssueComment.py b/github/tests/IssueComment.py index c919928c..6090b4d0 100644 --- a/github/tests/IssueComment.py +++ b/github/tests/IssueComment.py @@ -15,23 +15,24 @@ import Framework import datetime -class IssueComment( Framework.TestCase ): - def setUp( self ): - Framework.TestCase.setUp( self ) - self.comment = self.g.get_user().get_repo( "PyGithub" ).get_issue( 28 ).get_comment( 5808311 ) - def testAttributes( self ): - self.assertEqual( self.comment.body, "Comment created by PyGithub" ) - self.assertEqual( self.comment.created_at, datetime.datetime( 2012, 5, 20, 11, 46, 42 ) ) - self.assertEqual( self.comment.id, 5808311 ) - self.assertEqual( self.comment.updated_at, datetime.datetime( 2012, 5, 20, 11, 46, 42 ) ) - self.assertEqual( self.comment.url, "https://api.github.com/repos/jacquev6/PyGithub/issues/comments/5808311" ) - self.assertEqual( self.comment.user.login, "jacquev6" ) +class IssueComment(Framework.TestCase): + def setUp(self): + Framework.TestCase.setUp(self) + self.comment = self.g.get_user().get_repo("PyGithub").get_issue(28).get_comment(5808311) - def testEdit( self ): - self.comment.edit( "Comment edited by PyGithub" ) - self.assertEqual( self.comment.body, "Comment edited by PyGithub" ) - self.assertEqual( self.comment.updated_at, datetime.datetime( 2012, 5, 20, 11, 53, 59 ) ) + def testAttributes(self): + self.assertEqual(self.comment.body, "Comment created by PyGithub") + self.assertEqual(self.comment.created_at, datetime.datetime(2012, 5, 20, 11, 46, 42)) + self.assertEqual(self.comment.id, 5808311) + self.assertEqual(self.comment.updated_at, datetime.datetime(2012, 5, 20, 11, 46, 42)) + self.assertEqual(self.comment.url, "https://api.github.com/repos/jacquev6/PyGithub/issues/comments/5808311") + self.assertEqual(self.comment.user.login, "jacquev6") - def testDelete( self ): + def testEdit(self): + self.comment.edit("Comment edited by PyGithub") + self.assertEqual(self.comment.body, "Comment edited by PyGithub") + self.assertEqual(self.comment.updated_at, datetime.datetime(2012, 5, 20, 11, 53, 59)) + + def testDelete(self): self.comment.delete() diff --git a/github/tests/IssueEvent.py b/github/tests/IssueEvent.py index 200795f6..688508b8 100644 --- a/github/tests/IssueEvent.py +++ b/github/tests/IssueEvent.py @@ -15,16 +15,17 @@ import Framework import datetime -class IssueEvent( Framework.TestCase ): - def setUp( self ): - Framework.TestCase.setUp( self ) - self.event = self.g.get_user().get_repo( "PyGithub" ).get_issues_event( 16348656 ) - def testAttributes( self ): - self.assertEqual( self.event.actor.login, "jacquev6" ) - self.assertEqual( self.event.commit_id, "ed866fc43833802ab553e5ff8581c81bb00dd433" ) - self.assertEqual( self.event.created_at, datetime.datetime( 2012, 5, 27, 7, 29, 25 ) ) - self.assertEqual( self.event.event, "referenced" ) - self.assertEqual( self.event.id, 16348656 ) - self.assertEqual( self.event.issue.number, 30 ) - self.assertEqual( self.event.url, "https://api.github.com/repos/jacquev6/PyGithub/issues/events/16348656" ) +class IssueEvent(Framework.TestCase): + def setUp(self): + Framework.TestCase.setUp(self) + self.event = self.g.get_user().get_repo("PyGithub").get_issues_event(16348656) + + def testAttributes(self): + self.assertEqual(self.event.actor.login, "jacquev6") + self.assertEqual(self.event.commit_id, "ed866fc43833802ab553e5ff8581c81bb00dd433") + self.assertEqual(self.event.created_at, datetime.datetime(2012, 5, 27, 7, 29, 25)) + self.assertEqual(self.event.event, "referenced") + self.assertEqual(self.event.id, 16348656) + self.assertEqual(self.event.issue.number, 30) + self.assertEqual(self.event.url, "https://api.github.com/repos/jacquev6/PyGithub/issues/events/16348656") diff --git a/github/tests/Label.py b/github/tests/Label.py index 0e1c1ee4..4be91a16 100644 --- a/github/tests/Label.py +++ b/github/tests/Label.py @@ -13,21 +13,22 @@ import Framework -class Label( Framework.TestCase ): - def setUp( self ): - Framework.TestCase.setUp( self ) - self.label = self.g.get_user().get_repo( "PyGithub" ).get_label( "Bug" ) - def testAttributes( self ): - self.assertEqual( self.label.color, "e10c02" ) - self.assertEqual( self.label.name, "Bug" ) - self.assertEqual( self.label.url, "https://api.github.com/repos/jacquev6/PyGithub/labels/Bug" ) +class Label(Framework.TestCase): + def setUp(self): + Framework.TestCase.setUp(self) + self.label = self.g.get_user().get_repo("PyGithub").get_label("Bug") - def testEdit( self ): - self.label.edit( "LabelEditedByPyGithub", "0000ff" ) - self.assertEqual( self.label.color, "0000ff" ) - self.assertEqual( self.label.name, "LabelEditedByPyGithub" ) - self.assertEqual( self.label.url, "https://api.github.com/repos/jacquev6/PyGithub/labels/LabelEditedByPyGithub" ) + def testAttributes(self): + self.assertEqual(self.label.color, "e10c02") + self.assertEqual(self.label.name, "Bug") + self.assertEqual(self.label.url, "https://api.github.com/repos/jacquev6/PyGithub/labels/Bug") - def testDelete( self ): + def testEdit(self): + self.label.edit("LabelEditedByPyGithub", "0000ff") + self.assertEqual(self.label.color, "0000ff") + self.assertEqual(self.label.name, "LabelEditedByPyGithub") + self.assertEqual(self.label.url, "https://api.github.com/repos/jacquev6/PyGithub/labels/LabelEditedByPyGithub") + + def testDelete(self): self.label.delete() diff --git a/github/tests/Logging.py b/github/tests/Logging.py index 8f1b1ee3..f5ae745a 100644 --- a/github/tests/Logging.py +++ b/github/tests/Logging.py @@ -17,21 +17,22 @@ import github import Framework -class Logging( Framework.TestCase ): + +class Logging(Framework.TestCase): class MockHandler: - def __init__( self ): + def __init__(self): self.level = logging.DEBUG self.handled = None - def handle( self, record ): + def handle(self, record): self.handled = record.getMessage() - def testLogging( self ): + def testLogging(self): self.maxDiff = None logger = github.get_logger() - logger.setLevel( logging.DEBUG ) + logger.setLevel(logging.DEBUG) handler = self.MockHandler() - logger.addHandler( handler ) - - self.assertEqual( self.g.get_user().name, "Vincent Jacques" ) - self.assertEqual( handler.handled, u'GET https://api.github.com/user None None ==> 200 {\'status\': \'200 OK\', \'content-length\': \'806\', \'x-github-media-type\': \'github.beta; format=json\', \'x-content-type-options\': \'nosniff\', \'vary\': \'Accept, Authorization, Cookie\', \'x-ratelimit-remaining\': \'4993\', \'server\': \'nginx\', \'last-modified\': \'Fri, 14 Sep 2012 18:47:46 GMT\', \'connection\': \'keep-alive\', \'x-ratelimit-limit\': \'5000\', \'etag\': \'"434dfe5d3f50558fe3cea087cb95c401"\', \'cache-control\': \'private, s-maxage=60, max-age=60\', \'date\': \'Mon, 17 Sep 2012 17:12:32 GMT\', \'content-type\': \'application/json; charset=utf-8\'} {"owned_private_repos":3,"disk_usage":18612,"following":28,"type":"User","public_repos":13,"location":"Paris, France","company":"Criteo","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png","plan":{"space":614400,"private_repos":5,"name":"micro","collaborators":1},"blog":"http://vincent-jacques.net","login":"jacquev6","public_gists":3,"html_url":"https://github.com/jacquev6","hireable":false,"created_at":"2010-07-09T06:10:06Z","private_gists":5,"followers":13,"name":"Vincent Jacques","email":"vincent@vincent-jacques.net","bio":"","total_private_repos":3,"collaborators":0,"gravatar_id":"b68de5ae38616c296fa345d2b9df2225","id":327146,"url":"https://api.github.com/users/jacquev6"}' ) + logger.addHandler(handler) + + self.assertEqual(self.g.get_user().name, "Vincent Jacques") + self.assertEqual(handler.handled, u'GET https://api.github.com/user None None ==> 200 {\'status\': \'200 OK\', \'content-length\': \'806\', \'x-github-media-type\': \'github.beta; format=json\', \'x-content-type-options\': \'nosniff\', \'vary\': \'Accept, Authorization, Cookie\', \'x-ratelimit-remaining\': \'4993\', \'server\': \'nginx\', \'last-modified\': \'Fri, 14 Sep 2012 18:47:46 GMT\', \'connection\': \'keep-alive\', \'x-ratelimit-limit\': \'5000\', \'etag\': \'"434dfe5d3f50558fe3cea087cb95c401"\', \'cache-control\': \'private, s-maxage=60, max-age=60\', \'date\': \'Mon, 17 Sep 2012 17:12:32 GMT\', \'content-type\': \'application/json; charset=utf-8\'} {"owned_private_repos":3,"disk_usage":18612,"following":28,"type":"User","public_repos":13,"location":"Paris, France","company":"Criteo","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png","plan":{"space":614400,"private_repos":5,"name":"micro","collaborators":1},"blog":"http://vincent-jacques.net","login":"jacquev6","public_gists":3,"html_url":"https://github.com/jacquev6","hireable":false,"created_at":"2010-07-09T06:10:06Z","private_gists":5,"followers":13,"name":"Vincent Jacques","email":"vincent@vincent-jacques.net","bio":"","total_private_repos":3,"collaborators":0,"gravatar_id":"b68de5ae38616c296fa345d2b9df2225","id":327146,"url":"https://api.github.com/users/jacquev6"}') diff --git a/github/tests/Markdown.py b/github/tests/Markdown.py index bab5ff01..a9bc2dd8 100644 --- a/github/tests/Markdown.py +++ b/github/tests/Markdown.py @@ -13,14 +13,15 @@ import Framework -class Markdown( Framework.TestCase ): - def setUp( self ): - Framework.TestCase.setUp( self ) + +class Markdown(Framework.TestCase): + def setUp(self): + Framework.TestCase.setUp(self) self.text = "MyTitle\n=======\n\nIssue #1" - self.repo = self.g.get_user().get_repo( "PyGithub" ) + self.repo = self.g.get_user().get_repo("PyGithub") - def testRenderMarkdown( self ): - self.assertEqual( self.g.render_markdown( self.text ), '

MyTitle

Issue #1

' ) + def testRenderMarkdown(self): + self.assertEqual(self.g.render_markdown(self.text), '

MyTitle

Issue #1

') - def testRenderGithubFlavoredMarkdown( self ): - self.assertEqual( self.g.render_markdown( self.text, self.repo ), '

MyTitle

Issue #1

' ) + def testRenderGithubFlavoredMarkdown(self): + self.assertEqual(self.g.render_markdown(self.text, self.repo), '

MyTitle

Issue #1

') diff --git a/github/tests/Milestone.py b/github/tests/Milestone.py index 9433e2b5..55446d9b 100644 --- a/github/tests/Milestone.py +++ b/github/tests/Milestone.py @@ -15,37 +15,38 @@ import Framework import datetime -class Milestone( Framework.TestCase ): - def setUp( self ): - Framework.TestCase.setUp( self ) - self.milestone = self.g.get_user().get_repo( "PyGithub" ).get_milestone( 1 ) - def testAttributes( self ): - self.assertEqual( self.milestone.closed_issues, 2 ) - self.assertEqual( self.milestone.created_at, datetime.datetime( 2012, 3, 8, 12, 22, 10 ) ) - self.assertEqual( self.milestone.description, "" ) - self.assertEqual( self.milestone.due_on, datetime.datetime( 2012, 3, 13, 7, 0, 0 ) ) - self.assertEqual( self.milestone.id, 93546 ) - self.assertEqual( self.milestone.number, 1 ) - self.assertEqual( self.milestone.open_issues, 0 ) - self.assertEqual( self.milestone.state, "closed" ) - self.assertEqual( self.milestone.title, "Version 0.4" ) - self.assertEqual( self.milestone.url, "https://api.github.com/repos/jacquev6/PyGithub/milestones/1" ) - self.assertEqual( self.milestone.creator.login, "jacquev6" ) +class Milestone(Framework.TestCase): + def setUp(self): + Framework.TestCase.setUp(self) + self.milestone = self.g.get_user().get_repo("PyGithub").get_milestone(1) - def testEditWithMinimalParameters( self ): - self.milestone.edit( "Title edited by PyGithub" ) - self.assertEqual( self.milestone.title, "Title edited by PyGithub" ) + def testAttributes(self): + self.assertEqual(self.milestone.closed_issues, 2) + self.assertEqual(self.milestone.created_at, datetime.datetime(2012, 3, 8, 12, 22, 10)) + self.assertEqual(self.milestone.description, "") + self.assertEqual(self.milestone.due_on, datetime.datetime(2012, 3, 13, 7, 0, 0)) + self.assertEqual(self.milestone.id, 93546) + self.assertEqual(self.milestone.number, 1) + self.assertEqual(self.milestone.open_issues, 0) + self.assertEqual(self.milestone.state, "closed") + self.assertEqual(self.milestone.title, "Version 0.4") + self.assertEqual(self.milestone.url, "https://api.github.com/repos/jacquev6/PyGithub/milestones/1") + self.assertEqual(self.milestone.creator.login, "jacquev6") - def testEditWithAllParameters( self ): - self.milestone.edit( "Title edited twice by PyGithub", "closed", "Description edited by PyGithub", due_on = datetime.date( 2012, 6, 16 ) ) - self.assertEqual( self.milestone.title, "Title edited twice by PyGithub" ) - self.assertEqual( self.milestone.state, "closed" ) - self.assertEqual( self.milestone.description, "Description edited by PyGithub" ) - self.assertEqual( self.milestone.due_on, datetime.datetime( 2012, 6, 16, 7, 0, 0 ) ) + def testEditWithMinimalParameters(self): + self.milestone.edit("Title edited by PyGithub") + self.assertEqual(self.milestone.title, "Title edited by PyGithub") - def testGetLabels( self ): - self.assertListKeyEqual( self.milestone.get_labels(), lambda l: l.name, [ "Public interface", "Project management" ] ) + def testEditWithAllParameters(self): + self.milestone.edit("Title edited twice by PyGithub", "closed", "Description edited by PyGithub", due_on=datetime.date(2012, 6, 16)) + self.assertEqual(self.milestone.title, "Title edited twice by PyGithub") + self.assertEqual(self.milestone.state, "closed") + self.assertEqual(self.milestone.description, "Description edited by PyGithub") + self.assertEqual(self.milestone.due_on, datetime.datetime(2012, 6, 16, 7, 0, 0)) - def testDelete( self ): + def testGetLabels(self): + self.assertListKeyEqual(self.milestone.get_labels(), lambda l: l.name, ["Public interface", "Project management"]) + + def testDelete(self): self.milestone.delete() diff --git a/github/tests/NamedUser.py b/github/tests/NamedUser.py index 8f76a6e6..90768009 100644 --- a/github/tests/NamedUser.py +++ b/github/tests/NamedUser.py @@ -16,115 +16,116 @@ import Framework import github import datetime -class NamedUser( Framework.TestCase ): - def setUp( self ): - Framework.TestCase.setUp( self ) - self.user = self.g.get_user( "jacquev6" ) - def testAttributesOfOtherUser( self ): - self.user = self.g.get_user( "nvie" ) - self.assertEqual( self.user.avatar_url, "https://secure.gravatar.com/avatar/c5a7f21b46df698f3db31c37ed0cf55a?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png" ) - self.assertEqual( self.user.bio, None ) - self.assertEqual( self.user.blog, "http://nvie.com" ) - self.assertEqual( self.user.collaborators, None ) - self.assertEqual( self.user.company, "3rd Cloud" ) - self.assertEqual( self.user.created_at, datetime.datetime( 2009, 5, 12, 21, 19, 38 ) ) - self.assertEqual( self.user.disk_usage, None ) - self.assertEqual( self.user.email, "vincent@3rdcloud.com" ) - self.assertEqual( self.user.followers, 296 ) - self.assertEqual( self.user.following, 41 ) - self.assertEqual( self.user.gravatar_id, "c5a7f21b46df698f3db31c37ed0cf55a" ) - self.assertEqual( self.user.hireable, False ) - self.assertEqual( self.user.html_url, "https://github.com/nvie" ) - self.assertEqual( self.user.id, 83844 ) - self.assertEqual( self.user.location, "Netherlands" ) - self.assertEqual( self.user.login, "nvie" ) - self.assertEqual( self.user.name, "Vincent Driessen" ) - self.assertEqual( self.user.owned_private_repos, None ) - self.assertEqual( self.user.plan, None ) - self.assertEqual( self.user.private_gists, None ) - self.assertEqual( self.user.public_gists, 16 ) - self.assertEqual( self.user.public_repos, 61 ) - self.assertEqual( self.user.total_private_repos, None ) - self.assertEqual( self.user.type, "User" ) - self.assertEqual( self.user.url, "https://api.github.com/users/nvie" ) +class NamedUser(Framework.TestCase): + def setUp(self): + Framework.TestCase.setUp(self) + self.user = self.g.get_user("jacquev6") - def testAttributesOfSelf( self ): - self.assertEqual( self.user.avatar_url, "https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png" ) - self.assertEqual( self.user.bio, "" ) - self.assertEqual( self.user.blog, "http://vincent-jacques.net" ) - self.assertEqual( self.user.collaborators, 0 ) - self.assertEqual( self.user.company, "Criteo" ) - self.assertEqual( self.user.created_at, datetime.datetime( 2010, 7, 9, 6, 10, 6 ) ) - self.assertEqual( self.user.disk_usage, 17080 ) - self.assertEqual( self.user.email, "vincent@vincent-jacques.net" ) - self.assertEqual( self.user.followers, 13 ) - self.assertEqual( self.user.following, 24 ) - self.assertEqual( self.user.gravatar_id, "b68de5ae38616c296fa345d2b9df2225" ) - self.assertEqual( self.user.hireable, False ) - self.assertEqual( self.user.html_url, "https://github.com/jacquev6" ) - self.assertEqual( self.user.id, 327146 ) - self.assertEqual( self.user.location, "Paris, France" ) - self.assertEqual( self.user.login, "jacquev6" ) - self.assertEqual( self.user.name, "Vincent Jacques" ) - self.assertEqual( self.user.owned_private_repos, 5 ) - self.assertEqual( self.user.plan.name, "micro" ) - self.assertEqual( self.user.plan.collaborators, 1 ) - self.assertEqual( self.user.plan.space, 614400 ) - self.assertEqual( self.user.plan.private_repos, 5 ) - self.assertEqual( self.user.private_gists, 5 ) - self.assertEqual( self.user.public_gists, 2 ) - self.assertEqual( self.user.public_repos, 11 ) - self.assertEqual( self.user.total_private_repos, 5 ) - self.assertEqual( self.user.type, "User" ) - self.assertEqual( self.user.url, "https://api.github.com/users/jacquev6" ) + def testAttributesOfOtherUser(self): + self.user = self.g.get_user("nvie") + self.assertEqual(self.user.avatar_url, "https://secure.gravatar.com/avatar/c5a7f21b46df698f3db31c37ed0cf55a?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png") + self.assertEqual(self.user.bio, None) + self.assertEqual(self.user.blog, "http://nvie.com") + self.assertEqual(self.user.collaborators, None) + self.assertEqual(self.user.company, "3rd Cloud") + self.assertEqual(self.user.created_at, datetime.datetime(2009, 5, 12, 21, 19, 38)) + self.assertEqual(self.user.disk_usage, None) + self.assertEqual(self.user.email, "vincent@3rdcloud.com") + self.assertEqual(self.user.followers, 296) + self.assertEqual(self.user.following, 41) + self.assertEqual(self.user.gravatar_id, "c5a7f21b46df698f3db31c37ed0cf55a") + self.assertEqual(self.user.hireable, False) + self.assertEqual(self.user.html_url, "https://github.com/nvie") + self.assertEqual(self.user.id, 83844) + self.assertEqual(self.user.location, "Netherlands") + self.assertEqual(self.user.login, "nvie") + self.assertEqual(self.user.name, "Vincent Driessen") + self.assertEqual(self.user.owned_private_repos, None) + self.assertEqual(self.user.plan, None) + self.assertEqual(self.user.private_gists, None) + self.assertEqual(self.user.public_gists, 16) + self.assertEqual(self.user.public_repos, 61) + self.assertEqual(self.user.total_private_repos, None) + self.assertEqual(self.user.type, "User") + self.assertEqual(self.user.url, "https://api.github.com/users/nvie") - def testCreateGist( self ): - gist = self.user.create_gist( True, { "foobar.txt": github.InputFileContent( "File created by PyGithub" ) }, "Gist created by PyGithub on a NamedUser" ) - self.assertEqual( gist.description, "Gist created by PyGithub on a NamedUser" ) + def testAttributesOfSelf(self): + self.assertEqual(self.user.avatar_url, "https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png") + self.assertEqual(self.user.bio, "") + self.assertEqual(self.user.blog, "http://vincent-jacques.net") + self.assertEqual(self.user.collaborators, 0) + self.assertEqual(self.user.company, "Criteo") + self.assertEqual(self.user.created_at, datetime.datetime(2010, 7, 9, 6, 10, 6)) + self.assertEqual(self.user.disk_usage, 17080) + self.assertEqual(self.user.email, "vincent@vincent-jacques.net") + self.assertEqual(self.user.followers, 13) + self.assertEqual(self.user.following, 24) + self.assertEqual(self.user.gravatar_id, "b68de5ae38616c296fa345d2b9df2225") + self.assertEqual(self.user.hireable, False) + self.assertEqual(self.user.html_url, "https://github.com/jacquev6") + self.assertEqual(self.user.id, 327146) + self.assertEqual(self.user.location, "Paris, France") + self.assertEqual(self.user.login, "jacquev6") + self.assertEqual(self.user.name, "Vincent Jacques") + self.assertEqual(self.user.owned_private_repos, 5) + self.assertEqual(self.user.plan.name, "micro") + self.assertEqual(self.user.plan.collaborators, 1) + self.assertEqual(self.user.plan.space, 614400) + self.assertEqual(self.user.plan.private_repos, 5) + self.assertEqual(self.user.private_gists, 5) + self.assertEqual(self.user.public_gists, 2) + self.assertEqual(self.user.public_repos, 11) + self.assertEqual(self.user.total_private_repos, 5) + self.assertEqual(self.user.type, "User") + self.assertEqual(self.user.url, "https://api.github.com/users/jacquev6") - def testCreateGistWithoutDescription( self ): - gist = self.user.create_gist( True, { "foobar.txt": github.InputFileContent( "File created by PyGithub" ) } ) - self.assertEqual( gist.description, None ) + def testCreateGist(self): + gist = self.user.create_gist(True, {"foobar.txt": github.InputFileContent("File created by PyGithub")}, "Gist created by PyGithub on a NamedUser") + self.assertEqual(gist.description, "Gist created by PyGithub on a NamedUser") - def testGetGists( self ): - self.assertListKeyEqual( self.user.get_gists(), lambda g: g.description, [ "Gist created by PyGithub", "FairThreadPoolPool.cpp", "How to error 500 Github API v3, as requested by Rick (GitHub Staff)", "Cadfael: order of episodes in French DVD edition" ] ) + def testCreateGistWithoutDescription(self): + gist = self.user.create_gist(True, {"foobar.txt": github.InputFileContent("File created by PyGithub")}) + self.assertEqual(gist.description, None) - def testGetFollowers( self ): - self.assertListKeyEqual( self.user.get_followers(), lambda f: f.login, [ "jnorthrup", "brugidou", "regisb", "walidk", "afzalkhan", "sdanzan", "vineus", "gturri", "fjardon", "cjuniet", "jardon-u", "kamaradclimber", "L42y" ] ) + def testGetGists(self): + self.assertListKeyEqual(self.user.get_gists(), lambda g: g.description, ["Gist created by PyGithub", "FairThreadPoolPool.cpp", "How to error 500 Github API v3, as requested by Rick (GitHub Staff)", "Cadfael: order of episodes in French DVD edition"]) - def testGetFollowing( self ): - self.assertListKeyEqual( self.user.get_following(), lambda f: f.login, [ "nvie", "schacon", "jamis", "chad", "unclebob", "dabrahams", "jnorthrup", "brugidou", "regisb", "walidk", "tanzilli", "fjardon", "r3c", "sdanzan", "vineus", "cjuniet", "gturri", "ant9000", "asquini", "claudyus", "jardon-u", "s-bernard", "kamaradclimber", "Lyloa" ] ) + def testGetFollowers(self): + self.assertListKeyEqual(self.user.get_followers(), lambda f: f.login, ["jnorthrup", "brugidou", "regisb", "walidk", "afzalkhan", "sdanzan", "vineus", "gturri", "fjardon", "cjuniet", "jardon-u", "kamaradclimber", "L42y"]) - def testGetOrgs( self ): - self.assertListKeyEqual( self.user.get_orgs(), lambda o: o.login, [ "BeaverSoftware" ] ) + def testGetFollowing(self): + self.assertListKeyEqual(self.user.get_following(), lambda f: f.login, ["nvie", "schacon", "jamis", "chad", "unclebob", "dabrahams", "jnorthrup", "brugidou", "regisb", "walidk", "tanzilli", "fjardon", "r3c", "sdanzan", "vineus", "cjuniet", "gturri", "ant9000", "asquini", "claudyus", "jardon-u", "s-bernard", "kamaradclimber", "Lyloa"]) - def testGetRepo( self ): - self.assertEqual( self.user.get_repo( "PyGithub" ).description, "Python library implementing the full Github API v3" ) + def testGetOrgs(self): + self.assertListKeyEqual(self.user.get_orgs(), lambda o: o.login, ["BeaverSoftware"]) - def testGetRepos( self ): - self.assertListKeyEqual( self.user.get_repos(), lambda r: r.name, [ "TestPyGithub", "django", "PyGithub", "developer.github.com", "acme-public-website", "C4Planner", "DrawTurksHead", "DrawSyntax", "QuadProgMm", "Boost.HierarchicalEnum", "ViDE" ] ) + def testGetRepo(self): + self.assertEqual(self.user.get_repo("PyGithub").description, "Python library implementing the full Github API v3") - def testGetReposWithType( self ): - self.assertListKeyEqual( self.user.get_repos( "owner" ), lambda r: r.name, [ "django", "PyGithub", "developer.github.com", "acme-public-website", "C4Planner", "DrawTurksHead", "DrawSyntax", "QuadProgMm", "Boost.HierarchicalEnum", "ViDE" ] ) + def testGetRepos(self): + self.assertListKeyEqual(self.user.get_repos(), lambda r: r.name, ["TestPyGithub", "django", "PyGithub", "developer.github.com", "acme-public-website", "C4Planner", "DrawTurksHead", "DrawSyntax", "QuadProgMm", "Boost.HierarchicalEnum", "ViDE"]) - def testGetWatched( self ): - self.assertListKeyEqual( self.user.get_watched(), lambda r: r.name, [ "git", "boost.php", "capistrano", "boost.perl", "git-subtree", "git-hg", "homebrew", "celtic_knot", "twisted-intro", "markup", "hub", "gitflow", "murder", "boto", "agit", "d3", "pygit2", "git-pulls", "django_mathlatex", "scrumblr", "developer.github.com", "python-github3", "PlantUML", "bootstrap", "drawnby", "django-socketio", "django-realtime", "playground", "BozoCrack", "FatherBeaver", "PyGithub", "django", "django", "TestPyGithub" ] ) + def testGetReposWithType(self): + self.assertListKeyEqual(self.user.get_repos("owner"), lambda r: r.name, ["django", "PyGithub", "developer.github.com", "acme-public-website", "C4Planner", "DrawTurksHead", "DrawSyntax", "QuadProgMm", "Boost.HierarchicalEnum", "ViDE"]) - def testGetStarred( self ): - self.assertListKeyEqual( self.user.get_starred(), lambda r: r.name, [ "git", "boost.php", "capistrano", "boost.perl", "git-subtree", "git-hg", "homebrew", "celtic_knot", "twisted-intro", "markup", "hub", "gitflow", "murder", "boto", "agit", "d3", "pygit2", "git-pulls", "django_mathlatex", "scrumblr", "developer.github.com", "python-github3", "PlantUML", "bootstrap", "drawnby", "django-socketio", "django-realtime", "playground", "BozoCrack", "FatherBeaver", "amaunet", "django", "django", "moviePlanning", "folly" ] ) + def testGetWatched(self): + self.assertListKeyEqual(self.user.get_watched(), lambda r: r.name, ["git", "boost.php", "capistrano", "boost.perl", "git-subtree", "git-hg", "homebrew", "celtic_knot", "twisted-intro", "markup", "hub", "gitflow", "murder", "boto", "agit", "d3", "pygit2", "git-pulls", "django_mathlatex", "scrumblr", "developer.github.com", "python-github3", "PlantUML", "bootstrap", "drawnby", "django-socketio", "django-realtime", "playground", "BozoCrack", "FatherBeaver", "PyGithub", "django", "django", "TestPyGithub"]) - def testGetSubscriptions( self ): - self.assertListKeyEqual( self.user.get_subscriptions(), lambda r: r.name, [ "ViDE", "Boost.HierarchicalEnum", "QuadProgMm", "DrawSyntax", "DrawTurksHead", "PrivateStuff", "vincent-jacques.net", "Hacking", "C4Planner", "developer.github.com", "PyGithub", "PyGithub", "django", "CinePlanning", "PyGithub", "PyGithub", "PyGithub", "IpMap", "PyGithub", "PyGithub", "PyGithub", "PyGithub", "PyGithub", "PyGithub", "PyGithub", "PyGithub", "PyGithub", "PyGithub", "PyGithub", "PyGithub" ] ) + def testGetStarred(self): + self.assertListKeyEqual(self.user.get_starred(), lambda r: r.name, ["git", "boost.php", "capistrano", "boost.perl", "git-subtree", "git-hg", "homebrew", "celtic_knot", "twisted-intro", "markup", "hub", "gitflow", "murder", "boto", "agit", "d3", "pygit2", "git-pulls", "django_mathlatex", "scrumblr", "developer.github.com", "python-github3", "PlantUML", "bootstrap", "drawnby", "django-socketio", "django-realtime", "playground", "BozoCrack", "FatherBeaver", "amaunet", "django", "django", "moviePlanning", "folly"]) - def testGetEvents( self ): - self.assertListKeyBegin( self.user.get_events(), lambda e: e.type, [ "GistEvent", "IssueCommentEvent", "PushEvent", "IssuesEvent" ] ) + def testGetSubscriptions(self): + self.assertListKeyEqual(self.user.get_subscriptions(), lambda r: r.name, ["ViDE", "Boost.HierarchicalEnum", "QuadProgMm", "DrawSyntax", "DrawTurksHead", "PrivateStuff", "vincent-jacques.net", "Hacking", "C4Planner", "developer.github.com", "PyGithub", "PyGithub", "django", "CinePlanning", "PyGithub", "PyGithub", "PyGithub", "IpMap", "PyGithub", "PyGithub", "PyGithub", "PyGithub", "PyGithub", "PyGithub", "PyGithub", "PyGithub", "PyGithub", "PyGithub", "PyGithub", "PyGithub"]) - def testGetPublicEvents( self ): - self.assertListKeyBegin( self.user.get_public_events(), lambda e: e.type, [ "PushEvent", "CreateEvent", "GistEvent", "IssuesEvent" ] ) + def testGetEvents(self): + self.assertListKeyBegin(self.user.get_events(), lambda e: e.type, ["GistEvent", "IssueCommentEvent", "PushEvent", "IssuesEvent"]) - def testGetPublicReceivedEvents( self ): - self.assertListKeyBegin( self.user.get_public_received_events(), lambda e: e.type, [ "IssueCommentEvent", "IssueCommentEvent", "IssueCommentEvent", "IssueCommentEvent" ] ) + def testGetPublicEvents(self): + self.assertListKeyBegin(self.user.get_public_events(), lambda e: e.type, ["PushEvent", "CreateEvent", "GistEvent", "IssuesEvent"]) - def testGetReceivedEvents( self ): - self.assertListKeyBegin( self.user.get_received_events(), lambda e: e.type, [ "IssueCommentEvent", "IssueCommentEvent", "IssueCommentEvent", "IssueCommentEvent" ] ) + def testGetPublicReceivedEvents(self): + self.assertListKeyBegin(self.user.get_public_received_events(), lambda e: e.type, ["IssueCommentEvent", "IssueCommentEvent", "IssueCommentEvent", "IssueCommentEvent"]) + + def testGetReceivedEvents(self): + self.assertListKeyBegin(self.user.get_received_events(), lambda e: e.type, ["IssueCommentEvent", "IssueCommentEvent", "IssueCommentEvent", "IssueCommentEvent"]) diff --git a/github/tests/Organization.py b/github/tests/Organization.py index 10dc001c..7610d18f 100644 --- a/github/tests/Organization.py +++ b/github/tests/Organization.py @@ -15,102 +15,103 @@ import Framework import datetime -class Organization( Framework.TestCase ): - def setUp( self ): - Framework.TestCase.setUp( self ) - self.org = self.g.get_organization( "BeaverSoftware" ) - def testAttributes( self ): - self.assertEqual( self.org.avatar_url, "https://secure.gravatar.com/avatar/d563e337cac2fdc644e2aaaad1e23266?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png" ) - self.assertEqual( self.org.billing_email, "BeaverSoftware@vincent-jacques.net" ) - self.assertEqual( self.org.blog, None ) - self.assertEqual( self.org.collaborators, 0 ) - self.assertEqual( self.org.company, None ) - self.assertEqual( self.org.created_at, datetime.datetime( 2012, 2, 9, 19, 20, 12 ) ) - self.assertEqual( self.org.disk_usage, 112 ) - self.assertEqual( self.org.email, None ) - self.assertEqual( self.org.followers, 0 ) - self.assertEqual( self.org.following, 0 ) - self.assertEqual( self.org.gravatar_id, None ) - self.assertEqual( self.org.html_url, "https://github.com/BeaverSoftware" ) - self.assertEqual( self.org.id, 1424031 ) - self.assertEqual( self.org.location, "Paris, France" ) - self.assertEqual( self.org.login, "BeaverSoftware" ) - self.assertEqual( self.org.name, None ) - self.assertEqual( self.org.owned_private_repos, 0 ) - self.assertEqual( self.org.plan.name, "free" ) - self.assertEqual( self.org.plan.private_repos, 0 ) - self.assertEqual( self.org.plan.space, 307200 ) - self.assertEqual( self.org.private_gists, 0 ) - self.assertEqual( self.org.public_gists, 0 ) - self.assertEqual( self.org.public_repos, 2 ) - self.assertEqual( self.org.total_private_repos, 0 ) - self.assertEqual( self.org.type, "Organization" ) - self.assertEqual( self.org.url, "https://api.github.com/orgs/BeaverSoftware" ) +class Organization(Framework.TestCase): + def setUp(self): + Framework.TestCase.setUp(self) + self.org = self.g.get_organization("BeaverSoftware") - def testEditWithoutArguments( self ): + def testAttributes(self): + self.assertEqual(self.org.avatar_url, "https://secure.gravatar.com/avatar/d563e337cac2fdc644e2aaaad1e23266?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png") + self.assertEqual(self.org.billing_email, "BeaverSoftware@vincent-jacques.net") + self.assertEqual(self.org.blog, None) + self.assertEqual(self.org.collaborators, 0) + self.assertEqual(self.org.company, None) + self.assertEqual(self.org.created_at, datetime.datetime(2012, 2, 9, 19, 20, 12)) + self.assertEqual(self.org.disk_usage, 112) + self.assertEqual(self.org.email, None) + self.assertEqual(self.org.followers, 0) + self.assertEqual(self.org.following, 0) + self.assertEqual(self.org.gravatar_id, None) + self.assertEqual(self.org.html_url, "https://github.com/BeaverSoftware") + self.assertEqual(self.org.id, 1424031) + self.assertEqual(self.org.location, "Paris, France") + self.assertEqual(self.org.login, "BeaverSoftware") + self.assertEqual(self.org.name, None) + self.assertEqual(self.org.owned_private_repos, 0) + self.assertEqual(self.org.plan.name, "free") + self.assertEqual(self.org.plan.private_repos, 0) + self.assertEqual(self.org.plan.space, 307200) + self.assertEqual(self.org.private_gists, 0) + self.assertEqual(self.org.public_gists, 0) + self.assertEqual(self.org.public_repos, 2) + self.assertEqual(self.org.total_private_repos, 0) + self.assertEqual(self.org.type, "Organization") + self.assertEqual(self.org.url, "https://api.github.com/orgs/BeaverSoftware") + + def testEditWithoutArguments(self): self.org.edit() - def testEditWithAllArguments( self ): - self.org.edit( "BeaverSoftware2@vincent-jacques.net", "http://vincent-jacques.net", "Company edited by PyGithub", "BeaverSoftware2@vincent-jacques.net", "Location edited by PyGithub", "Name edited by PyGithub" ) - self.assertEqual( self.org.billing_email, "BeaverSoftware2@vincent-jacques.net" ) - self.assertEqual( self.org.blog, "http://vincent-jacques.net" ) - self.assertEqual( self.org.company, "Company edited by PyGithub" ) - self.assertEqual( self.org.email, "BeaverSoftware2@vincent-jacques.net" ) - self.assertEqual( self.org.location, "Location edited by PyGithub" ) - self.assertEqual( self.org.name, "Name edited by PyGithub" ) + def testEditWithAllArguments(self): + self.org.edit("BeaverSoftware2@vincent-jacques.net", "http://vincent-jacques.net", "Company edited by PyGithub", "BeaverSoftware2@vincent-jacques.net", "Location edited by PyGithub", "Name edited by PyGithub") + self.assertEqual(self.org.billing_email, "BeaverSoftware2@vincent-jacques.net") + self.assertEqual(self.org.blog, "http://vincent-jacques.net") + self.assertEqual(self.org.company, "Company edited by PyGithub") + self.assertEqual(self.org.email, "BeaverSoftware2@vincent-jacques.net") + self.assertEqual(self.org.location, "Location edited by PyGithub") + self.assertEqual(self.org.name, "Name edited by PyGithub") - def testCreateTeam( self ): - team = self.org.create_team( "Team created by PyGithub" ) - self.assertEqual( team.id, 189850 ) + def testCreateTeam(self): + team = self.org.create_team("Team created by PyGithub") + self.assertEqual(team.id, 189850) - def testCreateTeamWithAllArguments( self ): - repo = self.org.get_repo( "FatherBeaver" ) - team = self.org.create_team( "Team also created by PyGithub", [ repo ], "push" ) - self.assertEqual( team.id, 189852 ) + def testCreateTeamWithAllArguments(self): + repo = self.org.get_repo("FatherBeaver") + team = self.org.create_team("Team also created by PyGithub", [repo], "push") + self.assertEqual(team.id, 189852) - def testPublicMembers( self ): - lyloa = self.g.get_user( "Lyloa" ) - self.assertFalse( self.org.has_in_public_members( lyloa ) ) - self.org.add_to_public_members( lyloa ) - self.assertTrue( self.org.has_in_public_members( lyloa ) ) - self.org.remove_from_public_members( lyloa ) - self.assertFalse( self.org.has_in_public_members( lyloa ) ) + def testPublicMembers(self): + lyloa = self.g.get_user("Lyloa") + self.assertFalse(self.org.has_in_public_members(lyloa)) + self.org.add_to_public_members(lyloa) + self.assertTrue(self.org.has_in_public_members(lyloa)) + self.org.remove_from_public_members(lyloa) + self.assertFalse(self.org.has_in_public_members(lyloa)) - def testGetPublicMembers( self ): - self.assertListKeyEqual( self.org.get_public_members(), lambda u: u.login, [ "jacquev6" ] ) + def testGetPublicMembers(self): + self.assertListKeyEqual(self.org.get_public_members(), lambda u: u.login, ["jacquev6"]) - def testGetMembers( self ): - self.assertListKeyEqual( self.org.get_members(), lambda u: u.login, [ "cjuniet", "jacquev6", "Lyloa" ] ) + def testGetMembers(self): + self.assertListKeyEqual(self.org.get_members(), lambda u: u.login, ["cjuniet", "jacquev6", "Lyloa"]) - def testMembers( self ): - lyloa = self.g.get_user( "Lyloa" ) - self.assertTrue( self.org.has_in_members( lyloa ) ) - self.org.remove_from_members( lyloa ) - self.assertFalse( self.org.has_in_members( lyloa ) ) + def testMembers(self): + lyloa = self.g.get_user("Lyloa") + self.assertTrue(self.org.has_in_members(lyloa)) + self.org.remove_from_members(lyloa) + self.assertFalse(self.org.has_in_members(lyloa)) - def testGetRepos( self ): - self.assertListKeyEqual( self.org.get_repos(), lambda r: r.name, [ "FatherBeaver", "TestPyGithub" ] ) + def testGetRepos(self): + self.assertListKeyEqual(self.org.get_repos(), lambda r: r.name, ["FatherBeaver", "TestPyGithub"]) - def testGetReposWithType( self ): - self.assertListKeyEqual( self.org.get_repos( "public" ), lambda r: r.name, [ "FatherBeaver", "PyGithub" ] ) + def testGetReposWithType(self): + self.assertListKeyEqual(self.org.get_repos("public"), lambda r: r.name, ["FatherBeaver", "PyGithub"]) - def testGetEvents( self ): - self.assertListKeyEqual( self.org.get_events(), lambda e: e.type, [ "CreateEvent", "CreateEvent", "PushEvent", "PushEvent", "DeleteEvent", "DeleteEvent", "PushEvent", "PushEvent", "DeleteEvent", "DeleteEvent", "PushEvent", "PushEvent", "PushEvent", "CreateEvent", "CreateEvent", "CreateEvent", "CreateEvent", "CreateEvent", "PushEvent", "PushEvent", "PushEvent", "PushEvent", "PushEvent", "PushEvent", "ForkEvent", "CreateEvent" ] ) + def testGetEvents(self): + self.assertListKeyEqual(self.org.get_events(), lambda e: e.type, ["CreateEvent", "CreateEvent", "PushEvent", "PushEvent", "DeleteEvent", "DeleteEvent", "PushEvent", "PushEvent", "DeleteEvent", "DeleteEvent", "PushEvent", "PushEvent", "PushEvent", "CreateEvent", "CreateEvent", "CreateEvent", "CreateEvent", "CreateEvent", "PushEvent", "PushEvent", "PushEvent", "PushEvent", "PushEvent", "PushEvent", "ForkEvent", "CreateEvent"]) - def testGetTeams( self ): - self.assertListKeyEqual( self.org.get_teams(), lambda t: t.name, [ "Members", "Owners" ] ) + def testGetTeams(self): + self.assertListKeyEqual(self.org.get_teams(), lambda t: t.name, ["Members", "Owners"]) - def testCreateRepoWithMinimalArguments( self ): - repo = self.org.create_repo( "TestPyGithub" ) - self.assertEqual( repo.url, "https://api.github.com/repos/BeaverSoftware/TestPyGithub" ) + def testCreateRepoWithMinimalArguments(self): + repo = self.org.create_repo("TestPyGithub") + self.assertEqual(repo.url, "https://api.github.com/repos/BeaverSoftware/TestPyGithub") - def testCreateRepoWithAllArguments( self ): - team = self.org.get_team( 141496 ) - repo = self.org.create_repo( "TestPyGithub2", "Repo created by PyGithub", "http://foobar.com", False, False, False, False, team ) - self.assertEqual( repo.url, "https://api.github.com/repos/BeaverSoftware/TestPyGithub2" ) + def testCreateRepoWithAllArguments(self): + team = self.org.get_team(141496) + repo = self.org.create_repo("TestPyGithub2", "Repo created by PyGithub", "http://foobar.com", False, False, False, False, team) + self.assertEqual(repo.url, "https://api.github.com/repos/BeaverSoftware/TestPyGithub2") - def testCreateFork( self ): - pygithub = self.g.get_user( "jacquev6" ).get_repo( "PyGithub" ) - repo = self.org.create_fork( pygithub ) - self.assertEqual( repo.url, "https://api.github.com/repos/BeaverSoftware/PyGithub" ) + def testCreateFork(self): + pygithub = self.g.get_user("jacquev6").get_repo("PyGithub") + repo = self.org.create_fork(pygithub) + self.assertEqual(repo.url, "https://api.github.com/repos/BeaverSoftware/PyGithub") diff --git a/github/tests/PaginatedList.py b/github/tests/PaginatedList.py index 016b93bb..00c45db1 100644 --- a/github/tests/PaginatedList.py +++ b/github/tests/PaginatedList.py @@ -13,56 +13,57 @@ import Framework -class PaginatedList( Framework.TestCase ): - def setUp( self ): - Framework.TestCase.setUp( self ) - self.list = self.g.get_user( "openframeworks" ).get_repo( "openFrameworks" ).get_issues() - def testIteration( self ): - self.assertEqual( len( list( self.list ) ), 333 ) +class PaginatedList(Framework.TestCase): + def setUp(self): + Framework.TestCase.setUp(self) + self.list = self.g.get_user("openframeworks").get_repo("openFrameworks").get_issues() - def testSeveralIterations( self ): - self.assertEqual( len( list( self.list ) ), 333 ) - self.assertEqual( len( list( self.list ) ), 333 ) - self.assertEqual( len( list( self.list ) ), 333 ) - self.assertEqual( len( list( self.list ) ), 333 ) + def testIteration(self): + self.assertEqual(len(list(self.list)), 333) - def testIntIndexingInFirstPage( self ): - self.assertEqual( self.list[ 0 ].id, 4772349 ) - self.assertEqual( self.list[ 24 ].id, 4286936 ) + def testSeveralIterations(self): + self.assertEqual(len(list(self.list)), 333) + self.assertEqual(len(list(self.list)), 333) + self.assertEqual(len(list(self.list)), 333) + self.assertEqual(len(list(self.list)), 333) - def testIntIndexingInThirdPage( self ): - self.assertEqual( self.list[ 50 ].id, 3911629 ) - self.assertEqual( self.list[ 74 ].id, 3605277 ) + def testIntIndexingInFirstPage(self): + self.assertEqual(self.list[0].id, 4772349) + self.assertEqual(self.list[24].id, 4286936) - def testGetFirstPage( self ): - self.assertListKeyEqual( self.list.get_page( 0 ), lambda i: i.id, [ 4772349, 4767675, 4758608, 4700182, 4662873, 4608132, 4604661, 4588997, 4557803, 4554058, 4539985, 4507572, 4507492, 4507416, 4447561, 4406584, 4384548, 4383465, 4373361, 4373201, 4370619, 4356530, 4352401, 4317009, 4286936 ] ) + def testIntIndexingInThirdPage(self): + self.assertEqual(self.list[50].id, 3911629) + self.assertEqual(self.list[74].id, 3605277) - def testGetThirdPage( self ): - self.assertListKeyEqual( self.list.get_page( 2 ), lambda i: i.id, [ 3911629, 3911537, 3910580, 3910555, 3910549, 3897090, 3883598, 3856005, 3850655, 3825582, 3813852, 3812318, 3812275, 3807459, 3799872, 3799653, 3795495, 3754055, 3710293, 3662214, 3647640, 3631618, 3627067, 3614231, 3605277 ] ) + def testGetFirstPage(self): + self.assertListKeyEqual(self.list.get_page(0), lambda i: i.id, [4772349, 4767675, 4758608, 4700182, 4662873, 4608132, 4604661, 4588997, 4557803, 4554058, 4539985, 4507572, 4507492, 4507416, 4447561, 4406584, 4384548, 4383465, 4373361, 4373201, 4370619, 4356530, 4352401, 4317009, 4286936]) - def testIntIndexingAfterIteration( self ): - self.assertEqual( len( list( self.list ) ), 333 ) - self.assertEqual( self.list[ 11 ].id, 4507572 ) - self.assertEqual( self.list[ 73 ].id, 3614231 ) - self.assertEqual( self.list[ 332 ].id, 94898 ) + def testGetThirdPage(self): + self.assertListKeyEqual(self.list.get_page(2), lambda i: i.id, [3911629, 3911537, 3910580, 3910555, 3910549, 3897090, 3883598, 3856005, 3850655, 3825582, 3813852, 3812318, 3812275, 3807459, 3799872, 3799653, 3795495, 3754055, 3710293, 3662214, 3647640, 3631618, 3627067, 3614231, 3605277]) - def testSliceIndexingInFirstPage( self ): - self.assertListKeyEqual( self.list[ : 13 ], lambda i: i.id, [ 4772349, 4767675, 4758608, 4700182, 4662873, 4608132, 4604661, 4588997, 4557803, 4554058, 4539985, 4507572, 4507492 ] ) - self.assertListKeyEqual( self.list[ : 13 : 3 ], lambda i: i.id, [ 4772349, 4700182, 4604661, 4554058, 4507492 ] ) - self.assertListKeyEqual( self.list[ 10 : 13 ], lambda i: i.id, [ 4539985, 4507572, 4507492 ] ) - self.assertListKeyEqual( self.list[ 5 : 13 : 3 ], lambda i: i.id, [ 4608132, 4557803, 4507572 ] ) + def testIntIndexingAfterIteration(self): + self.assertEqual(len(list(self.list)), 333) + self.assertEqual(self.list[11].id, 4507572) + self.assertEqual(self.list[73].id, 3614231) + self.assertEqual(self.list[332].id, 94898) - def testSliceIndexingUntilFourthPage( self ): - self.assertListKeyEqual( self.list[ : 99 : 10 ], lambda i: i.id, [ 4772349, 4539985, 4370619, 4207350, 4063366, 3911629, 3813852, 3647640, 3528378, 3438233 ] ) - self.assertListKeyEqual( self.list[ 73 : 78 ], lambda i: i.id, [ 3614231, 3605277, 3596240, 3594731, 3593619 ] ) - self.assertListKeyEqual( self.list[ 70 : 80 : 2 ], lambda i: i.id, [ 3647640, 3627067, 3605277, 3594731, 3593430 ] ) + def testSliceIndexingInFirstPage(self): + self.assertListKeyEqual(self.list[:13], lambda i: i.id, [4772349, 4767675, 4758608, 4700182, 4662873, 4608132, 4604661, 4588997, 4557803, 4554058, 4539985, 4507572, 4507492]) + self.assertListKeyEqual(self.list[:13:3], lambda i: i.id, [4772349, 4700182, 4604661, 4554058, 4507492]) + self.assertListKeyEqual(self.list[10:13], lambda i: i.id, [4539985, 4507572, 4507492]) + self.assertListKeyEqual(self.list[5:13:3], lambda i: i.id, [4608132, 4557803, 4507572]) - def testSliceIndexingUntilEnd( self ): - self.assertListKeyEqual( self.list[ 310 : : 3 ], lambda i: i.id, [ 268332, 204247, 169176, 166211, 165898, 163959, 132373, 104702 ] ) - self.assertListKeyEqual( self.list[ 310 : ], lambda i: i.id, [ 268332, 211418, 205935, 204247, 172424, 171615, 169176, 166214, 166212, 166211, 166209, 166208, 165898, 165537, 165409, 163959, 132671, 132377, 132373, 130269, 111018, 104702, 94898 ] ) + def testSliceIndexingUntilFourthPage(self): + self.assertListKeyEqual(self.list[:99:10], lambda i: i.id, [4772349, 4539985, 4370619, 4207350, 4063366, 3911629, 3813852, 3647640, 3528378, 3438233]) + self.assertListKeyEqual(self.list[73:78], lambda i: i.id, [3614231, 3605277, 3596240, 3594731, 3593619]) + self.assertListKeyEqual(self.list[70:80:2], lambda i: i.id, [3647640, 3627067, 3605277, 3594731, 3593430]) - def testInterruptedIteration( self ): + def testSliceIndexingUntilEnd(self): + self.assertListKeyEqual(self.list[310::3], lambda i: i.id, [268332, 204247, 169176, 166211, 165898, 163959, 132373, 104702]) + self.assertListKeyEqual(self.list[310:], lambda i: i.id, [268332, 211418, 205935, 204247, 172424, 171615, 169176, 166214, 166212, 166211, 166209, 166208, 165898, 165537, 165409, 163959, 132671, 132377, 132373, 130269, 111018, 104702, 94898]) + + def testInterruptedIteration(self): # No asserts, but checks that only three pages are fetched l = 0 for element in self.list: @@ -70,10 +71,10 @@ class PaginatedList( Framework.TestCase ): if l == 75: break - def testInterruptedIterationInSlice( self ): + def testInterruptedIterationInSlice(self): # No asserts, but checks that only three pages are fetched l = 0 - for element in self.list[ :100 ]: + for element in self.list[:100]: l += 1 if l == 75: break diff --git a/github/tests/PullRequest.py b/github/tests/PullRequest.py index 9f6331e9..7afaf576 100644 --- a/github/tests/PullRequest.py +++ b/github/tests/PullRequest.py @@ -15,85 +15,86 @@ import Framework import datetime -class PullRequest( Framework.TestCase ): - def setUp( self ): - Framework.TestCase.setUp( self ) - self.repo = self.g.get_user().get_repo( "PyGithub" ) - self.pull = self.repo.get_pull( 31 ) - def testAttributes( self ): - self.assertEqual( self.pull.additions, 511 ) - self.assertEqual( self.pull.base.label, "jacquev6:topic/RewriteWithGeneratedCode" ) - self.assertEqual( self.pull.base.sha, "ed866fc43833802ab553e5ff8581c81bb00dd433" ) - self.assertEqual( self.pull.base.user.login, "jacquev6" ) - self.assertEqual( self.pull.base.ref, "topic/RewriteWithGeneratedCode" ) - self.assertEqual( self.pull.base.repo.full_name, "jacquev6/PyGithub" ) - self.assertEqual( self.pull.body, "Body edited by PyGithub" ) - self.assertEqual( self.pull.changed_files, 45 ) - self.assertEqual( self.pull.closed_at, datetime.datetime( 2012, 5, 27, 10, 29, 7 ) ) - self.assertEqual( self.pull.comments, 0 ) - self.assertEqual( self.pull.commits, 3 ) - self.assertEqual( self.pull.created_at, datetime.datetime( 2012, 5, 27, 9, 25, 36 ) ) - self.assertEqual( self.pull.deletions, 384 ) - self.assertEqual( self.pull.diff_url, "https://github.com/jacquev6/PyGithub/pull/31.diff" ) - self.assertEqual( self.pull.head.label, "BeaverSoftware:master" ) - self.assertEqual( self.pull.html_url, "https://github.com/jacquev6/PyGithub/pull/31" ) - self.assertEqual( self.pull.id, 1436215 ) - self.assertEqual( self.pull.issue_url, "https://github.com/jacquev6/PyGithub/issues/31" ) - self.assertEqual( self.pull.mergeable, None ) - self.assertEqual( self.pull.merged, True ) - self.assertEqual( self.pull.merged_at, datetime.datetime( 2012, 5, 27, 10, 29, 7 ) ) - self.assertEqual( self.pull.merged_by.login, "jacquev6" ) - self.assertEqual( self.pull.number, 31 ) - self.assertEqual( self.pull.patch_url, "https://github.com/jacquev6/PyGithub/pull/31.patch" ) - self.assertEqual( self.pull.review_comments, 1 ) - self.assertEqual( self.pull.state, "closed" ) - self.assertEqual( self.pull.title, "Title edited by PyGithub" ) - self.assertEqual( self.pull.updated_at, datetime.datetime( 2012, 5, 27, 10, 29, 7 ) ) - self.assertEqual( self.pull.url, "https://api.github.com/repos/jacquev6/PyGithub/pulls/31" ) - self.assertEqual( self.pull.user.login, "jacquev6" ) +class PullRequest(Framework.TestCase): + def setUp(self): + Framework.TestCase.setUp(self) + self.repo = self.g.get_user().get_repo("PyGithub") + self.pull = self.repo.get_pull(31) - def testCreateComment( self ): - commit = self.repo.get_commit( "8a4f306d4b223682dd19410d4a9150636ebe4206" ) - comment = self.pull.create_comment( "Comment created by PyGithub", commit, "src/github/Issue.py", 5 ) - self.assertEqual( comment.id, 886298 ) + def testAttributes(self): + self.assertEqual(self.pull.additions, 511) + self.assertEqual(self.pull.base.label, "jacquev6:topic/RewriteWithGeneratedCode") + self.assertEqual(self.pull.base.sha, "ed866fc43833802ab553e5ff8581c81bb00dd433") + self.assertEqual(self.pull.base.user.login, "jacquev6") + self.assertEqual(self.pull.base.ref, "topic/RewriteWithGeneratedCode") + self.assertEqual(self.pull.base.repo.full_name, "jacquev6/PyGithub") + self.assertEqual(self.pull.body, "Body edited by PyGithub") + self.assertEqual(self.pull.changed_files, 45) + self.assertEqual(self.pull.closed_at, datetime.datetime(2012, 5, 27, 10, 29, 7)) + self.assertEqual(self.pull.comments, 0) + self.assertEqual(self.pull.commits, 3) + self.assertEqual(self.pull.created_at, datetime.datetime(2012, 5, 27, 9, 25, 36)) + self.assertEqual(self.pull.deletions, 384) + self.assertEqual(self.pull.diff_url, "https://github.com/jacquev6/PyGithub/pull/31.diff") + self.assertEqual(self.pull.head.label, "BeaverSoftware:master") + self.assertEqual(self.pull.html_url, "https://github.com/jacquev6/PyGithub/pull/31") + self.assertEqual(self.pull.id, 1436215) + self.assertEqual(self.pull.issue_url, "https://github.com/jacquev6/PyGithub/issues/31") + self.assertEqual(self.pull.mergeable, None) + self.assertEqual(self.pull.merged, True) + self.assertEqual(self.pull.merged_at, datetime.datetime(2012, 5, 27, 10, 29, 7)) + self.assertEqual(self.pull.merged_by.login, "jacquev6") + self.assertEqual(self.pull.number, 31) + self.assertEqual(self.pull.patch_url, "https://github.com/jacquev6/PyGithub/pull/31.patch") + self.assertEqual(self.pull.review_comments, 1) + self.assertEqual(self.pull.state, "closed") + self.assertEqual(self.pull.title, "Title edited by PyGithub") + self.assertEqual(self.pull.updated_at, datetime.datetime(2012, 5, 27, 10, 29, 7)) + self.assertEqual(self.pull.url, "https://api.github.com/repos/jacquev6/PyGithub/pulls/31") + self.assertEqual(self.pull.user.login, "jacquev6") - def testGetComments( self ): - self.assertListKeyEqual( self.pull.get_comments(), lambda c: c.id, [ 886298 ] ) + def testCreateComment(self): + commit = self.repo.get_commit("8a4f306d4b223682dd19410d4a9150636ebe4206") + comment = self.pull.create_comment("Comment created by PyGithub", commit, "src/github/Issue.py", 5) + self.assertEqual(comment.id, 886298) - def testCreateIssueComment( self ): - comment = self.pull.create_issue_comment( "Issue comment created by PyGithub" ) - self.assertEqual( comment.id, 8387331 ) + def testGetComments(self): + self.assertListKeyEqual(self.pull.get_comments(), lambda c: c.id, [886298]) - def testGetIssueComments( self ): - self.assertListKeyEqual( self.pull.get_issue_comments(), lambda c: c.id, [ 8387331 ] ) + def testCreateIssueComment(self): + comment = self.pull.create_issue_comment("Issue comment created by PyGithub") + self.assertEqual(comment.id, 8387331) - def testGetIssueComment( self ): - comment = self.pull.get_issue_comment( 8387331 ) - self.assertEqual( comment.body, "Issue comment created by PyGithub" ) + def testGetIssueComments(self): + self.assertListKeyEqual(self.pull.get_issue_comments(), lambda c: c.id, [8387331]) - def testEditWithoutArguments( self ): + def testGetIssueComment(self): + comment = self.pull.get_issue_comment(8387331) + self.assertEqual(comment.body, "Issue comment created by PyGithub") + + def testEditWithoutArguments(self): self.pull.edit() - def testEditWithAllArguments( self ): - self.pull.edit( "Title edited by PyGithub", "Body edited by PyGithub", "open" ) - self.assertEqual( self.pull.title, "Title edited by PyGithub" ) - self.assertEqual( self.pull.body, "Body edited by PyGithub" ) - self.assertEqual( self.pull.state, "open" ) + def testEditWithAllArguments(self): + self.pull.edit("Title edited by PyGithub", "Body edited by PyGithub", "open") + self.assertEqual(self.pull.title, "Title edited by PyGithub") + self.assertEqual(self.pull.body, "Body edited by PyGithub") + self.assertEqual(self.pull.state, "open") - def testGetCommits( self ): - self.assertListKeyEqual( self.pull.get_commits(), lambda c: c.sha, [ "4aadfff21cdd2d2566b0e4bd7309c233b5f4ae23", "93dcae5cf207de376c91d0599226e7c7563e1d16", "8a4f306d4b223682dd19410d4a9150636ebe4206" ] ) + def testGetCommits(self): + self.assertListKeyEqual(self.pull.get_commits(), lambda c: c.sha, ["4aadfff21cdd2d2566b0e4bd7309c233b5f4ae23", "93dcae5cf207de376c91d0599226e7c7563e1d16", "8a4f306d4b223682dd19410d4a9150636ebe4206"]) - def testGetFiles( self ): - self.assertListKeyEqual( self.pull.get_files(), lambda f: f.filename, [ "codegen/templates/GithubObject.py", "src/github/AuthenticatedUser.py", "src/github/Authorization.py", "src/github/Branch.py", "src/github/Commit.py", "src/github/CommitComment.py", "src/github/CommitFile.py", "src/github/CommitStats.py", "src/github/Download.py", "src/github/Event.py", "src/github/Gist.py", "src/github/GistComment.py", "src/github/GistHistoryState.py", "src/github/GitAuthor.py", "src/github/GitBlob.py", "src/github/GitCommit.py", "src/github/GitObject.py", "src/github/GitRef.py", "src/github/GitTag.py", "src/github/GitTree.py", "src/github/GitTreeElement.py", "src/github/Hook.py", "src/github/Issue.py", "src/github/IssueComment.py", "src/github/IssueEvent.py", "src/github/Label.py", "src/github/Milestone.py", "src/github/NamedUser.py", "src/github/Organization.py", "src/github/Permissions.py", "src/github/Plan.py", "src/github/PullRequest.py", "src/github/PullRequestComment.py", "src/github/PullRequestFile.py", "src/github/Repository.py", "src/github/RepositoryKey.py", "src/github/Tag.py", "src/github/Team.py", "src/github/UserKey.py", "test/Issue.py", "test/IssueEvent.py", "test/ReplayData/Issue.testAddAndRemoveLabels.txt", "test/ReplayData/Issue.testDeleteAndSetLabels.txt", "test/ReplayData/Issue.testGetLabels.txt", "test/ReplayData/IssueEvent.setUp.txt" ] ) + def testGetFiles(self): + self.assertListKeyEqual(self.pull.get_files(), lambda f: f.filename, ["codegen/templates/GithubObject.py", "src/github/AuthenticatedUser.py", "src/github/Authorization.py", "src/github/Branch.py", "src/github/Commit.py", "src/github/CommitComment.py", "src/github/CommitFile.py", "src/github/CommitStats.py", "src/github/Download.py", "src/github/Event.py", "src/github/Gist.py", "src/github/GistComment.py", "src/github/GistHistoryState.py", "src/github/GitAuthor.py", "src/github/GitBlob.py", "src/github/GitCommit.py", "src/github/GitObject.py", "src/github/GitRef.py", "src/github/GitTag.py", "src/github/GitTree.py", "src/github/GitTreeElement.py", "src/github/Hook.py", "src/github/Issue.py", "src/github/IssueComment.py", "src/github/IssueEvent.py", "src/github/Label.py", "src/github/Milestone.py", "src/github/NamedUser.py", "src/github/Organization.py", "src/github/Permissions.py", "src/github/Plan.py", "src/github/PullRequest.py", "src/github/PullRequestComment.py", "src/github/PullRequestFile.py", "src/github/Repository.py", "src/github/RepositoryKey.py", "src/github/Tag.py", "src/github/Team.py", "src/github/UserKey.py", "test/Issue.py", "test/IssueEvent.py", "test/ReplayData/Issue.testAddAndRemoveLabels.txt", "test/ReplayData/Issue.testDeleteAndSetLabels.txt", "test/ReplayData/Issue.testGetLabels.txt", "test/ReplayData/IssueEvent.setUp.txt"]) - def testMerge( self ): - self.assertFalse( self.pull.is_merged() ) + def testMerge(self): + self.assertFalse(self.pull.is_merged()) status = self.pull.merge() - self.assertEqual( status.sha, "688208b1a5a074871d0e9376119556897439697d" ) - self.assertEqual( status.merged, True ) - self.assertEqual( status.message, "Pull Request successfully merged" ) - self.assertTrue( self.pull.is_merged() ) + self.assertEqual(status.sha, "688208b1a5a074871d0e9376119556897439697d") + self.assertEqual(status.merged, True) + self.assertEqual(status.message, "Pull Request successfully merged") + self.assertTrue(self.pull.is_merged()) - def testMergeWithCommitMessage( self ): - self.g.get_user().get_repo( "PyGithub" ).get_pull( 39 ).merge( "Custom commit message created by PyGithub" ) + def testMergeWithCommitMessage(self): + self.g.get_user().get_repo("PyGithub").get_pull(39).merge("Custom commit message created by PyGithub") diff --git a/github/tests/PullRequestComment.py b/github/tests/PullRequestComment.py index 920f46f3..1830f110 100644 --- a/github/tests/PullRequestComment.py +++ b/github/tests/PullRequestComment.py @@ -15,27 +15,28 @@ import Framework import datetime -class PullRequestComment( Framework.TestCase ): - def setUp( self ): - Framework.TestCase.setUp( self ) - self.comment = self.g.get_user().get_repo( "PyGithub" ).get_pull( 31 ).get_comment( 886298 ) - def testAttributes( self ): - self.assertEqual( self.comment.body, "Comment created by PyGithub" ) - self.assertEqual( self.comment.commit_id, "8a4f306d4b223682dd19410d4a9150636ebe4206" ) - self.assertEqual( self.comment.created_at, datetime.datetime( 2012, 5, 27, 9, 40, 12 ) ) - self.assertEqual( self.comment.id, 886298 ) - self.assertEqual( self.comment.original_commit_id, "8a4f306d4b223682dd19410d4a9150636ebe4206" ) - self.assertEqual( self.comment.original_position, 5 ) - self.assertEqual( self.comment.path, "src/github/Issue.py" ) - self.assertEqual( self.comment.position, 5 ) - self.assertEqual( self.comment.updated_at, datetime.datetime( 2012, 5, 27, 9, 40, 12 ) ) - self.assertEqual( self.comment.url, "https://api.github.com/repos/jacquev6/PyGithub/pulls/comments/886298" ) - self.assertEqual( self.comment.user.login, "jacquev6" ) +class PullRequestComment(Framework.TestCase): + def setUp(self): + Framework.TestCase.setUp(self) + self.comment = self.g.get_user().get_repo("PyGithub").get_pull(31).get_comment(886298) - def testEdit( self ): - self.comment.edit( "Comment edited by PyGithub" ) - self.assertEqual( self.comment.body, "Comment edited by PyGithub" ) + def testAttributes(self): + self.assertEqual(self.comment.body, "Comment created by PyGithub") + self.assertEqual(self.comment.commit_id, "8a4f306d4b223682dd19410d4a9150636ebe4206") + self.assertEqual(self.comment.created_at, datetime.datetime(2012, 5, 27, 9, 40, 12)) + self.assertEqual(self.comment.id, 886298) + self.assertEqual(self.comment.original_commit_id, "8a4f306d4b223682dd19410d4a9150636ebe4206") + self.assertEqual(self.comment.original_position, 5) + self.assertEqual(self.comment.path, "src/github/Issue.py") + self.assertEqual(self.comment.position, 5) + self.assertEqual(self.comment.updated_at, datetime.datetime(2012, 5, 27, 9, 40, 12)) + self.assertEqual(self.comment.url, "https://api.github.com/repos/jacquev6/PyGithub/pulls/comments/886298") + self.assertEqual(self.comment.user.login, "jacquev6") - def testDelete( self ): # Test PullRequest.get_comments before + def testEdit(self): + self.comment.edit("Comment edited by PyGithub") + self.assertEqual(self.comment.body, "Comment edited by PyGithub") + + def testDelete(self): self.comment.delete() diff --git a/github/tests/PullRequestFile.py b/github/tests/PullRequestFile.py index c4fbae7d..4ebb09ed 100644 --- a/github/tests/PullRequestFile.py +++ b/github/tests/PullRequestFile.py @@ -13,18 +13,19 @@ import Framework -class PullRequestFile( Framework.TestCase ): - def setUp( self ): - Framework.TestCase.setUp( self ) - self.file = self.g.get_user().get_repo( "PyGithub" ).get_pull( 31 ).get_files()[ 0 ] - def testAttributes( self ): - self.assertEqual( self.file.additions, 1 ) - self.assertEqual( self.file.blob_url, "https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/codegen/templates/GithubObject.py" ) - self.assertEqual( self.file.changes, 2 ) - self.assertEqual( self.file.deletions, 1 ) - self.assertEqual( self.file.filename, "codegen/templates/GithubObject.py" ) - self.assertEqual( self.file.patch, '@@ -70,7 +70,7 @@ def __useAttributes( self, attributes ):\n \n # @toto No need to check if attribute is in attributes when attribute is mandatory\n {% for attribute in class.attributes|dictsort:"name" %}\n- if "{{ attribute.name }}" in attributes and attributes[ "{{ attribute.name }}" ] is not None:\n+ if "{{ attribute.name }}" in attributes and attributes[ "{{ attribute.name }}" ] is not None: # pragma no branch\n \n {% if attribute.type.cardinality == "scalar" %}\n {% if attribute.type.simple %}' ) - self.assertEqual( self.file.raw_url, "https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/codegen/templates/GithubObject.py" ) - self.assertEqual( self.file.sha, "8a4f306d4b223682dd19410d4a9150636ebe4206" ) - self.assertEqual( self.file.status, "modified" ) +class PullRequestFile(Framework.TestCase): + def setUp(self): + Framework.TestCase.setUp(self) + self.file = self.g.get_user().get_repo("PyGithub").get_pull(31).get_files()[0] + + def testAttributes(self): + self.assertEqual(self.file.additions, 1) + self.assertEqual(self.file.blob_url, "https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/codegen/templates/GithubObject.py") + self.assertEqual(self.file.changes, 2) + self.assertEqual(self.file.deletions, 1) + self.assertEqual(self.file.filename, "codegen/templates/GithubObject.py") + self.assertEqual(self.file.patch, '@@ -70,7 +70,7 @@ def __useAttributes( self, attributes ):\n \n # @toto No need to check if attribute is in attributes when attribute is mandatory\n {% for attribute in class.attributes|dictsort:"name" %}\n- if "{{ attribute.name }}" in attributes and attributes[ "{{ attribute.name }}" ] is not None:\n+ if "{{ attribute.name }}" in attributes and attributes[ "{{ attribute.name }}" ] is not None: # pragma no branch\n \n {% if attribute.type.cardinality == "scalar" %}\n {% if attribute.type.simple %}') + self.assertEqual(self.file.raw_url, "https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/codegen/templates/GithubObject.py") + self.assertEqual(self.file.sha, "8a4f306d4b223682dd19410d4a9150636ebe4206") + self.assertEqual(self.file.status, "modified") diff --git a/github/tests/RateLimiting.py b/github/tests/RateLimiting.py index 3cda5ca1..7f3c2e0b 100644 --- a/github/tests/RateLimiting.py +++ b/github/tests/RateLimiting.py @@ -13,8 +13,9 @@ import Framework -class RateLimiting( Framework.TestCase ): - def testRateLimiting( self ): - self.assertEqual( self.g.rate_limiting, ( 5000, 5000 ) ) - self.g.get_user( "jacquev6" ) - self.assertEqual( self.g.rate_limiting, ( 4999, 5000 ) ) + +class RateLimiting(Framework.TestCase): + def testRateLimiting(self): + self.assertEqual(self.g.rate_limiting, (5000, 5000)) + self.g.get_user("jacquev6") + self.assertEqual(self.g.rate_limiting, (4999, 5000)) diff --git a/github/tests/Repository.py b/github/tests/Repository.py index a216befd..9835973a 100644 --- a/github/tests/Repository.py +++ b/github/tests/Repository.py @@ -16,227 +16,228 @@ import Framework import github import datetime -class Repository( Framework.TestCase ): - def setUp( self ): - Framework.TestCase.setUp( self ) - self.repo = self.g.get_user().get_repo( "PyGithub" ) - def testAttributes( self ): - self.assertEqual( self.repo.clone_url, "https://github.com/jacquev6/PyGithub.git" ) - self.assertEqual( self.repo.created_at, datetime.datetime( 2012, 2, 25, 12, 53, 47 ) ) - self.assertEqual( self.repo.description, "Python library implementing the full Github API v3" ) - self.assertEqual( self.repo.fork, False ) - self.assertEqual( self.repo.forks, 3 ) - self.assertEqual( self.repo.full_name, "jacquev6/PyGithub" ) - self.assertEqual( self.repo.git_url, "git://github.com/jacquev6/PyGithub.git" ) - self.assertEqual( self.repo.has_downloads, True ) - self.assertEqual( self.repo.has_issues, True ) - self.assertEqual( self.repo.has_wiki, False ) - self.assertEqual( self.repo.homepage, "http://vincent-jacques.net/PyGithub" ) - self.assertEqual( self.repo.html_url, "https://github.com/jacquev6/PyGithub" ) - self.assertEqual( self.repo.id, 3544490 ) - self.assertEqual( self.repo.language, "Python" ) - self.assertEqual( self.repo.master_branch, None ) - self.assertEqual( self.repo.name, "PyGithub" ) - self.assertEqual( self.repo.open_issues, 16 ) - self.assertEqual( self.repo.organization, None ) - self.assertEqual( self.repo.owner.login, "jacquev6" ) - self.assertEqual( self.repo.parent, None ) - self.assertEqual( self.repo.permissions.admin, True ) - self.assertEqual( self.repo.permissions.pull, True ) - self.assertEqual( self.repo.permissions.push, True ) - self.assertEqual( self.repo.private, False ) - self.assertEqual( self.repo.pushed_at, datetime.datetime( 2012, 5, 27, 6, 0, 28 ) ) - self.assertEqual( self.repo.size, 308 ) - self.assertEqual( self.repo.source, None ) - self.assertEqual( self.repo.ssh_url, "git@github.com:jacquev6/PyGithub.git" ) - self.assertEqual( self.repo.svn_url, "https://github.com/jacquev6/PyGithub" ) - self.assertEqual( self.repo.updated_at, datetime.datetime( 2012, 5, 27, 6, 55, 28 ) ) - self.assertEqual( self.repo.url, "https://api.github.com/repos/jacquev6/PyGithub" ) - self.assertEqual( self.repo.watchers, 15 ) +class Repository(Framework.TestCase): + def setUp(self): + Framework.TestCase.setUp(self) + self.repo = self.g.get_user().get_repo("PyGithub") - def testEditWithoutArguments( self ): - self.repo.edit( "PyGithub" ) + def testAttributes(self): + self.assertEqual(self.repo.clone_url, "https://github.com/jacquev6/PyGithub.git") + self.assertEqual(self.repo.created_at, datetime.datetime(2012, 2, 25, 12, 53, 47)) + self.assertEqual(self.repo.description, "Python library implementing the full Github API v3") + self.assertEqual(self.repo.fork, False) + self.assertEqual(self.repo.forks, 3) + self.assertEqual(self.repo.full_name, "jacquev6/PyGithub") + self.assertEqual(self.repo.git_url, "git://github.com/jacquev6/PyGithub.git") + self.assertEqual(self.repo.has_downloads, True) + self.assertEqual(self.repo.has_issues, True) + self.assertEqual(self.repo.has_wiki, False) + self.assertEqual(self.repo.homepage, "http://vincent-jacques.net/PyGithub") + self.assertEqual(self.repo.html_url, "https://github.com/jacquev6/PyGithub") + self.assertEqual(self.repo.id, 3544490) + self.assertEqual(self.repo.language, "Python") + self.assertEqual(self.repo.master_branch, None) + self.assertEqual(self.repo.name, "PyGithub") + self.assertEqual(self.repo.open_issues, 16) + self.assertEqual(self.repo.organization, None) + self.assertEqual(self.repo.owner.login, "jacquev6") + self.assertEqual(self.repo.parent, None) + self.assertEqual(self.repo.permissions.admin, True) + self.assertEqual(self.repo.permissions.pull, True) + self.assertEqual(self.repo.permissions.push, True) + self.assertEqual(self.repo.private, False) + self.assertEqual(self.repo.pushed_at, datetime.datetime(2012, 5, 27, 6, 0, 28)) + self.assertEqual(self.repo.size, 308) + self.assertEqual(self.repo.source, None) + self.assertEqual(self.repo.ssh_url, "git@github.com:jacquev6/PyGithub.git") + self.assertEqual(self.repo.svn_url, "https://github.com/jacquev6/PyGithub") + self.assertEqual(self.repo.updated_at, datetime.datetime(2012, 5, 27, 6, 55, 28)) + self.assertEqual(self.repo.url, "https://api.github.com/repos/jacquev6/PyGithub") + self.assertEqual(self.repo.watchers, 15) - def testEditWithAllArguments( self ): - self.repo.edit( "PyGithub", "Description edited by PyGithub", "http://vincent-jacques.net/PyGithub", public = True, has_issues = True, has_wiki = False, has_downloads = True ) - self.assertEqual( self.repo.description, "Description edited by PyGithub" ) - self.repo.edit( "PyGithub", "Python library implementing the full Github API v3" ) - self.assertEqual( self.repo.description, "Python library implementing the full Github API v3" ) + def testEditWithoutArguments(self): + self.repo.edit("PyGithub") - def testDelete( self ): - repo = self.g.get_user().get_repo( "TestPyGithub" ) + def testEditWithAllArguments(self): + self.repo.edit("PyGithub", "Description edited by PyGithub", "http://vincent-jacques.net/PyGithub", public=True, has_issues=True, has_wiki=False, has_downloads=True) + self.assertEqual(self.repo.description, "Description edited by PyGithub") + self.repo.edit("PyGithub", "Python library implementing the full Github API v3") + self.assertEqual(self.repo.description, "Python library implementing the full Github API v3") + + def testDelete(self): + repo = self.g.get_user().get_repo("TestPyGithub") repo.delete() - def testGetContributors( self ): - self.assertListKeyEqual( self.repo.get_contributors(), lambda c: ( c.login, c.contributions ), [ ( "jacquev6", 355 ) ] ) + def testGetContributors(self): + self.assertListKeyEqual(self.repo.get_contributors(), lambda c: (c.login, c.contributions), [("jacquev6", 355)]) - def testCreateMilestone( self ): - milestone = self.repo.create_milestone( "Milestone created by PyGithub", state = "open", description = "Description created by PyGithub", due_on = datetime.date( 2012, 6, 15 ) ) - self.assertEqual( milestone.number, 5 ) + def testCreateMilestone(self): + milestone = self.repo.create_milestone("Milestone created by PyGithub", state="open", description="Description created by PyGithub", due_on=datetime.date(2012, 6, 15)) + self.assertEqual(milestone.number, 5) - def testCreateMilestoneWithMinimalArguments( self ): - milestone = self.repo.create_milestone( "Milestone also created by PyGithub" ) - self.assertEqual( milestone.number, 6 ) + def testCreateMilestoneWithMinimalArguments(self): + milestone = self.repo.create_milestone("Milestone also created by PyGithub") + self.assertEqual(milestone.number, 6) - def testCreateIssue( self ): - issue = self.repo.create_issue( "Issue created by PyGithub" ) - self.assertEqual( issue.number, 28 ) + def testCreateIssue(self): + issue = self.repo.create_issue("Issue created by PyGithub") + self.assertEqual(issue.number, 28) - def testCreateIssueWithAllArguments( self ): - user = self.g.get_user( "jacquev6" ) - milestone = self.repo.get_milestone( 2 ) - question = self.repo.get_label( "Question" ) - issue = self.repo.create_issue( "Issue also created by PyGithub", "Body created by PyGithub", user, milestone, [ question ] ) - self.assertEqual( issue.number, 30 ) + def testCreateIssueWithAllArguments(self): + user = self.g.get_user("jacquev6") + milestone = self.repo.get_milestone(2) + question = self.repo.get_label("Question") + issue = self.repo.create_issue("Issue also created by PyGithub", "Body created by PyGithub", user, milestone, [question]) + self.assertEqual(issue.number, 30) - def testCreateLabel( self ): - label = self.repo.create_label( "Label with silly name % * + created by PyGithub", "00ff00" ) - self.assertEqual( label.color, "00ff00" ) - self.assertEqual( label.name, "Label with silly name % * + created by PyGithub" ) - self.assertEqual( label.url, "https://api.github.com/repos/jacquev6/PyGithub/labels/Label+with+silly+name+%25+%2A+%2B+created+by+PyGithub" ) + def testCreateLabel(self): + label = self.repo.create_label("Label with silly name % * + created by PyGithub", "00ff00") + self.assertEqual(label.color, "00ff00") + self.assertEqual(label.name, "Label with silly name % * + created by PyGithub") + self.assertEqual(label.url, "https://api.github.com/repos/jacquev6/PyGithub/labels/Label+with+silly+name+%25+%2A+%2B+created+by+PyGithub") - def testGetLabel( self ): - label = self.repo.get_label( "Label with silly name % * + created by PyGithub" ) - self.assertEqual( label.color, "00ff00" ) - self.assertEqual( label.name, "Label with silly name % * + created by PyGithub" ) - self.assertEqual( label.url, "https://api.github.com/repos/jacquev6/PyGithub/labels/Label+with+silly+name+%25+%2A+%2B+created+by+PyGithub" ) + def testGetLabel(self): + label = self.repo.get_label("Label with silly name % * + created by PyGithub") + self.assertEqual(label.color, "00ff00") + self.assertEqual(label.name, "Label with silly name % * + created by PyGithub") + self.assertEqual(label.url, "https://api.github.com/repos/jacquev6/PyGithub/labels/Label+with+silly+name+%25+%2A+%2B+created+by+PyGithub") - def testCreateHookWithMinimalParameters( self ): - hook = self.repo.create_hook( "web", { "url": "http://foobar.com" } ) - self.assertEqual( hook.id, 257967 ) + def testCreateHookWithMinimalParameters(self): + hook = self.repo.create_hook("web", {"url": "http://foobar.com"}) + self.assertEqual(hook.id, 257967) - def testCreateHookWithAllParameters( self ): - hook = self.repo.create_hook( "web", { "url": "http://foobar.com" }, [ "fork" ], False ) - self.assertEqual( hook.active, True ) # WTF - self.assertEqual( hook.id, 257993 ) + def testCreateHookWithAllParameters(self): + hook = self.repo.create_hook("web", {"url": "http://foobar.com"}, ["fork"], False) + self.assertEqual(hook.active, True) # WTF + self.assertEqual(hook.id, 257993) - def testCreateDownloadWithMinimalArguments( self ): - download = self.repo.create_download( "Foobar.txt", 1024 ) - self.assertEqual( download.id, 242562 ) + def testCreateDownloadWithMinimalArguments(self): + download = self.repo.create_download("Foobar.txt", 1024) + self.assertEqual(download.id, 242562) - def testCreateDownloadWithAllArguments( self ): - download = self.repo.create_download( "Foobar.txt", 1024, "Download created by PyGithub", "text/richtext" ) - self.assertEqual( download.accesskeyid, "1DWESVTPGHQVTX38V182" ) - self.assertEqual( download.acl, "public-read" ) - self.assertEqual( download.bucket, "github" ) - self.assertEqual( download.content_type, "text/richtext" ) - self.assertEqual( download.created_at, datetime.datetime( 2012, 5, 22, 19, 11, 49 ) ) - self.assertEqual( download.description, "Download created by PyGithub" ) - self.assertEqual( download.download_count, 0 ) - self.assertEqual( download.expirationdate, datetime.datetime( 2112, 5, 22, 19, 11, 49 ) ) - self.assertEqual( download.html_url, "https://github.com/downloads/jacquev6/PyGithub/Foobar.txt" ) - self.assertEqual( download.id, 242556 ) - self.assertEqual( download.mime_type, "text/richtext" ) - self.assertEqual( download.name, "Foobar.txt" ) - self.assertEqual( download.path, "downloads/jacquev6/PyGithub/Foobar.txt" ) - self.assertEqual( download.policy, "ewogICAgJ2V4cGlyYXRpb24nOiAnMjExMi0wNS0yMlQxOToxMTo0OS4wMDBaJywKICAgICdjb25kaXRpb25zJzogWwogICAgICAgIHsnYnVja2V0JzogJ2dpdGh1Yid9LAogICAgICAgIHsna2V5JzogJ2Rvd25sb2Fkcy9qYWNxdWV2Ni9QeUdpdGh1Yi9Gb29iYXIudHh0J30sCiAgICAgICAgeydhY2wnOiAncHVibGljLXJlYWQnfSwKICAgICAgICB7J3N1Y2Nlc3NfYWN0aW9uX3N0YXR1cyc6ICcyMDEnfSwKICAgICAgICBbJ3N0YXJ0cy13aXRoJywgJyRGaWxlbmFtZScsICcnXSwKICAgICAgICBbJ3N0YXJ0cy13aXRoJywgJyRDb250ZW50LVR5cGUnLCAnJ10KICAgIF0KfQ==" ) - self.assertEqual( download.prefix, "downloads/jacquev6/PyGithub" ) - self.assertEqual( download.redirect, False ) - self.assertEqual( download.s3_url, "https://github.s3.amazonaws.com/" ) - self.assertEqual( download.signature, "8FCU/4rgT3ohXfE9N6HO7JgbuK4=" ) - self.assertEqual( download.size, 1024 ) - self.assertEqual( download.url, "https://api.github.com/repos/jacquev6/PyGithub/downloads/242556" ) + def testCreateDownloadWithAllArguments(self): + download = self.repo.create_download("Foobar.txt", 1024, "Download created by PyGithub", "text/richtext") + self.assertEqual(download.accesskeyid, "1DWESVTPGHQVTX38V182") + self.assertEqual(download.acl, "public-read") + self.assertEqual(download.bucket, "github") + self.assertEqual(download.content_type, "text/richtext") + self.assertEqual(download.created_at, datetime.datetime(2012, 5, 22, 19, 11, 49)) + self.assertEqual(download.description, "Download created by PyGithub") + self.assertEqual(download.download_count, 0) + self.assertEqual(download.expirationdate, datetime.datetime(2112, 5, 22, 19, 11, 49)) + self.assertEqual(download.html_url, "https://github.com/downloads/jacquev6/PyGithub/Foobar.txt") + self.assertEqual(download.id, 242556) + self.assertEqual(download.mime_type, "text/richtext") + self.assertEqual(download.name, "Foobar.txt") + self.assertEqual(download.path, "downloads/jacquev6/PyGithub/Foobar.txt") + self.assertEqual(download.policy, "ewogICAgJ2V4cGlyYXRpb24nOiAnMjExMi0wNS0yMlQxOToxMTo0OS4wMDBaJywKICAgICdjb25kaXRpb25zJzogWwogICAgICAgIHsnYnVja2V0JzogJ2dpdGh1Yid9LAogICAgICAgIHsna2V5JzogJ2Rvd25sb2Fkcy9qYWNxdWV2Ni9QeUdpdGh1Yi9Gb29iYXIudHh0J30sCiAgICAgICAgeydhY2wnOiAncHVibGljLXJlYWQnfSwKICAgICAgICB7J3N1Y2Nlc3NfYWN0aW9uX3N0YXR1cyc6ICcyMDEnfSwKICAgICAgICBbJ3N0YXJ0cy13aXRoJywgJyRGaWxlbmFtZScsICcnXSwKICAgICAgICBbJ3N0YXJ0cy13aXRoJywgJyRDb250ZW50LVR5cGUnLCAnJ10KICAgIF0KfQ==") + self.assertEqual(download.prefix, "downloads/jacquev6/PyGithub") + self.assertEqual(download.redirect, False) + self.assertEqual(download.s3_url, "https://github.s3.amazonaws.com/") + self.assertEqual(download.signature, "8FCU/4rgT3ohXfE9N6HO7JgbuK4=") + self.assertEqual(download.size, 1024) + self.assertEqual(download.url, "https://api.github.com/repos/jacquev6/PyGithub/downloads/242556") - def testCreateGitRef( self ): - ref = self.repo.create_git_ref( "refs/heads/BranchCreatedByPyGithub", "4303c5b90e2216d927155e9609436ccb8984c495" ) - self.assertEqual( ref.url, "https://api.github.com/repos/jacquev6/PyGithub/git/refs/heads/BranchCreatedByPyGithub" ) + def testCreateGitRef(self): + ref = self.repo.create_git_ref("refs/heads/BranchCreatedByPyGithub", "4303c5b90e2216d927155e9609436ccb8984c495") + self.assertEqual(ref.url, "https://api.github.com/repos/jacquev6/PyGithub/git/refs/heads/BranchCreatedByPyGithub") - def testCreateGitBlob( self ): - blob = self.repo.create_git_blob( "Blob created by PyGithub", "latin1" ) - self.assertEqual( blob.sha, "5dd930f591cd5188e9ea7200e308ad355182a1d8" ) + def testCreateGitBlob(self): + blob = self.repo.create_git_blob("Blob created by PyGithub", "latin1") + self.assertEqual(blob.sha, "5dd930f591cd5188e9ea7200e308ad355182a1d8") - def testCreateGitTree( self ): + def testCreateGitTree(self): tree = self.repo.create_git_tree( - [ github.InputGitTreeElement( + [github.InputGitTreeElement( "Foobar.txt", "100644", "blob", - content = "File created by PyGithub" - ) ] + content="File created by PyGithub" + )] ) - self.assertEqual( tree.sha, "41cf8c178c636a018d537cb20daae09391efd70b" ) + self.assertEqual(tree.sha, "41cf8c178c636a018d537cb20daae09391efd70b") - def testCreateGitTreeWithBaseTree( self ): - base_tree = self.repo.get_git_tree( "41cf8c178c636a018d537cb20daae09391efd70b" ) + def testCreateGitTreeWithBaseTree(self): + base_tree = self.repo.get_git_tree("41cf8c178c636a018d537cb20daae09391efd70b") tree = self.repo.create_git_tree( - [ github.InputGitTreeElement( + [github.InputGitTreeElement( "Barbaz.txt", "100644", "blob", - content = "File also created by PyGithub" - ) ], + content="File also created by PyGithub" + )], base_tree ) - self.assertEqual( tree.sha, "107139a922f33bab6fbeb9f9eb8787e7f19e0528" ) + self.assertEqual(tree.sha, "107139a922f33bab6fbeb9f9eb8787e7f19e0528") - def testCreateGitTreeWithSha( self ): + def testCreateGitTreeWithSha(self): tree = self.repo.create_git_tree( - [ github.InputGitTreeElement( + [github.InputGitTreeElement( "Barbaz.txt", "100644", "blob", - sha = "5dd930f591cd5188e9ea7200e308ad355182a1d8" - ) ] + sha="5dd930f591cd5188e9ea7200e308ad355182a1d8" + )] ) - self.assertEqual( tree.sha, "fae707821159639589bf94f3fb0a7154ec5d441b" ) + self.assertEqual(tree.sha, "fae707821159639589bf94f3fb0a7154ec5d441b") - def testCreateGitCommit( self ): - tree = self.repo.get_git_tree( "107139a922f33bab6fbeb9f9eb8787e7f19e0528" ) - commit = self.repo.create_git_commit( "Commit created by PyGithub", tree, [] ) - self.assertEqual( commit.sha, "0b820628236ab8bab3890860fc414fa757ca15f4" ) + def testCreateGitCommit(self): + tree = self.repo.get_git_tree("107139a922f33bab6fbeb9f9eb8787e7f19e0528") + commit = self.repo.create_git_commit("Commit created by PyGithub", tree, []) + self.assertEqual(commit.sha, "0b820628236ab8bab3890860fc414fa757ca15f4") - def testCreateGitCommitWithParents( self ): + def testCreateGitCommitWithParents(self): parents = [ - self.repo.get_git_commit( "7248e66831d4ffe09ef1f30a1df59ec0a9331ece" ), - self.repo.get_git_commit( "12d427464f8d91c8e981043a86ba8a2a9e7319ea" ), + self.repo.get_git_commit("7248e66831d4ffe09ef1f30a1df59ec0a9331ece"), + self.repo.get_git_commit("12d427464f8d91c8e981043a86ba8a2a9e7319ea"), ] - tree = self.repo.get_git_tree( "fae707821159639589bf94f3fb0a7154ec5d441b" ) - commit = self.repo.create_git_commit( "Commit created by PyGithub", tree, parents ) - self.assertEqual( commit.sha, "6adf9ea25ff8a8f2a42bcb1c09e42526339037cd" ) + tree = self.repo.get_git_tree("fae707821159639589bf94f3fb0a7154ec5d441b") + commit = self.repo.create_git_commit("Commit created by PyGithub", tree, parents) + self.assertEqual(commit.sha, "6adf9ea25ff8a8f2a42bcb1c09e42526339037cd") - def testCreateGitCommitWithAllArguments( self ): - tree = self.repo.get_git_tree( "107139a922f33bab6fbeb9f9eb8787e7f19e0528" ) - commit = self.repo.create_git_commit( "Commit created by PyGithub", tree, [], github.InputGitAuthor( "John Doe", "j.doe@vincent-jacques.net", "2008-07-09T16:13:30+12:00" ), github.InputGitAuthor( "John Doe", "j.doe@vincent-jacques.net", "2008-07-09T16:13:30+12:00" ) ) - self.assertEqual( commit.sha, "526946197ae9da59c6507cacd13ad6f1cfb686ea" ) + def testCreateGitCommitWithAllArguments(self): + tree = self.repo.get_git_tree("107139a922f33bab6fbeb9f9eb8787e7f19e0528") + commit = self.repo.create_git_commit("Commit created by PyGithub", tree, [], github.InputGitAuthor("John Doe", "j.doe@vincent-jacques.net", "2008-07-09T16:13:30+12:00"), github.InputGitAuthor("John Doe", "j.doe@vincent-jacques.net", "2008-07-09T16:13:30+12:00")) + self.assertEqual(commit.sha, "526946197ae9da59c6507cacd13ad6f1cfb686ea") - def testCreateGitTag( self ): - tag = self.repo.create_git_tag( "TaggedByPyGithub", "Tag created by PyGithub", "0b820628236ab8bab3890860fc414fa757ca15f4", "commit" ) - self.assertEqual( tag.sha, "5ba561eaa2b7ca9015662510157b15d8f3b0232a" ) + def testCreateGitTag(self): + tag = self.repo.create_git_tag("TaggedByPyGithub", "Tag created by PyGithub", "0b820628236ab8bab3890860fc414fa757ca15f4", "commit") + self.assertEqual(tag.sha, "5ba561eaa2b7ca9015662510157b15d8f3b0232a") - def testCreateGitTagWithAllArguments( self ): - tag = self.repo.create_git_tag( "TaggedByPyGithub2", "Tag also created by PyGithub", "526946197ae9da59c6507cacd13ad6f1cfb686ea", "commit", github.InputGitAuthor( "John Doe", "j.doe@vincent-jacques.net", "2008-07-09T16:13:30+12:00" ) ) - self.assertEqual( tag.sha, "f0e99a8335fbc84c53366c4a681118468f266625" ) + def testCreateGitTagWithAllArguments(self): + tag = self.repo.create_git_tag("TaggedByPyGithub2", "Tag also created by PyGithub", "526946197ae9da59c6507cacd13ad6f1cfb686ea", "commit", github.InputGitAuthor("John Doe", "j.doe@vincent-jacques.net", "2008-07-09T16:13:30+12:00")) + self.assertEqual(tag.sha, "f0e99a8335fbc84c53366c4a681118468f266625") - def testCreateKey( self ): - key = self.repo.create_key( "Key added through PyGithub", "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA2Mm0RjTNAYFfSCtUpO54usdseroUSIYg5KX4JoseTpqyiB/hqewjYLAdUq/tNIQzrkoEJWSyZrQt0ma7/YCyMYuNGd3DU6q6ZAyBeY3E9RyCiKjO3aTL2VKQGFvBVVmGdxGVSCITRphAcsKc/PF35/fg9XP9S0anMXcEFtdfMHz41SSw+XtE+Vc+6cX9FuI5qUfLGbkv8L1v3g4uw9VXlzq4GfTA+1S7D6mcoGHopAIXFlVr+2RfDKdSURMcB22z41fljO1MW4+zUS/4FyUTpL991es5fcwKXYoiE+x06VJeJJ1Krwx+DZj45uweV6cHXt2JwJEI9fWB6WyBlDejWw== vincent@IDEE" ) - self.assertEqual( key.id, 2626761 ) + def testCreateKey(self): + key = self.repo.create_key("Key added through PyGithub", "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA2Mm0RjTNAYFfSCtUpO54usdseroUSIYg5KX4JoseTpqyiB/hqewjYLAdUq/tNIQzrkoEJWSyZrQt0ma7/YCyMYuNGd3DU6q6ZAyBeY3E9RyCiKjO3aTL2VKQGFvBVVmGdxGVSCITRphAcsKc/PF35/fg9XP9S0anMXcEFtdfMHz41SSw+XtE+Vc+6cX9FuI5qUfLGbkv8L1v3g4uw9VXlzq4GfTA+1S7D6mcoGHopAIXFlVr+2RfDKdSURMcB22z41fljO1MW4+zUS/4FyUTpL991es5fcwKXYoiE+x06VJeJJ1Krwx+DZj45uweV6cHXt2JwJEI9fWB6WyBlDejWw== vincent@IDEE") + self.assertEqual(key.id, 2626761) - def testCollaborators( self ): - lyloa = self.g.get_user( "Lyloa" ) - self.assertFalse( self.repo.has_in_collaborators( lyloa ) ) - self.repo.add_to_collaborators( lyloa ) - self.assertTrue( self.repo.has_in_collaborators( lyloa ) ) - self.assertListKeyEqual( self.repo.get_collaborators(), lambda u: u.login, [ "jacquev6", "Lyloa" ] ) - self.repo.remove_from_collaborators( lyloa ) - self.assertFalse( self.repo.has_in_collaborators( lyloa ) ) + def testCollaborators(self): + lyloa = self.g.get_user("Lyloa") + self.assertFalse(self.repo.has_in_collaborators(lyloa)) + self.repo.add_to_collaborators(lyloa) + self.assertTrue(self.repo.has_in_collaborators(lyloa)) + self.assertListKeyEqual(self.repo.get_collaborators(), lambda u: u.login, ["jacquev6", "Lyloa"]) + self.repo.remove_from_collaborators(lyloa) + self.assertFalse(self.repo.has_in_collaborators(lyloa)) - def testCompare( self ): - comparison = self.repo.compare( "v0.6", "v0.7" ) - self.assertEqual( comparison.status, "ahead" ) - self.assertEqual( comparison.ahead_by, 4 ) - self.assertEqual( comparison.behind_by, 0 ) - self.assertEqual( comparison.diff_url, "https://github.com/jacquev6/PyGithub/compare/v0.6...v0.7.diff" ) - self.assertEqual( comparison.html_url, "https://github.com/jacquev6/PyGithub/compare/v0.6...v0.7" ) - self.assertEqual( comparison.url, "https://api.github.com/repos/jacquev6/PyGithub/compare/v0.6...v0.7" ) - self.assertEqual( comparison.patch_url, "https://github.com/jacquev6/PyGithub/compare/v0.6...v0.7.patch" ) - self.assertEqual( comparison.permalink_url, "https://github.com/jacquev6/PyGithub/compare/jacquev6:4303c5b...jacquev6:ecda065" ) - self.assertEqual( comparison.total_commits, 4 ) - self.assertListKeyEqual( comparison.files, lambda f: f.filename, [ "ReferenceOfClasses.md", "github/Github.py", "github/Requester.py", "setup.py" ] ) - self.assertEqual( comparison.base_commit.sha, "4303c5b90e2216d927155e9609436ccb8984c495" ) - self.assertListKeyEqual( comparison.commits, lambda c: c.sha, [ "5bb654d26dd014d36794acd1e6ecf3736f12aad7", "cb0313157bf904f2d364377d35d9397b269547a5", "0cec0d25e606c023a62a4fc7cdc815309ebf6d16", "ecda065e01876209d2bdf5fe4e91cee8ffaa9ff7" ] ) + def testCompare(self): + comparison = self.repo.compare("v0.6", "v0.7") + self.assertEqual(comparison.status, "ahead") + self.assertEqual(comparison.ahead_by, 4) + self.assertEqual(comparison.behind_by, 0) + self.assertEqual(comparison.diff_url, "https://github.com/jacquev6/PyGithub/compare/v0.6...v0.7.diff") + self.assertEqual(comparison.html_url, "https://github.com/jacquev6/PyGithub/compare/v0.6...v0.7") + self.assertEqual(comparison.url, "https://api.github.com/repos/jacquev6/PyGithub/compare/v0.6...v0.7") + self.assertEqual(comparison.patch_url, "https://github.com/jacquev6/PyGithub/compare/v0.6...v0.7.patch") + self.assertEqual(comparison.permalink_url, "https://github.com/jacquev6/PyGithub/compare/jacquev6:4303c5b...jacquev6:ecda065") + self.assertEqual(comparison.total_commits, 4) + self.assertListKeyEqual(comparison.files, lambda f: f.filename, ["ReferenceOfClasses.md", "github/Github.py", "github/Requester.py", "setup.py"]) + self.assertEqual(comparison.base_commit.sha, "4303c5b90e2216d927155e9609436ccb8984c495") + self.assertListKeyEqual(comparison.commits, lambda c: c.sha, ["5bb654d26dd014d36794acd1e6ecf3736f12aad7", "cb0313157bf904f2d364377d35d9397b269547a5", "0cec0d25e606c023a62a4fc7cdc815309ebf6d16", "ecda065e01876209d2bdf5fe4e91cee8ffaa9ff7"]) - def testGetComments( self ): + def testGetComments(self): self.assertListKeyEqual( self.repo.get_comments(), lambda c: c.body, @@ -248,158 +249,158 @@ class Repository( Framework.TestCase ): ] ) - def testGetCommits( self ): - self.assertListKeyBegin( self.repo.get_commits(), lambda c: c.sha, [ u'ecda065e01876209d2bdf5fe4e91cee8ffaa9ff7', u'0cec0d25e606c023a62a4fc7cdc815309ebf6d16', u'cb0313157bf904f2d364377d35d9397b269547a5', u'5bb654d26dd014d36794acd1e6ecf3736f12aad7', u'4303c5b90e2216d927155e9609436ccb8984c495', u'2a7e80e6421c5d4d201d60619068dea6bae612cb', u'0af24499a98e85f8ab2191898e8b809e5cebd4c5', u'e5ae923a68a9ae295ce5aa20b1227253de60e918', u'2f64b625f7e2afc9bef61d0decb459e2ef65c550', u'590798d349cba7de6e83b43aa5d4f8b0a38e685d', u'e7dca9143a23b8e2045a4a910a4a329007b10086', u'ab3f9b422cb3043d35cf6002fc9c042f8ead8c2a', u'632d8b63c32a2b79e87eb3b93e1ad228724de4bd', u'64c6a1e975e61b9c1449bed016cd19f33ee4b1c5', u'99963536fc81db3b9986c761b9dd08de22089aa2', u'8d57522bbd15d1fb6b616fae795cd8721deb1c4d', u'1140a91f3e45d09bc15463724f178a7ebf8e3149', u'936f4a97f1a86392637ec002bbf89ff036a5062d', u'e10470481795506e2c232720e2a9ecf588c8b567', u'e456549e5265406f8090ae5145255c8ca9ea5e4e', u'a91131be42eb328ae030f584af500f56aa08424b', u'2469c6e1aeb7919126a8271f6980b555b167e8b0', u'a655d0424135befd3a0d53f3f7eff2d1c754854f', u'ce62e91268aa34dad0ba0dbee4769933e3a71e50', u'1c88ee221b7f995855a1fdfac7d0ba19db918739', u'bd1a5dff3c547c634b2d89f5847218820e343883', u'b226b5b4e2f44107dde674e7a5d3e88d4e3518df', u'25dbd4053e982402c7d92139f167dbe46008c932', u'a0cc821c1beada4aa9ca0d5218664c5372720936', u'c1440bdf20bfeb62684c6d1779448719dce9d2df', u'1095d304b7fab3818dcb4c42093c8c56d3ac05e4', u'bd39726f7cf86ea7ffb33b5718241fdab5fc8f53', u'1d2b27824d20612066d84be42d6691c66bb18ef4', u'6af2bfd0d46bc0eeb8c37b85c7b3003e0e4ae297', u'a475d685d8ae709095d09094ea0962ac182d33f0', u'a85de99ea5b5e7b38bd68e076d09c49207b8687e', u'd24cf209ddd1758188c5f35344f76df818d09a46', u'0909fec395bb1f97e2580d6a029cfc64b352aff9', u'6e421e9e85e12008758870bc046bc2c6120af72a', u'32ed0ebc377efbed5b482b3d49ff54bf1715d55a', u'8213df1d744f251aa8e52229643a9f6ce352f3c0', u'69cc298fd159f19eb204dd09f17d31dc4abc3d41', u'85eef756353e13efcb24c726320cd2617c2a7bd8', u'50ac55b25ceba555b84709839f80447552450697', u'767d75a580279e457f9bc52bc308a17ff8ea0509', u'75e72ffa3066693291f7da03070666e8f885097a', u'504047e218e6b34a3828ccc408431634f17b9504', u'960db1d5c9853e9f5fbbc9237c2c166ceef1f080', u'877dde23e140bbf038f9a2d8f0f07b4e3a965c61', u'1c95ddfa09ec0aa1f07ee9ad50a77be1dd74b55e', u'99564c1cab139d1e4678f5f83f60d26f1210db7e', u'231926207709ceaa61e87b64e34e17d85adecd9c', u'fb722625dddb9a32f75190723f7da12683b7c4b2', u'cab9d71603e127bdd1f600a759dccea1781fa1ab', u'e648e5aeb5edc1fbf83e9d37d2a3cb57c005019a', u'4a5cf98e7f959f1b5d9af484760c25cd27d9180d', u'5d1add448e0b0b1dadb8c6094a9e5e19b255f67e', u'0d9fc99a4b5d1ec6473c9c81c888917c132ffa65', u'b56aa09011378b014221f86dffb8304957a9e6bd', u'3e8169c0a98ce1e2c6a32ae1256ae0f735065df5', u'378558f6cac6183b4a7100c0ce5eaad1cfff6717', u'58b4396aa0e7cb72911b75cb035798143a06e0ee', u'a3be28756101370fbc689eec3a7825c4c385a6c9', u'3d6bd49ce229243fea4bb46a937622d0ec7d4d1c', u'58cb0dbdef9765e0e913c726f923a47315aaf80e', u'7b7ac20c6fa27f72a24483c73ab1bf4deffc89f0', u'97f308e67383368a2d15788cac28e126c8528bb2', u'fc33a6de4f0e08d7ff2de05935517ec3932d212e', u'cc6d0fc044eadf2e6fde5da699f61654c1e691f3', u'2dd71f3777b87f2ba61cb20d2c67f10401e3eb2c', u'366ca58ca004b9129f9d435db8204ce0f5bc57c3', u'0d3b3ffd1e5c143af8725fdee808101f626f683d', u'157f9c13275738b6b39b8d7a874f5f0aee47cb18' ] ) + def testGetCommits(self): + self.assertListKeyBegin(self.repo.get_commits(), lambda c: c.sha, [u'ecda065e01876209d2bdf5fe4e91cee8ffaa9ff7', u'0cec0d25e606c023a62a4fc7cdc815309ebf6d16', u'cb0313157bf904f2d364377d35d9397b269547a5', u'5bb654d26dd014d36794acd1e6ecf3736f12aad7', u'4303c5b90e2216d927155e9609436ccb8984c495', u'2a7e80e6421c5d4d201d60619068dea6bae612cb', u'0af24499a98e85f8ab2191898e8b809e5cebd4c5', u'e5ae923a68a9ae295ce5aa20b1227253de60e918', u'2f64b625f7e2afc9bef61d0decb459e2ef65c550', u'590798d349cba7de6e83b43aa5d4f8b0a38e685d', u'e7dca9143a23b8e2045a4a910a4a329007b10086', u'ab3f9b422cb3043d35cf6002fc9c042f8ead8c2a', u'632d8b63c32a2b79e87eb3b93e1ad228724de4bd', u'64c6a1e975e61b9c1449bed016cd19f33ee4b1c5', u'99963536fc81db3b9986c761b9dd08de22089aa2', u'8d57522bbd15d1fb6b616fae795cd8721deb1c4d', u'1140a91f3e45d09bc15463724f178a7ebf8e3149', u'936f4a97f1a86392637ec002bbf89ff036a5062d', u'e10470481795506e2c232720e2a9ecf588c8b567', u'e456549e5265406f8090ae5145255c8ca9ea5e4e', u'a91131be42eb328ae030f584af500f56aa08424b', u'2469c6e1aeb7919126a8271f6980b555b167e8b0', u'a655d0424135befd3a0d53f3f7eff2d1c754854f', u'ce62e91268aa34dad0ba0dbee4769933e3a71e50', u'1c88ee221b7f995855a1fdfac7d0ba19db918739', u'bd1a5dff3c547c634b2d89f5847218820e343883', u'b226b5b4e2f44107dde674e7a5d3e88d4e3518df', u'25dbd4053e982402c7d92139f167dbe46008c932', u'a0cc821c1beada4aa9ca0d5218664c5372720936', u'c1440bdf20bfeb62684c6d1779448719dce9d2df', u'1095d304b7fab3818dcb4c42093c8c56d3ac05e4', u'bd39726f7cf86ea7ffb33b5718241fdab5fc8f53', u'1d2b27824d20612066d84be42d6691c66bb18ef4', u'6af2bfd0d46bc0eeb8c37b85c7b3003e0e4ae297', u'a475d685d8ae709095d09094ea0962ac182d33f0', u'a85de99ea5b5e7b38bd68e076d09c49207b8687e', u'd24cf209ddd1758188c5f35344f76df818d09a46', u'0909fec395bb1f97e2580d6a029cfc64b352aff9', u'6e421e9e85e12008758870bc046bc2c6120af72a', u'32ed0ebc377efbed5b482b3d49ff54bf1715d55a', u'8213df1d744f251aa8e52229643a9f6ce352f3c0', u'69cc298fd159f19eb204dd09f17d31dc4abc3d41', u'85eef756353e13efcb24c726320cd2617c2a7bd8', u'50ac55b25ceba555b84709839f80447552450697', u'767d75a580279e457f9bc52bc308a17ff8ea0509', u'75e72ffa3066693291f7da03070666e8f885097a', u'504047e218e6b34a3828ccc408431634f17b9504', u'960db1d5c9853e9f5fbbc9237c2c166ceef1f080', u'877dde23e140bbf038f9a2d8f0f07b4e3a965c61', u'1c95ddfa09ec0aa1f07ee9ad50a77be1dd74b55e', u'99564c1cab139d1e4678f5f83f60d26f1210db7e', u'231926207709ceaa61e87b64e34e17d85adecd9c', u'fb722625dddb9a32f75190723f7da12683b7c4b2', u'cab9d71603e127bdd1f600a759dccea1781fa1ab', u'e648e5aeb5edc1fbf83e9d37d2a3cb57c005019a', u'4a5cf98e7f959f1b5d9af484760c25cd27d9180d', u'5d1add448e0b0b1dadb8c6094a9e5e19b255f67e', u'0d9fc99a4b5d1ec6473c9c81c888917c132ffa65', u'b56aa09011378b014221f86dffb8304957a9e6bd', u'3e8169c0a98ce1e2c6a32ae1256ae0f735065df5', u'378558f6cac6183b4a7100c0ce5eaad1cfff6717', u'58b4396aa0e7cb72911b75cb035798143a06e0ee', u'a3be28756101370fbc689eec3a7825c4c385a6c9', u'3d6bd49ce229243fea4bb46a937622d0ec7d4d1c', u'58cb0dbdef9765e0e913c726f923a47315aaf80e', u'7b7ac20c6fa27f72a24483c73ab1bf4deffc89f0', u'97f308e67383368a2d15788cac28e126c8528bb2', u'fc33a6de4f0e08d7ff2de05935517ec3932d212e', u'cc6d0fc044eadf2e6fde5da699f61654c1e691f3', u'2dd71f3777b87f2ba61cb20d2c67f10401e3eb2c', u'366ca58ca004b9129f9d435db8204ce0f5bc57c3', u'0d3b3ffd1e5c143af8725fdee808101f626f683d', u'157f9c13275738b6b39b8d7a874f5f0aee47cb18']) - def testGetCommitsWithArguments( self ): - self.assertListKeyEqual( self.repo.get_commits( "topic/RewriteWithGeneratedCode", "codegen/GenerateCode.py" ), lambda c: c.sha, [ "de386d5dc9cf103c90c4128eeca0e6abdd382065", "5b44982f6111bff2454243869df2e1c3086ccbba", "d6835ff949141957a733c8ddfa147026515ae493", "075d3d961d4614a2a0835d5583248adfc0687a7d", "8956796e7f462a49f499eac52fab901cdb59abdb", "283da5e7de6a4a3b6aaae7045909d70b643ad380", "d631e83b7901b0a0b6061b361130700a79505319" ] ) + def testGetCommitsWithArguments(self): + self.assertListKeyEqual(self.repo.get_commits("topic/RewriteWithGeneratedCode", "codegen/GenerateCode.py"), lambda c: c.sha, ["de386d5dc9cf103c90c4128eeca0e6abdd382065", "5b44982f6111bff2454243869df2e1c3086ccbba", "d6835ff949141957a733c8ddfa147026515ae493", "075d3d961d4614a2a0835d5583248adfc0687a7d", "8956796e7f462a49f499eac52fab901cdb59abdb", "283da5e7de6a4a3b6aaae7045909d70b643ad380", "d631e83b7901b0a0b6061b361130700a79505319"]) - def testGetDownloads( self ): - self.assertListKeyEqual( self.repo.get_downloads(), lambda d: d.id, [ 245143 ] ) + def testGetDownloads(self): + self.assertListKeyEqual(self.repo.get_downloads(), lambda d: d.id, [245143]) - def testGetEvents( self ): - self.assertListKeyBegin( self.repo.get_events(), lambda e: e.type, [ "DownloadEvent", "DownloadEvent", "PushEvent", "IssuesEvent", "MemberEvent", "MemberEvent" ] ) + def testGetEvents(self): + self.assertListKeyBegin(self.repo.get_events(), lambda e: e.type, ["DownloadEvent", "DownloadEvent", "PushEvent", "IssuesEvent", "MemberEvent", "MemberEvent"]) - def testGetForks( self ): - self.assertListKeyEqual( self.repo.get_forks(), lambda r: r.owner.login, [ "abersager" ] ) + def testGetForks(self): + self.assertListKeyEqual(self.repo.get_forks(), lambda r: r.owner.login, ["abersager"]) - def testGetGitRefs( self ): - self.assertListKeyEqual( self.repo.get_git_refs(), lambda r: r.ref, [ "refs/heads/develop", "refs/heads/master", "refs/heads/topic/DependencyGraph", "refs/heads/topic/RewriteWithGeneratedCode", "refs/tags/v0.1", "refs/tags/v0.2", "refs/tags/v0.3", "refs/tags/v0.4", "refs/tags/v0.5", "refs/tags/v0.6", "refs/tags/v0.7" ] ) + def testGetGitRefs(self): + self.assertListKeyEqual(self.repo.get_git_refs(), lambda r: r.ref, ["refs/heads/develop", "refs/heads/master", "refs/heads/topic/DependencyGraph", "refs/heads/topic/RewriteWithGeneratedCode", "refs/tags/v0.1", "refs/tags/v0.2", "refs/tags/v0.3", "refs/tags/v0.4", "refs/tags/v0.5", "refs/tags/v0.6", "refs/tags/v0.7"]) - def testGetGitTreeWithRecursive( self ): - tree = self.repo.get_git_tree( "f492784d8ca837779650d1fb406a1a3587a764ad", True ) - self.assertEqual( len( tree.tree ), 90 ) - self.assertEqual( tree.tree[ 50 ].path, "github/GithubObjects/Gist.py" ) + def testGetGitTreeWithRecursive(self): + tree = self.repo.get_git_tree("f492784d8ca837779650d1fb406a1a3587a764ad", True) + self.assertEqual(len(tree.tree), 90) + self.assertEqual(tree.tree[50].path, "github/GithubObjects/Gist.py") - def testGetHooks( self ): - self.assertListKeyEqual( self.repo.get_hooks(), lambda h: h.id, [ 257993 ] ) + def testGetHooks(self): + self.assertListKeyEqual(self.repo.get_hooks(), lambda h: h.id, [257993]) - def testGetIssues( self ): - self.assertListKeyEqual( self.repo.get_issues(), lambda i: i.id, [ 4769659, 4639931, 4452000, 4356743, 3716033, 3715946, 3643837, 3628022, 3624595, 3624570, 3624561, 3624556, 3619973, 3527266, 3527245, 3527231 ] ) + def testGetIssues(self): + self.assertListKeyEqual(self.repo.get_issues(), lambda i: i.id, [4769659, 4639931, 4452000, 4356743, 3716033, 3715946, 3643837, 3628022, 3624595, 3624570, 3624561, 3624556, 3619973, 3527266, 3527245, 3527231]) - def testGetIssuesWithArguments( self ): - milestone = self.repo.get_milestone( 3 ) - user = self.g.get_user( "jacquev6" ) - otherUser = self.g.get_user( "Lyloa" ) - bug = self.repo.get_label( "Bug" ) - self.assertListKeyEqual( self.repo.get_issues( milestone, "closed" ), lambda i: i.id, [ 3624472, 3620132, 3619658, 3561926 ] ) - self.assertListKeyEqual( self.repo.get_issues( labels = [ bug ] ), lambda i: i.id, [ 4780155 ] ) - self.assertListKeyEqual( self.repo.get_issues( assignee = user, sort = "comments", direction = "asc" ), lambda i: i.id, [ 4793106, 3527231, 3527266, 3624556, 4793216, 3619973, 3624595, 4452000, 3643837, 3628022, 3527245, 4793162, 4356743, 4780155 ] ) - self.assertListKeyEqual( self.repo.get_issues( since = datetime.datetime( 2012, 5, 28, 23, 0, 0 ) ), lambda i: i.id, [ 4793216, 4793162, 4793106, 3624556, 3619973, 3527266 ] ) - self.assertListKeyEqual( self.repo.get_issues( mentioned = otherUser ), lambda i: i.id, [ 4793162 ] ) + def testGetIssuesWithArguments(self): + milestone = self.repo.get_milestone(3) + user = self.g.get_user("jacquev6") + otherUser = self.g.get_user("Lyloa") + bug = self.repo.get_label("Bug") + self.assertListKeyEqual(self.repo.get_issues(milestone, "closed"), lambda i: i.id, [3624472, 3620132, 3619658, 3561926]) + self.assertListKeyEqual(self.repo.get_issues(labels=[bug]), lambda i: i.id, [4780155]) + self.assertListKeyEqual(self.repo.get_issues(assignee=user, sort="comments", direction="asc"), lambda i: i.id, [4793106, 3527231, 3527266, 3624556, 4793216, 3619973, 3624595, 4452000, 3643837, 3628022, 3527245, 4793162, 4356743, 4780155]) + self.assertListKeyEqual(self.repo.get_issues(since=datetime.datetime(2012, 5, 28, 23, 0, 0)), lambda i: i.id, [4793216, 4793162, 4793106, 3624556, 3619973, 3527266]) + self.assertListKeyEqual(self.repo.get_issues(mentioned=otherUser), lambda i: i.id, [4793162]) - def testGetIssuesWithWildcards( self ): - self.assertListKeyEqual( self.repo.get_issues( milestone = "*" ), lambda i: i.id, [ 4809786, 4793216, 4789817, 4452000, 3628022, 3624595, 3619973, 3527231 ] ) - self.assertListKeyEqual( self.repo.get_issues( milestone = "none" ), lambda i: i.id, [ 4823331, 4809803, 4809778, 4793106, 3643837, 3527245 ] ) - self.assertListKeyEqual( self.repo.get_issues( assignee = "*" ), lambda i: i.id, [ 4823331, 4809803, 4809786, 4809778, 4793216, 4793106, 4789817, 4452000, 3643837, 3628022, 3624595, 3527245, 3527231 ] ) - self.assertListKeyEqual( self.repo.get_issues( assignee = "none" ), lambda i: i.id, [ 3619973 ] ) + def testGetIssuesWithWildcards(self): + self.assertListKeyEqual(self.repo.get_issues(milestone="*"), lambda i: i.id, [4809786, 4793216, 4789817, 4452000, 3628022, 3624595, 3619973, 3527231]) + self.assertListKeyEqual(self.repo.get_issues(milestone="none"), lambda i: i.id, [4823331, 4809803, 4809778, 4793106, 3643837, 3527245]) + self.assertListKeyEqual(self.repo.get_issues(assignee="*"), lambda i: i.id, [4823331, 4809803, 4809786, 4809778, 4793216, 4793106, 4789817, 4452000, 3643837, 3628022, 3624595, 3527245, 3527231]) + self.assertListKeyEqual(self.repo.get_issues(assignee="none"), lambda i: i.id, [3619973]) - def testGetKeys( self ): - self.assertListKeyEqual( self.repo.get_keys(), lambda k: k.title, [ "Key added through PyGithub" ] ) + def testGetKeys(self): + self.assertListKeyEqual(self.repo.get_keys(), lambda k: k.title, ["Key added through PyGithub"]) - def testGetLabels( self ): - self.assertListKeyEqual( self.repo.get_labels(), lambda l: l.name, [ "Refactoring", "Public interface", "Functionalities", "Project management", "Bug", "Question" ] ) + def testGetLabels(self): + self.assertListKeyEqual(self.repo.get_labels(), lambda l: l.name, ["Refactoring", "Public interface", "Functionalities", "Project management", "Bug", "Question"]) - def testGetLanguages( self ): - self.assertEqual( self.repo.get_languages(), { "Python": 127266, "Shell": 673} ) + def testGetLanguages(self): + self.assertEqual(self.repo.get_languages(), {"Python": 127266, "Shell": 673}) - def testGetMilestones( self ): - self.assertListKeyEqual( self.repo.get_milestones(), lambda m: m.id, [ 93547 ] ) + def testGetMilestones(self): + self.assertListKeyEqual(self.repo.get_milestones(), lambda m: m.id, [93547]) - def testGetMilestonesWithArguments( self ): - self.assertListKeyEqual( self.repo.get_milestones( "closed", "due_date", "asc" ), lambda m: m.id, [ 93546, 95354, 108652, 124045 ] ) + def testGetMilestonesWithArguments(self): + self.assertListKeyEqual(self.repo.get_milestones("closed", "due_date", "asc"), lambda m: m.id, [93546, 95354, 108652, 124045]) - def testGetIssuesEvents( self ): - self.assertListKeyBegin( self.repo.get_issues_events(), lambda e: e.event, [ "assigned", "subscribed", "closed", "assigned", "closed" ] ) + def testGetIssuesEvents(self): + self.assertListKeyBegin(self.repo.get_issues_events(), lambda e: e.event, ["assigned", "subscribed", "closed", "assigned", "closed"]) - def testGetNetworkEvents( self ): - self.assertListKeyBegin( self.repo.get_network_events(), lambda e: e.type, [ "DownloadEvent", "DownloadEvent", "PushEvent", "IssuesEvent", "MemberEvent" ] ) + def testGetNetworkEvents(self): + self.assertListKeyBegin(self.repo.get_network_events(), lambda e: e.type, ["DownloadEvent", "DownloadEvent", "PushEvent", "IssuesEvent", "MemberEvent"]) - def testGetTeams( self ): - repo = self.g.get_organization( "BeaverSoftware" ).get_repo( "FatherBeaver" ) - self.assertListKeyEqual( repo.get_teams(), lambda t: t.name, [ "Members" ] ) + def testGetTeams(self): + repo = self.g.get_organization("BeaverSoftware").get_repo("FatherBeaver") + self.assertListKeyEqual(repo.get_teams(), lambda t: t.name, ["Members"]) - def testGetWatchers( self ): - self.assertListKeyEqual( self.repo.get_watchers(), lambda u: u.login, [ "Stals", "att14", "jardon-u", "huxley", "mikofski", "L42y", "fanzeyi", "abersager", "waylan", "adericbourg", "tallforasmurf", "pvicente", "roskakori", "michaelpedersen", "BeaverSoftware" ] ) + def testGetWatchers(self): + self.assertListKeyEqual(self.repo.get_watchers(), lambda u: u.login, ["Stals", "att14", "jardon-u", "huxley", "mikofski", "L42y", "fanzeyi", "abersager", "waylan", "adericbourg", "tallforasmurf", "pvicente", "roskakori", "michaelpedersen", "BeaverSoftware"]) - def testGetStargazers( self ): - self.assertListKeyEqual( self.repo.get_stargazers(), lambda u: u.login, [ "Stals", "att14", "jardon-u", "huxley", "mikofski", "L42y", "fanzeyi", "abersager", "waylan", "adericbourg", "tallforasmurf", "pvicente", "roskakori", "michaelpedersen", "stefanfoulis", "equus12", "JuRogn", "joshmoore", "jsilter", "dasapich", "ritratt", "hcilab", "vxnick", "pmuilu", "herlo", "malexw", "ahmetvurgun", "PengGu", "cosmin", "Swop", "kennethreitz", "bryandyck", "jason2506", "zsiciarz", "waawal", "gregorynicholas", "sente", "richmiller55", "thouis", "mazubieta", "michaelhood", "engie", "jtriley", "oangeor", "coryking", "noddi", "alejo8591", "omab", "Carreau", "bilderbuchi", "schwa", "rlerallut", "PengHub", "zoek1", "xobb1t", "notgary", "hattya", "ZebtinRis", "aaronhall", "youngsterxyf", "ailling", "gregwjacobs", "n0rmrx", "awylie", "firstthumb", "joshbrand", "berndca" ] ) + def testGetStargazers(self): + self.assertListKeyEqual(self.repo.get_stargazers(), lambda u: u.login, ["Stals", "att14", "jardon-u", "huxley", "mikofski", "L42y", "fanzeyi", "abersager", "waylan", "adericbourg", "tallforasmurf", "pvicente", "roskakori", "michaelpedersen", "stefanfoulis", "equus12", "JuRogn", "joshmoore", "jsilter", "dasapich", "ritratt", "hcilab", "vxnick", "pmuilu", "herlo", "malexw", "ahmetvurgun", "PengGu", "cosmin", "Swop", "kennethreitz", "bryandyck", "jason2506", "zsiciarz", "waawal", "gregorynicholas", "sente", "richmiller55", "thouis", "mazubieta", "michaelhood", "engie", "jtriley", "oangeor", "coryking", "noddi", "alejo8591", "omab", "Carreau", "bilderbuchi", "schwa", "rlerallut", "PengHub", "zoek1", "xobb1t", "notgary", "hattya", "ZebtinRis", "aaronhall", "youngsterxyf", "ailling", "gregwjacobs", "n0rmrx", "awylie", "firstthumb", "joshbrand", "berndca"]) - def testGetSubscribers( self ): - self.assertListKeyEqual( self.repo.get_subscribers(), lambda u: u.login, [ "jacquev6", "equus12", "bilderbuchi", "hcilab", "hattya", "firstthumb", "gregwjacobs", "sagarsane", "liang456", "berndca", "Lyloa" ] ) + def testGetSubscribers(self): + self.assertListKeyEqual(self.repo.get_subscribers(), lambda u: u.login, ["jacquev6", "equus12", "bilderbuchi", "hcilab", "hattya", "firstthumb", "gregwjacobs", "sagarsane", "liang456", "berndca", "Lyloa"]) - def testCreatePull( self ): - pull = self.repo.create_pull( "Pull request created by PyGithub", "Body of the pull request", "topic/RewriteWithGeneratedCode", "BeaverSoftware:master" ) - self.assertEqual( pull.id, 1436215 ) + def testCreatePull(self): + pull = self.repo.create_pull("Pull request created by PyGithub", "Body of the pull request", "topic/RewriteWithGeneratedCode", "BeaverSoftware:master") + self.assertEqual(pull.id, 1436215) - def testCreatePullFromIssue( self ): - issue = self.repo.get_issue( 32 ) - pull = self.repo.create_pull( issue, "topic/RewriteWithGeneratedCode", "BeaverSoftware:master" ) - self.assertEqual( pull.id, 1436310 ) + def testCreatePullFromIssue(self): + issue = self.repo.get_issue(32) + pull = self.repo.create_pull(issue, "topic/RewriteWithGeneratedCode", "BeaverSoftware:master") + self.assertEqual(pull.id, 1436310) - def testGetPulls( self ): - self.assertListKeyEqual( self.repo.get_pulls(), lambda p: p.id, [ 1436310 ] ) + def testGetPulls(self): + self.assertListKeyEqual(self.repo.get_pulls(), lambda p: p.id, [1436310]) - def testGetPullsWithArguments( self ): - self.assertListKeyEqual( self.repo.get_pulls( "closed" ), lambda p: p.id, [ 1448168, 1436310, 1436215 ] ) + def testGetPullsWithArguments(self): + self.assertListKeyEqual(self.repo.get_pulls("closed"), lambda p: p.id, [1448168, 1436310, 1436215]) - def testLegacySearchIssues( self ): - issues = self.repo.legacy_search_issues( "open", "search" ) - self.assertListKeyEqual( issues, lambda i: i.title, [ "Support new Search API" ] ) + def testLegacySearchIssues(self): + issues = self.repo.legacy_search_issues("open", "search") + self.assertListKeyEqual(issues, lambda i: i.title, ["Support new Search API"]) # Attributes retrieved from legacy API without lazy completion call - self.assertEqual( issues[ 0 ].number, 49 ) - self.assertEqual( issues[ 0 ].created_at, datetime.datetime( 2012, 6, 21, 12, 27, 38 ) ) - self.assertEqual( issues[ 0 ].comments, 4 ) - self.assertEqual( issues[ 0 ].body[ : 20 ], "New API ported from " ) - self.assertEqual( issues[ 0 ].title, "Support new Search API" ) - self.assertEqual( issues[ 0 ].updated_at, datetime.datetime( 2012, 6, 28, 21, 13, 25 ) ) - self.assertEqual( issues[ 0 ].user.login, "kukuts" ) - self.assertEqual( issues[ 0 ].user.url, "/users/kukuts" ) - self.assertListKeyEqual( issues[ 0 ].labels, lambda l: l.name, [ "Functionalities", "RequestedByUser" ] ) - self.assertEqual( issues[ 0 ].state, "open" ) + self.assertEqual(issues[0].number, 49) + self.assertEqual(issues[0].created_at, datetime.datetime(2012, 6, 21, 12, 27, 38)) + self.assertEqual(issues[0].comments, 4) + self.assertEqual(issues[0].body[: 20], "New API ported from ") + self.assertEqual(issues[0].title, "Support new Search API") + self.assertEqual(issues[0].updated_at, datetime.datetime(2012, 6, 28, 21, 13, 25)) + self.assertEqual(issues[0].user.login, "kukuts") + self.assertEqual(issues[0].user.url, "/users/kukuts") + self.assertListKeyEqual(issues[0].labels, lambda l: l.name, ["Functionalities", "RequestedByUser"]) + self.assertEqual(issues[0].state, "open") - def testAssignees( self ): - lyloa = self.g.get_user( "Lyloa" ) - jacquev6 = self.g.get_user( "jacquev6" ) - self.assertTrue( self.repo.has_in_assignees( jacquev6 ) ) - self.assertFalse( self.repo.has_in_assignees( lyloa ) ) - self.repo.add_to_collaborators( lyloa ) - self.assertTrue( self.repo.has_in_assignees( lyloa ) ) - self.assertListKeyEqual( self.repo.get_assignees(), lambda u: u.login, [ "jacquev6", "Lyloa" ] ) - self.repo.remove_from_collaborators( lyloa ) - self.assertFalse( self.repo.has_in_assignees( lyloa ) ) + def testAssignees(self): + lyloa = self.g.get_user("Lyloa") + jacquev6 = self.g.get_user("jacquev6") + self.assertTrue(self.repo.has_in_assignees(jacquev6)) + self.assertFalse(self.repo.has_in_assignees(lyloa)) + self.repo.add_to_collaborators(lyloa) + self.assertTrue(self.repo.has_in_assignees(lyloa)) + self.assertListKeyEqual(self.repo.get_assignees(), lambda u: u.login, ["jacquev6", "Lyloa"]) + self.repo.remove_from_collaborators(lyloa) + self.assertFalse(self.repo.has_in_assignees(lyloa)) - def testGetContents( self ): - self.assertEqual( len( self.repo.get_readme().content ), 10212 ) - self.assertEqual( len( self.repo.get_contents( "doc/ReferenceOfClasses.md" ).content ), 38121 ) + def testGetContents(self): + self.assertEqual(len(self.repo.get_readme().content), 10212) + self.assertEqual(len(self.repo.get_contents("doc/ReferenceOfClasses.md").content), 38121) - def testGetArchiveLink( self ): - self.assertEqual( self.repo.get_archive_link( "tarball" ), "https://nodeload.github.com/jacquev6/PyGithub/tarball/master" ) - self.assertEqual( self.repo.get_archive_link( "zipball" ), "https://nodeload.github.com/jacquev6/PyGithub/zipball/master" ) - self.assertEqual( self.repo.get_archive_link( "zipball", "master" ), "https://nodeload.github.com/jacquev6/PyGithub/zipball/master" ) - self.assertEqual( self.repo.get_archive_link( "tarball", "develop" ), "https://nodeload.github.com/jacquev6/PyGithub/tarball/develop" ) + def testGetArchiveLink(self): + self.assertEqual(self.repo.get_archive_link("tarball"), "https://nodeload.github.com/jacquev6/PyGithub/tarball/master") + self.assertEqual(self.repo.get_archive_link("zipball"), "https://nodeload.github.com/jacquev6/PyGithub/zipball/master") + self.assertEqual(self.repo.get_archive_link("zipball", "master"), "https://nodeload.github.com/jacquev6/PyGithub/zipball/master") + self.assertEqual(self.repo.get_archive_link("tarball", "develop"), "https://nodeload.github.com/jacquev6/PyGithub/tarball/develop") - def testGetBranch( self ): - branch = self.repo.get_branch( "develop" ) - self.assertEqual( branch.commit.sha, "03058a36164d2a7d946db205f25538434fa27d94" ) + def testGetBranch(self): + branch = self.repo.get_branch("develop") + self.assertEqual(branch.commit.sha, "03058a36164d2a7d946db205f25538434fa27d94") - def testMergeWithoutMessage( self ): - commit = self.repo.merge( "branchForBase", "branchForHead" ) - self.assertEqual( commit.commit.message, "Merge branchForHead into branchForBase" ) + def testMergeWithoutMessage(self): + commit = self.repo.merge("branchForBase", "branchForHead") + self.assertEqual(commit.commit.message, "Merge branchForHead into branchForBase") - def testMergeWithMessage( self ): - commit = self.repo.merge( "branchForBase", "branchForHead", "Commit message created by PyGithub" ) - self.assertEqual( commit.commit.message, "Commit message created by PyGithub" ) + def testMergeWithMessage(self): + commit = self.repo.merge("branchForBase", "branchForHead", "Commit message created by PyGithub") + self.assertEqual(commit.commit.message, "Commit message created by PyGithub") - def testMergeWithNothingToDo( self ): - commit = self.repo.merge( "branchForBase", "branchForHead", "Commit message created by PyGithub" ) - self.assertEqual( commit, None ) + def testMergeWithNothingToDo(self): + commit = self.repo.merge("branchForBase", "branchForHead", "Commit message created by PyGithub") + self.assertEqual(commit, None) - def testMergeWithConflict( self ): + def testMergeWithConflict(self): try: - commit = self.repo.merge( "branchForBase", "branchForHead" ) - self.fail( "Should have raised" ) + commit = self.repo.merge("branchForBase", "branchForHead") + self.fail("Should have raised") except github.GithubException, exception: - self.assertEqual( exception.status, 409 ) - self.assertEqual( exception.data, { "message": "Merge conflict" } ) + self.assertEqual(exception.status, 409) + self.assertEqual(exception.data, {"message": "Merge conflict"}) diff --git a/github/tests/RepositoryKey.py b/github/tests/RepositoryKey.py index 118df084..bfc82936 100644 --- a/github/tests/RepositoryKey.py +++ b/github/tests/RepositoryKey.py @@ -13,25 +13,26 @@ import Framework -class RepositoryKey( Framework.TestCase ): - def setUp( self ): - Framework.TestCase.setUp( self ) - self.key = self.g.get_user().get_repo( "PyGithub" ).get_key( 2626761 ) - def testAttributes( self ): - self.assertEqual( self.key.id, 2626761 ) - self.assertEqual( self.key.key, "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA2Mm0RjTNAYFfSCtUpO54usdseroUSIYg5KX4JoseTpqyiB/hqewjYLAdUq/tNIQzrkoEJWSyZrQt0ma7/YCyMYuNGd3DU6q6ZAyBeY3E9RyCiKjO3aTL2VKQGFvBVVmGdxGVSCITRphAcsKc/PF35/fg9XP9S0anMXcEFtdfMHz41SSw+XtE+Vc+6cX9FuI5qUfLGbkv8L1v3g4uw9VXlzq4GfTA+1S7D6mcoGHopAIXFlVr+2RfDKdSURMcB22z41fljO1MW4+zUS/4FyUTpL991es5fcwKXYoiE+x06VJeJJ1Krwx+DZj45uweV6cHXt2JwJEI9fWB6WyBlDejWw==" ) - self.assertEqual( self.key.title, "Key added through PyGithub" ) - self.assertEqual( self.key.url, "https://api.github.com/user/keys/2626761" ) - self.assertEqual( self.key.verified, True ) +class RepositoryKey(Framework.TestCase): + def setUp(self): + Framework.TestCase.setUp(self) + self.key = self.g.get_user().get_repo("PyGithub").get_key(2626761) - def testEdit( self ): - self.key.edit( "Title edited by PyGithub", "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA5Q58YmzZjU64prR5Pk91MfeHezOTgLqDYmepYbv3qjguiHtPai1vSai5WvUv3hgf9DArXsXE5CV6yoBIhAdGtpJKExHuQ2m4XTFCdbrgfQ3ypcSdgzEiQemyTA6TWwhbuwjJ1IqJMYOVLH+FBCkD8pyIpUDO7v3vaR2TCEuNwOS7lbsRsW3OkGYnUKjaPaCTe/inrqb7I3OE8cPhWJ3dM/zzzBj22J4LCNKhjKua8TFS74xGm3lNDZ6/twQl4n4xmrH/3tG+WOJicNO3JohNHqK9T0pILnr3epEyfdkBjcG0qXApqWvH2WipJhaH6of8Gdr0Z/K/7p8QFddmwNgdPQ==" ) - self.assertEqual( self.key.key, "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA5Q58YmzZjU64prR5Pk91MfeHezOTgLqDYmepYbv3qjguiHtPai1vSai5WvUv3hgf9DArXsXE5CV6yoBIhAdGtpJKExHuQ2m4XTFCdbrgfQ3ypcSdgzEiQemyTA6TWwhbuwjJ1IqJMYOVLH+FBCkD8pyIpUDO7v3vaR2TCEuNwOS7lbsRsW3OkGYnUKjaPaCTe/inrqb7I3OE8cPhWJ3dM/zzzBj22J4LCNKhjKua8TFS74xGm3lNDZ6/twQl4n4xmrH/3tG+WOJicNO3JohNHqK9T0pILnr3epEyfdkBjcG0qXApqWvH2WipJhaH6of8Gdr0Z/K/7p8QFddmwNgdPQ==" ) - self.assertEqual( self.key.title, "Title edited by PyGithub" ) + def testAttributes(self): + self.assertEqual(self.key.id, 2626761) + self.assertEqual(self.key.key, "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA2Mm0RjTNAYFfSCtUpO54usdseroUSIYg5KX4JoseTpqyiB/hqewjYLAdUq/tNIQzrkoEJWSyZrQt0ma7/YCyMYuNGd3DU6q6ZAyBeY3E9RyCiKjO3aTL2VKQGFvBVVmGdxGVSCITRphAcsKc/PF35/fg9XP9S0anMXcEFtdfMHz41SSw+XtE+Vc+6cX9FuI5qUfLGbkv8L1v3g4uw9VXlzq4GfTA+1S7D6mcoGHopAIXFlVr+2RfDKdSURMcB22z41fljO1MW4+zUS/4FyUTpL991es5fcwKXYoiE+x06VJeJJ1Krwx+DZj45uweV6cHXt2JwJEI9fWB6WyBlDejWw==") + self.assertEqual(self.key.title, "Key added through PyGithub") + self.assertEqual(self.key.url, "https://api.github.com/user/keys/2626761") + self.assertEqual(self.key.verified, True) - def testEditWithoutParameters( self ): + def testEdit(self): + self.key.edit("Title edited by PyGithub", "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA5Q58YmzZjU64prR5Pk91MfeHezOTgLqDYmepYbv3qjguiHtPai1vSai5WvUv3hgf9DArXsXE5CV6yoBIhAdGtpJKExHuQ2m4XTFCdbrgfQ3ypcSdgzEiQemyTA6TWwhbuwjJ1IqJMYOVLH+FBCkD8pyIpUDO7v3vaR2TCEuNwOS7lbsRsW3OkGYnUKjaPaCTe/inrqb7I3OE8cPhWJ3dM/zzzBj22J4LCNKhjKua8TFS74xGm3lNDZ6/twQl4n4xmrH/3tG+WOJicNO3JohNHqK9T0pILnr3epEyfdkBjcG0qXApqWvH2WipJhaH6of8Gdr0Z/K/7p8QFddmwNgdPQ==") + self.assertEqual(self.key.key, "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA5Q58YmzZjU64prR5Pk91MfeHezOTgLqDYmepYbv3qjguiHtPai1vSai5WvUv3hgf9DArXsXE5CV6yoBIhAdGtpJKExHuQ2m4XTFCdbrgfQ3ypcSdgzEiQemyTA6TWwhbuwjJ1IqJMYOVLH+FBCkD8pyIpUDO7v3vaR2TCEuNwOS7lbsRsW3OkGYnUKjaPaCTe/inrqb7I3OE8cPhWJ3dM/zzzBj22J4LCNKhjKua8TFS74xGm3lNDZ6/twQl4n4xmrH/3tG+WOJicNO3JohNHqK9T0pILnr3epEyfdkBjcG0qXApqWvH2WipJhaH6of8Gdr0Z/K/7p8QFddmwNgdPQ==") + self.assertEqual(self.key.title, "Title edited by PyGithub") + + def testEditWithoutParameters(self): self.key.edit() - def testDelete( self ): + def testDelete(self): self.key.delete() diff --git a/github/tests/Tag.py b/github/tests/Tag.py index cee1e060..9421d343 100644 --- a/github/tests/Tag.py +++ b/github/tests/Tag.py @@ -13,13 +13,14 @@ import Framework -class Tag( Framework.TestCase ): - def setUp( self ): - Framework.TestCase.setUp( self ) - self.tag = self.g.get_user().get_repo( "PyGithub" ).get_tags()[ 0 ] - def testAttributes( self ): - self.assertEqual( self.tag.commit.sha, "636e6112deb72277b3bffcc3303cd7e8a7431a5d" ) - self.assertEqual( self.tag.name, "v0.3" ) - self.assertEqual( self.tag.tarball_url, "https://github.com/jacquev6/PyGithub/tarball/v0.3" ) - self.assertEqual( self.tag.zipball_url, "https://github.com/jacquev6/PyGithub/zipball/v0.3" ) +class Tag(Framework.TestCase): + def setUp(self): + Framework.TestCase.setUp(self) + self.tag = self.g.get_user().get_repo("PyGithub").get_tags()[0] + + def testAttributes(self): + self.assertEqual(self.tag.commit.sha, "636e6112deb72277b3bffcc3303cd7e8a7431a5d") + self.assertEqual(self.tag.name, "v0.3") + self.assertEqual(self.tag.tarball_url, "https://github.com/jacquev6/PyGithub/tarball/v0.3") + self.assertEqual(self.tag.zipball_url, "https://github.com/jacquev6/PyGithub/zipball/v0.3") diff --git a/github/tests/Team.py b/github/tests/Team.py index 10b622a8..c2469886 100644 --- a/github/tests/Team.py +++ b/github/tests/Team.py @@ -13,50 +13,51 @@ import Framework -class Team( Framework.TestCase ): - def setUp( self ): - Framework.TestCase.setUp( self ) - self.org = self.g.get_organization( "BeaverSoftware" ) - self.team = self.org.get_team( 189850 ) - def testAttributes( self ): - self.assertEqual( self.team.id, 189850 ) - self.assertEqual( self.team.members_count, 0 ) - self.assertEqual( self.team.name, "Team created by PyGithub" ) - self.assertEqual( self.team.permission, "pull" ) - self.assertEqual( self.team.repos_count, 0 ) - self.assertEqual( self.team.url, "https://api.github.com/teams/189850" ) +class Team(Framework.TestCase): + def setUp(self): + Framework.TestCase.setUp(self) + self.org = self.g.get_organization("BeaverSoftware") + self.team = self.org.get_team(189850) - def testMembers( self ): - user = self.g.get_user( "jacquev6" ) - self.assertListKeyEqual( self.team.get_members(), lambda u: u.login, [] ) - self.assertFalse( self.team.has_in_members( user ) ) - self.team.add_to_members( user ) - self.assertListKeyEqual( self.team.get_members(), lambda u: u.login, [ "jacquev6" ] ) - self.assertTrue( self.team.has_in_members( user ) ) - self.team.remove_from_members( user ) - self.assertListKeyEqual( self.team.get_members(), lambda u: u.login, [] ) - self.assertFalse( self.team.has_in_members( user ) ) + def testAttributes(self): + self.assertEqual(self.team.id, 189850) + self.assertEqual(self.team.members_count, 0) + self.assertEqual(self.team.name, "Team created by PyGithub") + self.assertEqual(self.team.permission, "pull") + self.assertEqual(self.team.repos_count, 0) + self.assertEqual(self.team.url, "https://api.github.com/teams/189850") - def testRepos( self ): - repo = self.org.get_repo( "FatherBeaver" ) - self.assertListKeyEqual( self.team.get_repos(), lambda r: r.name, [] ) - self.assertFalse( self.team.has_in_repos( repo ) ) - self.team.add_to_repos( repo ) - self.assertListKeyEqual( self.team.get_repos(), lambda r: r.name, [ "FatherBeaver" ] ) - self.assertTrue( self.team.has_in_repos( repo ) ) - self.team.remove_from_repos( repo ) - self.assertListKeyEqual( self.team.get_repos(), lambda r: r.name, [] ) - self.assertFalse( self.team.has_in_repos( repo ) ) + def testMembers(self): + user = self.g.get_user("jacquev6") + self.assertListKeyEqual(self.team.get_members(), lambda u: u.login, []) + self.assertFalse(self.team.has_in_members(user)) + self.team.add_to_members(user) + self.assertListKeyEqual(self.team.get_members(), lambda u: u.login, ["jacquev6"]) + self.assertTrue(self.team.has_in_members(user)) + self.team.remove_from_members(user) + self.assertListKeyEqual(self.team.get_members(), lambda u: u.login, []) + self.assertFalse(self.team.has_in_members(user)) - def testEditWithoutArguments( self ): - self.team.edit( "Name edited by PyGithub" ) - self.assertEqual( self.team.name, "Name edited by PyGithub" ) + def testRepos(self): + repo = self.org.get_repo("FatherBeaver") + self.assertListKeyEqual(self.team.get_repos(), lambda r: r.name, []) + self.assertFalse(self.team.has_in_repos(repo)) + self.team.add_to_repos(repo) + self.assertListKeyEqual(self.team.get_repos(), lambda r: r.name, ["FatherBeaver"]) + self.assertTrue(self.team.has_in_repos(repo)) + self.team.remove_from_repos(repo) + self.assertListKeyEqual(self.team.get_repos(), lambda r: r.name, []) + self.assertFalse(self.team.has_in_repos(repo)) - def testEditWithAllArguments( self ): - self.team.edit( "Name edited twice by PyGithub", "admin" ) - self.assertEqual( self.team.name, "Name edited twice by PyGithub" ) - self.assertEqual( self.team.permission, "admin" ) + def testEditWithoutArguments(self): + self.team.edit("Name edited by PyGithub") + self.assertEqual(self.team.name, "Name edited by PyGithub") - def testDelete( self ): + def testEditWithAllArguments(self): + self.team.edit("Name edited twice by PyGithub", "admin") + self.assertEqual(self.team.name, "Name edited twice by PyGithub") + self.assertEqual(self.team.permission, "admin") + + def testDelete(self): self.team.delete() diff --git a/github/tests/UserKey.py b/github/tests/UserKey.py index 948f7c04..6b4306b5 100644 --- a/github/tests/UserKey.py +++ b/github/tests/UserKey.py @@ -13,25 +13,26 @@ import Framework -class UserKey( Framework.TestCase ): - def setUp( self ): - Framework.TestCase.setUp( self ) - self.key = self.g.get_user().get_key( 2626650 ) - def testAttributes( self ): - self.assertEqual( self.key.id, 2626650 ) - self.assertEqual( self.key.key, "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA2Mm0RjTNAYFfSCtUpO54usdseroUSIYg5KX4JoseTpqyiB/hqewjYLAdUq/tNIQzrkoEJWSyZrQt0ma7/YCyMYuNGd3DU6q6ZAyBeY3E9RyCiKjO3aTL2VKQGFvBVVmGdxGVSCITRphAcsKc/PF35/fg9XP9S0anMXcEFtdfMHz41SSw+XtE+Vc+6cX9FuI5qUfLGbkv8L1v3g4uw9VXlzq4GfTA+1S7D6mcoGHopAIXFlVr+2RfDKdSURMcB22z41fljO1MW4+zUS/4FyUTpL991es5fcwKXYoiE+x06VJeJJ1Krwx+DZj45uweV6cHXt2JwJEI9fWB6WyBlDejWw==" ) - self.assertEqual( self.key.title, "Key added through PyGithub" ) - self.assertEqual( self.key.url, "https://api.github.com/user/keys/2626650" ) - self.assertEqual( self.key.verified, True ) +class UserKey(Framework.TestCase): + def setUp(self): + Framework.TestCase.setUp(self) + self.key = self.g.get_user().get_key(2626650) - def testEditWithoutArguments( self ): + def testAttributes(self): + self.assertEqual(self.key.id, 2626650) + self.assertEqual(self.key.key, "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA2Mm0RjTNAYFfSCtUpO54usdseroUSIYg5KX4JoseTpqyiB/hqewjYLAdUq/tNIQzrkoEJWSyZrQt0ma7/YCyMYuNGd3DU6q6ZAyBeY3E9RyCiKjO3aTL2VKQGFvBVVmGdxGVSCITRphAcsKc/PF35/fg9XP9S0anMXcEFtdfMHz41SSw+XtE+Vc+6cX9FuI5qUfLGbkv8L1v3g4uw9VXlzq4GfTA+1S7D6mcoGHopAIXFlVr+2RfDKdSURMcB22z41fljO1MW4+zUS/4FyUTpL991es5fcwKXYoiE+x06VJeJJ1Krwx+DZj45uweV6cHXt2JwJEI9fWB6WyBlDejWw==") + self.assertEqual(self.key.title, "Key added through PyGithub") + self.assertEqual(self.key.url, "https://api.github.com/user/keys/2626650") + self.assertEqual(self.key.verified, True) + + def testEditWithoutArguments(self): self.key.edit() - def testEditWithAllArguments( self ): - self.key.edit( "Title edited by PyGithub", "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA5Q58YmzZjU64prR5Pk91MfeHezOTgLqDYmepYbv3qjguiHtPai1vSai5WvUv3hgf9DArXsXE5CV6yoBIhAdGtpJKExHuQ2m4XTFCdbrgfQ3ypcSdgzEiQemyTA6TWwhbuwjJ1IqJMYOVLH+FBCkD8pyIpUDO7v3vaR2TCEuNwOS7lbsRsW3OkGYnUKjaPaCTe/inrqb7I3OE8cPhWJ3dM/zzzBj22J4LCNKhjKua8TFS74xGm3lNDZ6/twQl4n4xmrH/3tG+WOJicNO3JohNHqK9T0pILnr3epEyfdkBjcG0qXApqWvH2WipJhaH6of8Gdr0Z/K/7p8QFddmwNgdPQ==" ) - self.assertEqual( self.key.key, "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA5Q58YmzZjU64prR5Pk91MfeHezOTgLqDYmepYbv3qjguiHtPai1vSai5WvUv3hgf9DArXsXE5CV6yoBIhAdGtpJKExHuQ2m4XTFCdbrgfQ3ypcSdgzEiQemyTA6TWwhbuwjJ1IqJMYOVLH+FBCkD8pyIpUDO7v3vaR2TCEuNwOS7lbsRsW3OkGYnUKjaPaCTe/inrqb7I3OE8cPhWJ3dM/zzzBj22J4LCNKhjKua8TFS74xGm3lNDZ6/twQl4n4xmrH/3tG+WOJicNO3JohNHqK9T0pILnr3epEyfdkBjcG0qXApqWvH2WipJhaH6of8Gdr0Z/K/7p8QFddmwNgdPQ==" ) - self.assertEqual( self.key.title, "Title edited by PyGithub" ) + def testEditWithAllArguments(self): + self.key.edit("Title edited by PyGithub", "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA5Q58YmzZjU64prR5Pk91MfeHezOTgLqDYmepYbv3qjguiHtPai1vSai5WvUv3hgf9DArXsXE5CV6yoBIhAdGtpJKExHuQ2m4XTFCdbrgfQ3ypcSdgzEiQemyTA6TWwhbuwjJ1IqJMYOVLH+FBCkD8pyIpUDO7v3vaR2TCEuNwOS7lbsRsW3OkGYnUKjaPaCTe/inrqb7I3OE8cPhWJ3dM/zzzBj22J4LCNKhjKua8TFS74xGm3lNDZ6/twQl4n4xmrH/3tG+WOJicNO3JohNHqK9T0pILnr3epEyfdkBjcG0qXApqWvH2WipJhaH6of8Gdr0Z/K/7p8QFddmwNgdPQ==") + self.assertEqual(self.key.key, "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA5Q58YmzZjU64prR5Pk91MfeHezOTgLqDYmepYbv3qjguiHtPai1vSai5WvUv3hgf9DArXsXE5CV6yoBIhAdGtpJKExHuQ2m4XTFCdbrgfQ3ypcSdgzEiQemyTA6TWwhbuwjJ1IqJMYOVLH+FBCkD8pyIpUDO7v3vaR2TCEuNwOS7lbsRsW3OkGYnUKjaPaCTe/inrqb7I3OE8cPhWJ3dM/zzzBj22J4LCNKhjKua8TFS74xGm3lNDZ6/twQl4n4xmrH/3tG+WOJicNO3JohNHqK9T0pILnr3epEyfdkBjcG0qXApqWvH2WipJhaH6of8Gdr0Z/K/7p8QFddmwNgdPQ==") + self.assertEqual(self.key.title, "Title edited by PyGithub") - def testDelete( self ): + def testDelete(self): self.key.delete() diff --git a/github/tests/__init__.py b/github/tests/__init__.py index 7e573b50..8108507e 100644 --- a/github/tests/__init__.py +++ b/github/tests/__init__.py @@ -15,5 +15,6 @@ import unittest import AllTests + def run(): - unittest.main( module = AllTests, argv = [ "Dummy Script Name" ] ) + unittest.main(module=AllTests, argv=["Dummy Script Name"]) diff --git a/github/tests/__main__.py b/github/tests/__main__.py index 494c50c1..802c3f69 100644 --- a/github/tests/__main__.py +++ b/github/tests/__main__.py @@ -1,15 +1,17 @@ -import sys -import unittest - -import Framework -import AllTests - -def main( argv ): - if "--record" in argv: - Framework.activateRecordMode() - argv = [ arg for arg in argv if arg != "--record" ] - - unittest.main( module = AllTests, argv = argv ) - -if __name__ == "__main__": - main( sys.argv ) +import sys +import unittest + +import Framework +import AllTests + + +def main(argv): + if "--record" in argv: + Framework.activateRecordMode() + argv = [arg for arg in argv if arg != "--record"] + + unittest.main(module=AllTests, argv=argv) + + +if __name__ == "__main__": + main(sys.argv) diff --git a/publish.sh b/publish.sh index 8bb6f9da..5fb0cdd7 100755 --- a/publish.sh +++ b/publish.sh @@ -1,5 +1,6 @@ #!/bin/sh +pep8 --ignore=E501 github # pip install pep8 python setup.py test previousVersion=$( grep 'version =' setup.py | sed 's/.*version = \"\(.*\)\".*/\1/' ) From 6ed11d0136ce2a9b51e7d4791ed9d6234e68c078 Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Mon, 17 Sep 2012 20:48:16 +0200 Subject: [PATCH 12/62] Add test showing error described in issue #87 --- github/tests/AllTests.py | 1 + github/tests/Issue87.py | 44 +++++++++++++++++++ github/tests/ReplayData/Issue87.setUp.txt | 10 +++++ ...estCreateIssueWithEscapedPercentInBody.txt | 5 +++ ...stCreateIssueWithEscapedPercentInTitle.txt | 5 +++ ...sue87.testCreateIssueWithPercentInBody.txt | 5 +++ ...ue87.testCreateIssueWithPercentInTitle.txt | 5 +++ 7 files changed, 75 insertions(+) create mode 100644 github/tests/Issue87.py create mode 100644 github/tests/ReplayData/Issue87.setUp.txt create mode 100644 github/tests/ReplayData/Issue87.testCreateIssueWithEscapedPercentInBody.txt create mode 100644 github/tests/ReplayData/Issue87.testCreateIssueWithEscapedPercentInTitle.txt create mode 100644 github/tests/ReplayData/Issue87.testCreateIssueWithPercentInBody.txt create mode 100644 github/tests/ReplayData/Issue87.testCreateIssueWithPercentInTitle.txt diff --git a/github/tests/AllTests.py b/github/tests/AllTests.py index c3b5bb3a..dd8864ce 100644 --- a/github/tests/AllTests.py +++ b/github/tests/AllTests.py @@ -57,3 +57,4 @@ from Issue33 import * from Issue50 import * from Issue54 import * from Issue80 import * +from Issue87 import * diff --git a/github/tests/Issue87.py b/github/tests/Issue87.py new file mode 100644 index 00000000..186e458a --- /dev/null +++ b/github/tests/Issue87.py @@ -0,0 +1,44 @@ +# Copyright 2012 Vincent Jacques +# vincent@vincent-jacques.net + +# This file is part of PyGithub. http://vincent-jacques.net/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 Issue87(Framework.TestCase): # https://github.com/jacquev6/PyGithub/issues/87 + def setUp(self): + Framework.TestCase.setUp(self) + self.repo = self.g.get_user().get_repo("PyGithub") + + def testCreateIssueWithPercentInTitle(self): + try: + issue = self.repo.create_issue( "Issue with percent % in title created by PyGithub" ) + self.fail("Should have raised") + except github.GithubException, exception: + self.assertEqual(exception.status, 500) + + def testCreateIssueWithPercentInBody(self): + try: + issue = self.repo.create_issue( "Issue created by PyGithub", "Percent % in body" ) + self.fail("Should have raised") + except github.GithubException, exception: + self.assertEqual(exception.status, 500) + + def testCreateIssueWithEscapedPercentInTitle(self): + issue = self.repo.create_issue( "Issue with escaped percent %25 in title created by PyGithub" ) + self.assertEqual( issue.number, 92 ) + + def testCreateIssueWithEscapedPercentInBody(self): + issue = self.repo.create_issue( "Issue created by PyGithub", "Escaped percent %25 in body" ) + self.assertEqual( issue.number, 91 ) diff --git a/github/tests/ReplayData/Issue87.setUp.txt b/github/tests/ReplayData/Issue87.setUp.txt new file mode 100644 index 00000000..d95818ba --- /dev/null +++ b/github/tests/ReplayData/Issue87.setUp.txt @@ -0,0 +1,10 @@ +https GET api.github.com None /user {'Authorization': 'Basic login_and_password_removed'} null +200 +[('status', '200 OK'), ('x-ratelimit-remaining', '4982'), ('x-ratelimit-limit', '5000'), ('x-content-type-options', 'nosniff'), ('vary', 'Accept, Authorization, Cookie'), ('content-length', '806'), ('server', 'nginx'), ('last-modified', 'Fri, 14 Sep 2012 18:47:46 GMT'), ('connection', 'keep-alive'), ('etag', '"434dfe5d3f50558fe3cea087cb95c401"'), ('cache-control', 'private, s-maxage=60, max-age=60'), ('date', 'Mon, 17 Sep 2012 18:44:54 GMT'), ('x-github-media-type', 'github.beta; format=json'), ('content-type', 'application/json; charset=utf-8')] +{"followers":13,"type":"User","blog":"http://vincent-jacques.net","bio":"","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png","html_url":"https://github.com/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","total_private_repos":3,"collaborators":0,"disk_usage":15956,"following":28,"created_at":"2010-07-09T06:10:06Z","owned_private_repos":3,"email":"vincent@vincent-jacques.net","location":"Paris, France","public_gists":3,"company":"Criteo","plan":{"collaborators":1,"space":614400,"private_repos":5,"name":"micro"},"private_gists":5,"public_repos":13,"name":"Vincent Jacques","hireable":false,"id":327146,"url":"https://api.github.com/users/jacquev6"} + +https GET api.github.com None /repos/jacquev6/PyGithub {'Authorization': 'Basic login_and_password_removed'} null +200 +[('status', '200 OK'), ('x-ratelimit-remaining', '4981'), ('x-ratelimit-limit', '5000'), ('x-content-type-options', 'nosniff'), ('vary', 'Accept, Authorization, Cookie'), ('content-length', '1238'), ('server', 'nginx'), ('last-modified', 'Mon, 17 Sep 2012 18:38:11 GMT'), ('connection', 'keep-alive'), ('etag', '"50b4ead2c3bc28c85ba0f5f1a2082c49"'), ('cache-control', 'private, s-maxage=60, max-age=60'), ('date', 'Mon, 17 Sep 2012 18:44:54 GMT'), ('x-github-media-type', 'github.beta; format=json'), ('content-type', 'application/json; charset=utf-8')] +{"git_url":"git://github.com/jacquev6/PyGithub.git","has_wiki":true,"html_url":"https://github.com/jacquev6/PyGithub","owner":{"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146,"url":"https://api.github.com/users/jacquev6"},"watchers":75,"watchers_count":75,"description":"Python library implementing the full Github API v3","forks_count":19,"created_at":"2012-02-25T12:53:47Z","open_issues":13,"open_issues_count":13,"has_issues":true,"svn_url":"https://github.com/jacquev6/PyGithub","pushed_at":"2012-09-17T18:38:01Z","network_count":19,"forks":19,"permissions":{"push":true,"pull":true,"admin":true},"language":"Python","master_branch":"master","size":408,"fork":false,"has_downloads":true,"clone_url":"https://github.com/jacquev6/PyGithub.git","updated_at":"2012-09-17T18:38:11Z","full_name":"jacquev6/PyGithub","name":"PyGithub","mirror_url":null,"private":false,"id":3544490,"homepage":"http://vincent-jacques.net/PyGithub","ssh_url":"git@github.com:jacquev6/PyGithub.git","url":"https://api.github.com/repos/jacquev6/PyGithub"} + diff --git a/github/tests/ReplayData/Issue87.testCreateIssueWithEscapedPercentInBody.txt b/github/tests/ReplayData/Issue87.testCreateIssueWithEscapedPercentInBody.txt new file mode 100644 index 00000000..3032e75e --- /dev/null +++ b/github/tests/ReplayData/Issue87.testCreateIssueWithEscapedPercentInBody.txt @@ -0,0 +1,5 @@ +https POST api.github.com None /repos/jacquev6/PyGithub/issues {'Authorization': 'Basic login_and_password_removed'} {"body": "Escaped percent %25 in body", "title": "Issue created by PyGithub"} +201 +[('status', '201 Created'), ('x-ratelimit-remaining', '4983'), ('x-github-media-type', 'github.beta; format=json'), ('x-content-type-options', 'nosniff'), ('content-length', '778'), ('server', 'nginx'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('location', 'https://api.github.com/repos/jacquev6/PyGithub/issues/91'), ('cache-control', 'max-age=0, private, must-revalidate'), ('date', 'Mon, 17 Sep 2012 18:44:53 GMT'), ('etag', '"c1d3cbf79e8bc820168394d7cec01075"'), ('content-type', 'application/json; charset=utf-8')] +{"number":91,"updated_at":"2012-09-17T18:44:53Z","milestone":null,"assignee":null,"body":"Escaped percent %25 in body","closed_at":null,"labels":[],"user":{"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png","login":"jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","id":327146,"url":"https://api.github.com/users/jacquev6"},"closed_by":null,"pull_request":{"diff_url":null,"patch_url":null,"html_url":null},"created_at":"2012-09-17T18:44:53Z","comments":0,"title":"Issue created by PyGithub","id":6929191,"html_url":"https://github.com/jacquev6/PyGithub/issues/91","state":"open","url":"https://api.github.com/repos/jacquev6/PyGithub/issues/91"} + diff --git a/github/tests/ReplayData/Issue87.testCreateIssueWithEscapedPercentInTitle.txt b/github/tests/ReplayData/Issue87.testCreateIssueWithEscapedPercentInTitle.txt new file mode 100644 index 00000000..6bacd750 --- /dev/null +++ b/github/tests/ReplayData/Issue87.testCreateIssueWithEscapedPercentInTitle.txt @@ -0,0 +1,5 @@ +https POST api.github.com None /repos/jacquev6/PyGithub/issues {'Authorization': 'Basic login_and_password_removed'} {"title": "Issue with escaped percent %25 in title created by PyGithub"} +201 +[('status', '201 Created'), ('x-ratelimit-remaining', '4980'), ('x-ratelimit-limit', '5000'), ('x-content-type-options', 'nosniff'), ('content-length', '787'), ('server', 'nginx'), ('connection', 'keep-alive'), ('etag', '"e8eaf00565488844bcf29ee7a67dcec9"'), ('location', 'https://api.github.com/repos/jacquev6/PyGithub/issues/92'), ('cache-control', 'max-age=0, private, must-revalidate'), ('date', 'Mon, 17 Sep 2012 18:44:55 GMT'), ('x-github-media-type', 'github.beta; format=json'), ('content-type', 'application/json; charset=utf-8')] +{"body":null,"labels":[],"user":{"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146,"url":"https://api.github.com/users/jacquev6"},"html_url":"https://github.com/jacquev6/PyGithub/issues/92","created_at":"2012-09-17T18:44:55Z","comments":0,"title":"Issue with escaped percent %25 in title created by PyGithub","milestone":null,"assignee":null,"state":"open","closed_at":null,"number":92,"updated_at":"2012-09-17T18:44:55Z","closed_by":null,"id":6929193,"pull_request":{"diff_url":null,"html_url":null,"patch_url":null},"url":"https://api.github.com/repos/jacquev6/PyGithub/issues/92"} + diff --git a/github/tests/ReplayData/Issue87.testCreateIssueWithPercentInBody.txt b/github/tests/ReplayData/Issue87.testCreateIssueWithPercentInBody.txt new file mode 100644 index 00000000..2682914b --- /dev/null +++ b/github/tests/ReplayData/Issue87.testCreateIssueWithPercentInBody.txt @@ -0,0 +1,5 @@ +https POST api.github.com None /repos/jacquev6/PyGithub/issues {'Authorization': 'Basic login_and_password_removed'} {"body": "Percent % in body", "title": "Issue created by PyGithub"} +500 +[('date', 'Mon, 17 Sep 2012 18:43:18 GMT'), ('transfer-encoding', 'chunked'), ('connection', 'keep-alive'), ('server', 'nginx')] + + diff --git a/github/tests/ReplayData/Issue87.testCreateIssueWithPercentInTitle.txt b/github/tests/ReplayData/Issue87.testCreateIssueWithPercentInTitle.txt new file mode 100644 index 00000000..7ed1293d --- /dev/null +++ b/github/tests/ReplayData/Issue87.testCreateIssueWithPercentInTitle.txt @@ -0,0 +1,5 @@ +https POST api.github.com None /repos/jacquev6/PyGithub/issues {'Authorization': 'Basic login_and_password_removed'} {"title": "Issue with percent % in title created by PyGithub"} +500 +[('date', 'Mon, 17 Sep 2012 18:43:20 GMT'), ('transfer-encoding', 'chunked'), ('connection', 'keep-alive'), ('server', 'nginx')] + + From 7c60be9516f5cac308d8380cefd909f886b334bd Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Tue, 25 Sep 2012 21:55:03 +0200 Subject: [PATCH 13/62] Fix Content-Type to allow '%' in json payload (issue #87) --- github/Requester.py | 2 ++ github/tests/Issue87.py | 18 ++++++------------ ...testCreateAuthorizationWithAllArguments.txt | 2 +- ...testCreateAuthorizationWithoutArguments.txt | 2 +- .../AuthenticatedUser.testCreateGist.txt | 2 +- ...edUser.testCreateGistWithoutDescription.txt | 2 +- .../AuthenticatedUser.testCreateKey.txt | 2 +- .../AuthenticatedUser.testCreateRepository.txt | 2 +- ...er.testCreateRepositoryWithAllArguments.txt | 2 +- ...henticatedUser.testEditWithAllArguments.txt | 2 +- ...henticatedUser.testEditWithoutArguments.txt | 2 +- .../AuthenticatedUser.testEmails.txt | 4 ++-- .../ReplayData/Authorization.testEdit.txt | 10 +++++----- .../ReplayData/Commit.testCreateComment.txt | 2 +- .../Commit.testCreateCommentOnFileLine.txt | 2 +- .../Commit.testCreateCommentOnFilePosition.txt | 2 +- ...ommit.testCreateStatusWithAllParameters.txt | 2 +- ...stCreateStatusWithoutOptionalParameters.txt | 2 +- .../ReplayData/CommitComment.testEdit.txt | 2 +- .../ReplayData/Exceptions.testInvalidInput.txt | 2 +- .../ReplayData/Gist.testCreateComment.txt | 2 +- .../Gist.testEditWithAllParameters.txt | 2 +- .../Gist.testEditWithoutParameters.txt | 2 +- .../tests/ReplayData/GistComment.testEdit.txt | 2 +- github/tests/ReplayData/GitRef.testEdit.txt | 2 +- .../ReplayData/GitRef.testEditWithForce.txt | 2 +- .../Hook.testEditWithAllParameters.txt | 8 ++++---- .../Hook.testEditWithMinimalParameters.txt | 2 +- .../Issue.testAddAndRemoveLabels.txt | 2 +- .../ReplayData/Issue.testCreateComment.txt | 2 +- .../Issue.testDeleteAndSetLabels.txt | 2 +- .../ReplayData/Issue.testEditResetAssignee.txt | 2 +- .../Issue.testEditResetMilestone.txt | 2 +- .../Issue.testEditWithAllParameters.txt | 2 +- .../Issue.testEditWithoutParameters.txt | 2 +- .../ReplayData/Issue50.testAddLabelToIssue.txt | 2 +- .../Issue50.testCreateIssueWithLabel.txt | 2 +- .../ReplayData/Issue50.testCreateLabel.txt | 2 +- .../ReplayData/Issue50.testSetIssueLabels.txt | 2 +- github/tests/ReplayData/Issue87.setUp.txt | 8 ++++---- ...testCreateIssueWithEscapedPercentInBody.txt | 6 +++--- ...estCreateIssueWithEscapedPercentInTitle.txt | 6 +++--- ...ssue87.testCreateIssueWithPercentInBody.txt | 8 ++++---- ...sue87.testCreateIssueWithPercentInTitle.txt | 8 ++++---- .../tests/ReplayData/IssueComment.testEdit.txt | 2 +- github/tests/ReplayData/Label.testEdit.txt | 2 +- ...rkdown.testRenderGithubFlavoredMarkdown.txt | 2 +- .../ReplayData/Markdown.testRenderMarkdown.txt | 2 +- .../Milestone.testEditWithAllParameters.txt | 2 +- ...Milestone.testEditWithMinimalParameters.txt | 2 +- .../ReplayData/NamedUser.testCreateGist.txt | 2 +- ...edUser.testCreateGistWithoutDescription.txt | 2 +- ...nization.testCreateRepoWithAllArguments.txt | 2 +- ...tion.testCreateRepoWithMinimalArguments.txt | 2 +- .../ReplayData/Organization.testCreateTeam.txt | 2 +- ...nization.testCreateTeamWithAllArguments.txt | 2 +- .../Organization.testEditWithAllArguments.txt | 2 +- .../Organization.testEditWithoutArguments.txt | 2 +- .../PullRequest.testCreateComment.txt | 4 ++-- .../PullRequest.testCreateIssueComment.txt | 2 +- .../PullRequest.testEditWithAllArguments.txt | 2 +- .../PullRequest.testEditWithoutArguments.txt | 2 +- .../ReplayData/PullRequest.testGetFiles.txt | 2 +- .../tests/ReplayData/PullRequest.testMerge.txt | 2 +- .../PullRequest.testMergeWithCommitMessage.txt | 2 +- .../ReplayData/PullRequestComment.testEdit.txt | 2 +- .../tests/ReplayData/PullRequestFile.setUp.txt | 2 +- ...tory.testCreateDownloadWithAllArguments.txt | 2 +- ....testCreateDownloadWithMinimalArguments.txt | 2 +- .../Repository.testCreateGitBlob.txt | 2 +- .../Repository.testCreateGitCommit.txt | 2 +- ...ory.testCreateGitCommitWithAllArguments.txt | 2 +- ...pository.testCreateGitCommitWithParents.txt | 2 +- .../ReplayData/Repository.testCreateGitRef.txt | 2 +- .../ReplayData/Repository.testCreateGitTag.txt | 2 +- ...sitory.testCreateGitTagWithAllArguments.txt | 2 +- .../Repository.testCreateGitTree.txt | 2 +- ...epository.testCreateGitTreeWithBaseTree.txt | 2 +- .../Repository.testCreateGitTreeWithSha.txt | 2 +- ...ository.testCreateHookWithAllParameters.txt | 2 +- ...ory.testCreateHookWithMinimalParameters.txt | 2 +- .../ReplayData/Repository.testCreateIssue.txt | 2 +- ...ository.testCreateIssueWithAllArguments.txt | 2 +- .../ReplayData/Repository.testCreateKey.txt | 2 +- .../ReplayData/Repository.testCreateLabel.txt | 2 +- .../Repository.testCreateMilestone.txt | 2 +- ...testCreateMilestoneWithMinimalArguments.txt | 2 +- .../ReplayData/Repository.testCreatePull.txt | 2 +- .../Repository.testCreatePullFromIssue.txt | 2 +- .../Repository.testEditWithAllArguments.txt | 4 ++-- .../Repository.testEditWithoutArguments.txt | 2 +- .../Repository.testMergeWithConflict.txt | 2 +- .../Repository.testMergeWithMessage.txt | 2 +- .../Repository.testMergeWithNothingToDo.txt | 2 +- .../Repository.testMergeWithoutMessage.txt | 2 +- .../ReplayData/RepositoryKey.testEdit.txt | 2 +- ...RepositoryKey.testEditWithoutParameters.txt | 2 +- .../Team.testEditWithAllArguments.txt | 2 +- .../Team.testEditWithoutArguments.txt | 2 +- .../UserKey.testEditWithAllArguments.txt | 2 +- .../UserKey.testEditWithoutArguments.txt | 2 +- 101 files changed, 130 insertions(+), 134 deletions(-) diff --git a/github/Requester.py b/github/Requester.py index a209a90c..a97ff019 100644 --- a/github/Requester.py +++ b/github/Requester.py @@ -88,6 +88,8 @@ class Requester: url += "?" + o.query headers = dict() + if input is not None: + headers["Content-Type"] = "application/json" if self.__authorizationHeader is not None: headers["Authorization"] = self.__authorizationHeader diff --git a/github/tests/Issue87.py b/github/tests/Issue87.py index 186e458a..2c199739 100644 --- a/github/tests/Issue87.py +++ b/github/tests/Issue87.py @@ -22,23 +22,17 @@ class Issue87(Framework.TestCase): # https://github.com/jacquev6/PyGithub/issue self.repo = self.g.get_user().get_repo("PyGithub") def testCreateIssueWithPercentInTitle(self): - try: - issue = self.repo.create_issue( "Issue with percent % in title created by PyGithub" ) - self.fail("Should have raised") - except github.GithubException, exception: - self.assertEqual(exception.status, 500) + issue = self.repo.create_issue( "Issue with percent % in title created by PyGithub" ) + self.assertEqual( issue.number, 99 ) def testCreateIssueWithPercentInBody(self): - try: - issue = self.repo.create_issue( "Issue created by PyGithub", "Percent % in body" ) - self.fail("Should have raised") - except github.GithubException, exception: - self.assertEqual(exception.status, 500) + issue = self.repo.create_issue( "Issue created by PyGithub", "Percent % in body" ) + self.assertEqual( issue.number, 98 ) def testCreateIssueWithEscapedPercentInTitle(self): issue = self.repo.create_issue( "Issue with escaped percent %25 in title created by PyGithub" ) - self.assertEqual( issue.number, 92 ) + self.assertEqual( issue.number, 97 ) def testCreateIssueWithEscapedPercentInBody(self): issue = self.repo.create_issue( "Issue created by PyGithub", "Escaped percent %25 in body" ) - self.assertEqual( issue.number, 91 ) + self.assertEqual( issue.number, 96 ) diff --git a/github/tests/ReplayData/AuthenticatedUser.testCreateAuthorizationWithAllArguments.txt b/github/tests/ReplayData/AuthenticatedUser.testCreateAuthorizationWithAllArguments.txt index 9a6d5245..dd0590db 100644 --- a/github/tests/ReplayData/AuthenticatedUser.testCreateAuthorizationWithAllArguments.txt +++ b/github/tests/ReplayData/AuthenticatedUser.testCreateAuthorizationWithAllArguments.txt @@ -1,4 +1,4 @@ -https POST api.github.com None /authorizations {'Authorization': 'Basic login_and_password_removed'} {"note": "Note created by PyGithub", "scopes": ["repo"], "note_url": "http://vincent-jacques.net/PyGithub"} +https POST api.github.com None /authorizations {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"note": "Note created by PyGithub", "scopes": ["repo"], "note_url": "http://vincent-jacques.net/PyGithub"} 201 [('status', '201 Created'), ('x-ratelimit-remaining', '4991'), ('content-length', '382'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"41f3600b4ddb741cd59a00a88321af92"'), ('date', 'Tue, 22 May 2012 18:27:36 GMT'), ('content-type', 'application/json; charset=utf-8'), ('location', 'https://api.github.com/authorizations/372294')] {"scopes":["repo"],"updated_at":"2012-05-22T18:27:36Z","app":{"url":"http://vincent-jacques.net/PyGithub","name":"Note created by PyGithub (API)"},"url":"https://api.github.com/authorizations/372294","token":"b7fd2a0346d9d590b1fad5e10971e8d29637a4ce","note":"Note created by PyGithub","note_url":"http://vincent-jacques.net/PyGithub","created_at":"2012-05-22T18:27:36Z","id":372294} diff --git a/github/tests/ReplayData/AuthenticatedUser.testCreateAuthorizationWithoutArguments.txt b/github/tests/ReplayData/AuthenticatedUser.testCreateAuthorizationWithoutArguments.txt index 7cd1e25b..c06a1156 100644 --- a/github/tests/ReplayData/AuthenticatedUser.testCreateAuthorizationWithoutArguments.txt +++ b/github/tests/ReplayData/AuthenticatedUser.testCreateAuthorizationWithoutArguments.txt @@ -1,4 +1,4 @@ -https POST api.github.com None /authorizations {'Authorization': 'Basic login_and_password_removed'} {} +https POST api.github.com None /authorizations {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {} 201 [('status', '201 Created'), ('x-ratelimit-remaining', '4987'), ('content-length', '328'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"4a48781fcd24441dade6248aab748487"'), ('date', 'Tue, 22 May 2012 18:03:17 GMT'), ('content-type', 'application/json; charset=utf-8'), ('location', 'https://api.github.com/authorizations/372259')] {"scopes":[],"updated_at":"2012-05-22T18:03:17Z","app":{"url":"http://developer.github.com/v3/oauth/#oauth-authorizations-api","name":"GitHub API"},"url":"https://api.github.com/authorizations/372259","token":"82459c4500086f8f0cc67d2936c17d1e27ad1c33","note":null,"created_at":"2012-05-22T18:03:17Z","note_url":null,"id":372259} diff --git a/github/tests/ReplayData/AuthenticatedUser.testCreateGist.txt b/github/tests/ReplayData/AuthenticatedUser.testCreateGist.txt index ed295580..d66d27b5 100644 --- a/github/tests/ReplayData/AuthenticatedUser.testCreateGist.txt +++ b/github/tests/ReplayData/AuthenticatedUser.testCreateGist.txt @@ -1,4 +1,4 @@ -https POST api.github.com None /gists {'Authorization': 'Basic login_and_password_removed'} {"files": {"foobar.txt": {"content": "File created by PyGithub"}}, "public": true, "description": "Gist created by PyGithub"} +https POST api.github.com None /gists {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"files": {"foobar.txt": {"content": "File created by PyGithub"}}, "public": true, "description": "Gist created by PyGithub"} 201 [('status', '201 Created'), ('x-ratelimit-remaining', '4967'), ('content-length', '1446'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"4099af9b70c91fb9c1c8dc72bf773c33"'), ('date', 'Sat, 19 May 2012 07:00:58 GMT'), ('content-type', 'application/json; charset=utf-8'), ('location', 'https://api.github.com/gists/2729810')] {"updated_at":"2012-05-19T07:00:58Z","forks":[],"url":"https://api.github.com/gists/2729810","comments":0,"public":true,"git_pull_url":"git://gist.github.com/2729810.git","git_push_url":"git@gist.github.com:2729810.git","files":{"foobar.txt":{"type":"text/plain","raw_url":"https://gist.github.com/raw/2729810/73a1c7f17aa0ad5d7cbb5a8ca033ce47d3d23197/foobar.txt","size":24,"filename":"foobar.txt","content":"File created by PyGithub","language":"Text"}},"html_url":"https://gist.github.com/2729810","user":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"jacquev6","id":327146},"description":"Gist created by PyGithub","created_at":"2012-05-19T07:00:58Z","id":"2729810","history":[{"change_status":{"deletions":0,"additions":1,"total":1},"url":"https://api.github.com/gists/2729810/35deb29ab1caf4c68c03d8244ad674b56de01a5c","committed_at":"2012-05-19T07:00:58Z","version":"35deb29ab1caf4c68c03d8244ad674b56de01a5c","user":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"jacquev6","id":327146}}]} diff --git a/github/tests/ReplayData/AuthenticatedUser.testCreateGistWithoutDescription.txt b/github/tests/ReplayData/AuthenticatedUser.testCreateGistWithoutDescription.txt index 106c7d35..3f968060 100644 --- a/github/tests/ReplayData/AuthenticatedUser.testCreateGistWithoutDescription.txt +++ b/github/tests/ReplayData/AuthenticatedUser.testCreateGistWithoutDescription.txt @@ -1,4 +1,4 @@ -https POST api.github.com None /gists {'Authorization': 'Basic login_and_password_removed'} {"files": {"foobar.txt": {"content": "File created by PyGithub"}}, "public": true} +https POST api.github.com None /gists {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"files": {"foobar.txt": {"content": "File created by PyGithub"}}, "public": true} 201 [('status', '201 Created'), ('x-ratelimit-remaining', '4981'), ('content-length', '1424'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"7abbb6858d17ad64e3d5874676725694"'), ('date', 'Sat, 26 May 2012 09:50:03 GMT'), ('content-type', 'application/json; charset=utf-8'), ('location', 'https://api.github.com/gists/2793179')] {"updated_at":"2012-05-26T09:50:02Z","url":"https://api.github.com/gists/2793179","comments":0,"public":true,"forks":[],"git_pull_url":"git://gist.github.com/2793179.git","files":{"foobar.txt":{"type":"text/plain","raw_url":"https://gist.github.com/raw/2793179/73a1c7f17aa0ad5d7cbb5a8ca033ce47d3d23197/foobar.txt","size":24,"filename":"foobar.txt","content":"File created by PyGithub","language":"Text"}},"user":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146,"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"description":null,"created_at":"2012-05-26T09:50:02Z","git_push_url":"git@gist.github.com:2793179.git","id":"2793179","history":[{"url":"https://api.github.com/gists/2793179/069e7c0041c34619b5aebf0e918536cb3bfeff9a","change_status":{"deletions":0,"additions":1,"total":1},"version":"069e7c0041c34619b5aebf0e918536cb3bfeff9a","committed_at":"2012-05-26T09:50:03Z","user":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146,"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"}}],"html_url":"https://gist.github.com/2793179"} diff --git a/github/tests/ReplayData/AuthenticatedUser.testCreateKey.txt b/github/tests/ReplayData/AuthenticatedUser.testCreateKey.txt index 8d5714ac..43ec2673 100644 --- a/github/tests/ReplayData/AuthenticatedUser.testCreateKey.txt +++ b/github/tests/ReplayData/AuthenticatedUser.testCreateKey.txt @@ -1,4 +1,4 @@ -https POST api.github.com None /user/keys {'Authorization': 'Basic login_and_password_removed'} {"key": "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA2Mm0RjTNAYFfSCtUpO54usdseroUSIYg5KX4JoseTpqyiB/hqewjYLAdUq/tNIQzrkoEJWSyZrQt0ma7/YCyMYuNGd3DU6q6ZAyBeY3E9RyCiKjO3aTL2VKQGFvBVVmGdxGVSCITRphAcsKc/PF35/fg9XP9S0anMXcEFtdfMHz41SSw+XtE+Vc+6cX9FuI5qUfLGbkv8L1v3g4uw9VXlzq4GfTA+1S7D6mcoGHopAIXFlVr+2RfDKdSURMcB22z41fljO1MW4+zUS/4FyUTpL991es5fcwKXYoiE+x06VJeJJ1Krwx+DZj45uweV6cHXt2JwJEI9fWB6WyBlDejWw== vincent@IDEE", "title": "Key added through PyGithub"} +https POST api.github.com None /user/keys {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"key": "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA2Mm0RjTNAYFfSCtUpO54usdseroUSIYg5KX4JoseTpqyiB/hqewjYLAdUq/tNIQzrkoEJWSyZrQt0ma7/YCyMYuNGd3DU6q6ZAyBeY3E9RyCiKjO3aTL2VKQGFvBVVmGdxGVSCITRphAcsKc/PF35/fg9XP9S0anMXcEFtdfMHz41SSw+XtE+Vc+6cX9FuI5qUfLGbkv8L1v3g4uw9VXlzq4GfTA+1S7D6mcoGHopAIXFlVr+2RfDKdSURMcB22z41fljO1MW4+zUS/4FyUTpL991es5fcwKXYoiE+x06VJeJJ1Krwx+DZj45uweV6cHXt2JwJEI9fWB6WyBlDejWw== vincent@IDEE", "title": "Key added through PyGithub"} 201 [('status', '201 Created'), ('x-ratelimit-remaining', '4984'), ('content-length', '505'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"7261ec55c886d6bf42e48d5bf9544586"'), ('date', 'Sat, 26 May 2012 19:49:30 GMT'), ('content-type', 'application/json; charset=utf-8'), ('location', 'https://api.github.com/user/keys/2626650')] {"url":"https://api.github.com/user/keys/2626650","key":"ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA2Mm0RjTNAYFfSCtUpO54usdseroUSIYg5KX4JoseTpqyiB/hqewjYLAdUq/tNIQzrkoEJWSyZrQt0ma7/YCyMYuNGd3DU6q6ZAyBeY3E9RyCiKjO3aTL2VKQGFvBVVmGdxGVSCITRphAcsKc/PF35/fg9XP9S0anMXcEFtdfMHz41SSw+XtE+Vc+6cX9FuI5qUfLGbkv8L1v3g4uw9VXlzq4GfTA+1S7D6mcoGHopAIXFlVr+2RfDKdSURMcB22z41fljO1MW4+zUS/4FyUTpL991es5fcwKXYoiE+x06VJeJJ1Krwx+DZj45uweV6cHXt2JwJEI9fWB6WyBlDejWw==","verified":true,"title":"Key added through PyGithub","id":2626650} diff --git a/github/tests/ReplayData/AuthenticatedUser.testCreateRepository.txt b/github/tests/ReplayData/AuthenticatedUser.testCreateRepository.txt index 2c402e7f..d119017f 100644 --- a/github/tests/ReplayData/AuthenticatedUser.testCreateRepository.txt +++ b/github/tests/ReplayData/AuthenticatedUser.testCreateRepository.txt @@ -1,4 +1,4 @@ -https POST api.github.com None /user/repos {'Authorization': 'Basic login_and_password_removed'} {"name": "TestPyGithub"} +https POST api.github.com None /user/repos {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"name": "TestPyGithub"} 201 [('status', '201 Created'), ('x-ratelimit-remaining', '4996'), ('content-length', '1035'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"0dee1203022ede8b8374b387ba479ffd"'), ('date', 'Thu, 10 May 2012 19:17:12 GMT'), ('content-type', 'application/json; charset=utf-8'), ('location', 'https://api.github.com/repos/jacquev6/TestPyGithub')] {"mirror_url":null,"homepage":null,"clone_url":"https://github.com/jacquev6/TestPyGithub.git","html_url":"https://github.com/jacquev6/TestPyGithub","url":"https://api.github.com/repos/jacquev6/TestPyGithub","has_downloads":true,"watchers":1,"git_url":"git://github.com/jacquev6/TestPyGithub.git","permissions":{"admin":true,"pull":true,"push":true},"has_wiki":true,"has_issues":true,"fork":false,"forks":1,"language":null,"size":0,"description":null,"private":false,"created_at":"2012-05-10T19:17:12Z","open_issues":0,"svn_url":"https://github.com/jacquev6/TestPyGithub","owner":{"url":"https://api.github.com/users/jacquev6","login":"jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","id":327146},"name":"TestPyGithub","pushed_at":"2012-05-10T19:17:12Z","id":4288693,"ssh_url":"git@github.com:jacquev6/TestPyGithub.git","updated_at":"2012-05-10T19:17:12Z"} diff --git a/github/tests/ReplayData/AuthenticatedUser.testCreateRepositoryWithAllArguments.txt b/github/tests/ReplayData/AuthenticatedUser.testCreateRepositoryWithAllArguments.txt index 13165ee5..bf6e746c 100644 --- a/github/tests/ReplayData/AuthenticatedUser.testCreateRepositoryWithAllArguments.txt +++ b/github/tests/ReplayData/AuthenticatedUser.testCreateRepositoryWithAllArguments.txt @@ -1,4 +1,4 @@ -https POST api.github.com None /user/repos {'Authorization': 'Basic login_and_password_removed'} {"has_wiki": false, "name": "TestPyGithub", "has_downloads": false, "private": false, "has_issues": false, "homepage": "http://foobar.com", "description": "Repo created by PyGithub"} +https POST api.github.com None /user/repos {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"has_wiki": false, "name": "TestPyGithub", "has_downloads": false, "private": false, "has_issues": false, "homepage": "http://foobar.com", "description": "Repo created by PyGithub"} 201 [('status', '201 Created'), ('x-ratelimit-remaining', '4979'), ('content-length', '1111'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"1c6473a60481c33b28a926041f763fce"'), ('date', 'Sat, 26 May 2012 09:55:27 GMT'), ('content-type', 'application/json; charset=utf-8'), ('location', 'https://api.github.com/repos/jacquev6/TestPyGithub')] {"clone_url":"https://github.com/jacquev6/TestPyGithub.git","has_downloads":false,"watchers":1,"git_url":"git://github.com/jacquev6/TestPyGithub.git","updated_at":"2012-05-26T09:55:27Z","permissions":{"pull":true,"admin":true,"push":true},"homepage":"http://foobar.com","url":"https://api.github.com/repos/jacquev6/TestPyGithub","has_wiki":false,"has_issues":false,"fork":false,"forks":1,"mirror_url":null,"size":0,"private":false,"open_issues":0,"svn_url":"https://github.com/jacquev6/TestPyGithub","owner":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146,"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"name":"TestPyGithub","language":null,"description":"Repo created by PyGithub","ssh_url":"git@github.com:jacquev6/TestPyGithub.git","pushed_at":"2012-05-26T09:55:27Z","created_at":"2012-05-26T09:55:27Z","id":4454027,"html_url":"https://github.com/jacquev6/TestPyGithub","full_name":"jacquev6/TestPyGithub"} diff --git a/github/tests/ReplayData/AuthenticatedUser.testEditWithAllArguments.txt b/github/tests/ReplayData/AuthenticatedUser.testEditWithAllArguments.txt index e41cab66..24074c54 100644 --- a/github/tests/ReplayData/AuthenticatedUser.testEditWithAllArguments.txt +++ b/github/tests/ReplayData/AuthenticatedUser.testEditWithAllArguments.txt @@ -1,4 +1,4 @@ -https PATCH api.github.com None /user {'Authorization': 'Basic login_and_password_removed'} {"bio": "Bio edited by PyGithub", "name": "Name edited by PyGithub", "company": "Company edited by PyGithub", "blog": "Blog edited by PyGithub", "location": "Location edited by PyGithub", "hireable": true, "email": "Email edited by PyGithub"} +https PATCH api.github.com None /user {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"bio": "Bio edited by PyGithub", "name": "Name edited by PyGithub", "company": "Company edited by PyGithub", "blog": "Blog edited by PyGithub", "location": "Location edited by PyGithub", "hireable": true, "email": "Email edited by PyGithub"} 200 [('status', '200 OK'), ('x-ratelimit-remaining', '4998'), ('content-length', '858'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"4695e7d2dc3084a322fe83f342448a79"'), ('date', 'Tue, 08 May 2012 10:04:55 GMT'), ('content-type', 'application/json; charset=utf-8')] {"private_gists":5,"type":"User","hireable":true,"following":24,"company":"Company edited by PyGithub","blog":"Blog edited by PyGithub","bio":"Bio edited by PyGithub","html_url":"https://github.com/jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","total_private_repos":5,"public_repos":10,"url":"https://api.github.com/users/jacquev6","owned_private_repos":5,"login":"jacquev6","collaborators":0,"email":"Email edited by PyGithub","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","disk_usage":16692,"plan":{"private_repos":5,"collaborators":1,"space":614400,"name":"micro"},"created_at":"2010-07-09T06:10:06Z","name":"Name edited by PyGithub","public_gists":1,"followers":13,"id":327146,"location":"Location edited by PyGithub"} diff --git a/github/tests/ReplayData/AuthenticatedUser.testEditWithoutArguments.txt b/github/tests/ReplayData/AuthenticatedUser.testEditWithoutArguments.txt index ddb6d975..6059546d 100644 --- a/github/tests/ReplayData/AuthenticatedUser.testEditWithoutArguments.txt +++ b/github/tests/ReplayData/AuthenticatedUser.testEditWithoutArguments.txt @@ -1,4 +1,4 @@ -https PATCH api.github.com None /user {'Authorization': 'Basic login_and_password_removed'} {} +https PATCH api.github.com None /user {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {} 200 [('status', '200 OK'), ('x-ratelimit-remaining', '4996'), ('content-length', '801'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"811fb4d5df8bae5b1ef7d63537891a1c"'), ('date', 'Tue, 08 May 2012 10:05:35 GMT'), ('content-type', 'application/json; charset=utf-8')] {"private_gists":5,"collaborators":0,"type":"User","bio":"","url":"https://api.github.com/users/jacquev6","public_repos":10,"followers":13,"gravatar_id":"b68de5ae38616c296fa345d2b9df2225","total_private_repos":5,"disk_usage":16692,"plan":{"collaborators":1,"space":614400,"name":"micro","private_repos":5},"html_url":"https://github.com/jacquev6","owned_private_repos":5,"login":"jacquev6","blog":"http://vincent-jacques.net","email":"vincent@vincent-jacques.net","created_at":"2010-07-09T06:10:06Z","company":"Criteo","location":"Paris, France","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","following":24,"name":"Vincent Jacques","public_gists":1,"hireable":false,"id":327146} diff --git a/github/tests/ReplayData/AuthenticatedUser.testEmails.txt b/github/tests/ReplayData/AuthenticatedUser.testEmails.txt index c97445e8..6257091e 100644 --- a/github/tests/ReplayData/AuthenticatedUser.testEmails.txt +++ b/github/tests/ReplayData/AuthenticatedUser.testEmails.txt @@ -3,7 +3,7 @@ https GET api.github.com None /user/emails {'Authorization': 'Basic login_and_pa [('status', '200 OK'), ('x-ratelimit-remaining', '4934'), ('content-length', '64'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"ea6dacf29569317ccf460b4bb07075e5"'), ('date', 'Sun, 20 May 2012 12:41:39 GMT'), ('content-type', 'application/json; charset=utf-8')] ["vincent@vincent-jacques.net","github.com@vincent-jacques.net"] -https POST api.github.com None /user/emails {'Authorization': 'Basic login_and_password_removed'} ["1@foobar.com", "2@foobar.com"] +https POST api.github.com None /user/emails {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} ["1@foobar.com", "2@foobar.com"] 201 [('status', '201 Created'), ('x-ratelimit-remaining', '4933'), ('content-length', '94'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"8efae10ea5e433b0d68201389058e4ee"'), ('date', 'Sun, 20 May 2012 12:41:40 GMT'), ('content-type', 'application/json; charset=utf-8')] ["vincent@vincent-jacques.net","1@foobar.com","2@foobar.com","github.com@vincent-jacques.net"] @@ -13,7 +13,7 @@ https GET api.github.com None /user/emails {'Authorization': 'Basic login_and_pa [('status', '200 OK'), ('content-length', '94'), ('x-ratelimit-remaining', '4932'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"8efae10ea5e433b0d68201389058e4ee"'), ('date', 'Sun, 20 May 2012 12:41:41 GMT'), ('content-type', 'application/json; charset=utf-8')] ["vincent@vincent-jacques.net","1@foobar.com","2@foobar.com","github.com@vincent-jacques.net"] -https DELETE api.github.com None /user/emails {'Authorization': 'Basic login_and_password_removed'} ["1@foobar.com", "2@foobar.com"] +https DELETE api.github.com None /user/emails {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} ["1@foobar.com", "2@foobar.com"] 204 [('status', '204 No Content'), ('x-ratelimit-remaining', '4931'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"d41d8cd98f00b204e9800998ecf8427e"'), ('date', 'Sun, 20 May 2012 12:41:41 GMT')] diff --git a/github/tests/ReplayData/Authorization.testEdit.txt b/github/tests/ReplayData/Authorization.testEdit.txt index bb0ab20e..9a62dc6c 100644 --- a/github/tests/ReplayData/Authorization.testEdit.txt +++ b/github/tests/ReplayData/Authorization.testEdit.txt @@ -1,24 +1,24 @@ -https PATCH api.github.com None /authorizations/372259 {'Authorization': 'Basic login_and_password_removed'} {} +https PATCH api.github.com None /authorizations/372259 {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {} 200 [('status', '200 OK'), ('x-ratelimit-remaining', '4998'), ('content-length', '328'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"39fec03a7cbd97abde96cccbd1921277"'), ('date', 'Tue, 22 May 2012 18:24:09 GMT'), ('content-type', 'application/json; charset=utf-8')] {"scopes":[],"updated_at":"2012-05-22T18:24:09Z","app":{"url":"http://developer.github.com/v3/oauth/#oauth-authorizations-api","name":"GitHub API"},"note_url":null,"url":"https://api.github.com/authorizations/372259","token":"82459c4500086f8f0cc67d2936c17d1e27ad1c33","note":null,"created_at":"2012-05-22T18:03:17Z","id":372259} -https PATCH api.github.com None /authorizations/372259 {'Authorization': 'Basic login_and_password_removed'} {"scopes": ["user"]} +https PATCH api.github.com None /authorizations/372259 {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"scopes": ["user"]} 200 [('status', '200 OK'), ('x-ratelimit-remaining', '4997'), ('content-length', '334'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"6476c8dce7e66cb43e71317294fd5b42"'), ('date', 'Tue, 22 May 2012 18:24:09 GMT'), ('content-type', 'application/json; charset=utf-8')] {"scopes":["user"],"updated_at":"2012-05-22T18:24:09Z","app":{"url":"http://developer.github.com/v3/oauth/#oauth-authorizations-api","name":"GitHub API"},"note_url":null,"url":"https://api.github.com/authorizations/372259","token":"82459c4500086f8f0cc67d2936c17d1e27ad1c33","note":null,"created_at":"2012-05-22T18:03:17Z","id":372259} -https PATCH api.github.com None /authorizations/372259 {'Authorization': 'Basic login_and_password_removed'} {"add_scopes": ["repo"]} +https PATCH api.github.com None /authorizations/372259 {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"add_scopes": ["repo"]} 200 [('status', '200 OK'), ('x-ratelimit-remaining', '4996'), ('content-length', '341'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"aef23fb8f728fcd7acf751015c21661a"'), ('date', 'Tue, 22 May 2012 18:24:10 GMT'), ('content-type', 'application/json; charset=utf-8')] {"scopes":["user","repo"],"updated_at":"2012-05-22T18:24:10Z","app":{"url":"http://developer.github.com/v3/oauth/#oauth-authorizations-api","name":"GitHub API"},"url":"https://api.github.com/authorizations/372259","token":"82459c4500086f8f0cc67d2936c17d1e27ad1c33","note":null,"note_url":null,"created_at":"2012-05-22T18:03:17Z","id":372259} -https PATCH api.github.com None /authorizations/372259 {'Authorization': 'Basic login_and_password_removed'} {"remove_scopes": ["repo"]} +https PATCH api.github.com None /authorizations/372259 {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"remove_scopes": ["repo"]} 200 [('status', '200 OK'), ('x-ratelimit-remaining', '4995'), ('content-length', '334'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"dff7e491f5d3c779385b9f3a41694a32"'), ('date', 'Tue, 22 May 2012 18:24:11 GMT'), ('content-type', 'application/json; charset=utf-8')] {"scopes":["user"],"updated_at":"2012-05-22T18:24:11Z","app":{"url":"http://developer.github.com/v3/oauth/#oauth-authorizations-api","name":"GitHub API"},"note_url":null,"url":"https://api.github.com/authorizations/372259","token":"82459c4500086f8f0cc67d2936c17d1e27ad1c33","note":null,"created_at":"2012-05-22T18:03:17Z","id":372259} -https PATCH api.github.com None /authorizations/372259 {'Authorization': 'Basic login_and_password_removed'} {"note": "Note created by PyGithub", "note_url": "http://vincent-jacques.net/PyGithub"} +https PATCH api.github.com None /authorizations/372259 {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"note": "Note created by PyGithub", "note_url": "http://vincent-jacques.net/PyGithub"} 200 [('status', '200 OK'), ('x-ratelimit-remaining', '4994'), ('content-length', '382'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"5881b7d6eaa13e3b8539ca6ffc334be1"'), ('date', 'Tue, 22 May 2012 18:24:11 GMT'), ('content-type', 'application/json; charset=utf-8')] {"note_url":"http://vincent-jacques.net/PyGithub","url":"https://api.github.com/authorizations/372259","app":{"url":"http://vincent-jacques.net/PyGithub","name":"Note created by PyGithub (API)"},"scopes":["user"],"note":"Note created by PyGithub","token":"82459c4500086f8f0cc67d2936c17d1e27ad1c33","created_at":"2012-05-22T18:03:17Z","updated_at":"2012-05-22T18:24:11Z","id":372259} diff --git a/github/tests/ReplayData/Commit.testCreateComment.txt b/github/tests/ReplayData/Commit.testCreateComment.txt index 5d27f84e..0e25a78e 100644 --- a/github/tests/ReplayData/Commit.testCreateComment.txt +++ b/github/tests/ReplayData/Commit.testCreateComment.txt @@ -1,4 +1,4 @@ -https POST api.github.com None /repos/jacquev6/PyGithub/commits/1292bf0e22c796e91cc3d6e24b544aece8c21f2a/comments {'Authorization': 'Basic login_and_password_removed'} {"body": "Comment created by PyGithub"} +https POST api.github.com None /repos/jacquev6/PyGithub/commits/1292bf0e22c796e91cc3d6e24b544aece8c21f2a/comments {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"body": "Comment created by PyGithub"} 201 [('status', '201 Created'), ('x-ratelimit-remaining', '4982'), ('content-length', '714'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"bd72e3550c9b90814f0be2b54ab2cc8e"'), ('date', 'Tue, 22 May 2012 18:40:18 GMT'), ('content-type', 'application/json; charset=utf-8'), ('location', 'https://api.github.com/repos/jacquev6/PyGithub/comments/1361949')] {"updated_at":"2012-05-22T18:40:18Z","position":null,"body":"Comment created by PyGithub","url":"https://api.github.com/repos/jacquev6/PyGithub/comments/1361949","commit_id":"1292bf0e22c796e91cc3d6e24b544aece8c21f2a","created_at":"2012-05-22T18:40:18Z","path":null,"line":null,"user":{"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/jacquev6","login":"jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","id":327146},"id":1361949,"html_url":"https://github.com/jacquev6/PyGithub/commit/1292bf0e22c796e91cc3d6e24b544aece8c21f2a#commitcomment-1361949"} diff --git a/github/tests/ReplayData/Commit.testCreateCommentOnFileLine.txt b/github/tests/ReplayData/Commit.testCreateCommentOnFileLine.txt index 5ea9b85c..7fa9270d 100644 --- a/github/tests/ReplayData/Commit.testCreateCommentOnFileLine.txt +++ b/github/tests/ReplayData/Commit.testCreateCommentOnFileLine.txt @@ -1,4 +1,4 @@ -https POST api.github.com None /repos/jacquev6/PyGithub/commits/1292bf0e22c796e91cc3d6e24b544aece8c21f2a/comments {'Authorization': 'Basic login_and_password_removed'} {"body": "Comment created by PyGithub", "path": "codegen/templates/GithubObject.MethodBody.UseResult.py", "line": 26} +https POST api.github.com None /repos/jacquev6/PyGithub/commits/1292bf0e22c796e91cc3d6e24b544aece8c21f2a/comments {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"body": "Comment created by PyGithub", "path": "codegen/templates/GithubObject.MethodBody.UseResult.py", "line": 26} 201 [('status', '201 Created'), ('x-ratelimit-remaining', '4970'), ('content-length', '764'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"d2cb361ce6c53a0fc986e74f8547088f"'), ('date', 'Tue, 22 May 2012 18:49:34 GMT'), ('content-type', 'application/json; charset=utf-8'), ('location', 'https://api.github.com/repos/jacquev6/PyGithub/comments/1362000')] {"updated_at":"2012-05-22T18:49:34Z","position":null,"body":"Comment created by PyGithub","url":"https://api.github.com/repos/jacquev6/PyGithub/comments/1362000","commit_id":"1292bf0e22c796e91cc3d6e24b544aece8c21f2a","created_at":"2012-05-22T18:49:34Z","path":"codegen/templates/GithubObject.MethodBody.UseResult.py","line":26,"user":{"url":"https://api.github.com/users/jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","id":327146},"id":1362000,"html_url":"https://github.com/jacquev6/PyGithub/commit/1292bf0e22c796e91cc3d6e24b544aece8c21f2a#commitcomment-1362000"} diff --git a/github/tests/ReplayData/Commit.testCreateCommentOnFilePosition.txt b/github/tests/ReplayData/Commit.testCreateCommentOnFilePosition.txt index 5e59d2ec..031becfb 100644 --- a/github/tests/ReplayData/Commit.testCreateCommentOnFilePosition.txt +++ b/github/tests/ReplayData/Commit.testCreateCommentOnFilePosition.txt @@ -1,4 +1,4 @@ -https POST api.github.com None /repos/jacquev6/PyGithub/commits/1292bf0e22c796e91cc3d6e24b544aece8c21f2a/comments {'Authorization': 'Basic login_and_password_removed'} {"body": "Comment also created by PyGithub", "path": "codegen/templates/GithubObject.MethodBody.UseResult.py", "position": 3} +https POST api.github.com None /repos/jacquev6/PyGithub/commits/1292bf0e22c796e91cc3d6e24b544aece8c21f2a/comments {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"body": "Comment also created by PyGithub", "path": "codegen/templates/GithubObject.MethodBody.UseResult.py", "position": 3} 201 [('status', '201 Created'), ('x-ratelimit-remaining', '4966'), ('content-length', '768'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"b3d062ed01b92c31d072c7177113c0b1"'), ('date', 'Tue, 22 May 2012 18:50:02 GMT'), ('content-type', 'application/json; charset=utf-8'), ('location', 'https://api.github.com/repos/jacquev6/PyGithub/comments/1362001')] {"url":"https://api.github.com/repos/jacquev6/PyGithub/comments/1362001","path":"codegen/templates/GithubObject.MethodBody.UseResult.py","body":"Comment also created by PyGithub","html_url":"https://github.com/jacquev6/PyGithub/commit/1292bf0e22c796e91cc3d6e24b544aece8c21f2a#commitcomment-1362001","created_at":"2012-05-22T18:50:02Z","commit_id":"1292bf0e22c796e91cc3d6e24b544aece8c21f2a","position":3,"updated_at":"2012-05-22T18:50:02Z","id":1362001,"line":null,"user":{"url":"https://api.github.com/users/jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146}} diff --git a/github/tests/ReplayData/Commit.testCreateStatusWithAllParameters.txt b/github/tests/ReplayData/Commit.testCreateStatusWithAllParameters.txt index 34f81d21..ae008886 100644 --- a/github/tests/ReplayData/Commit.testCreateStatusWithAllParameters.txt +++ b/github/tests/ReplayData/Commit.testCreateStatusWithAllParameters.txt @@ -1,4 +1,4 @@ -https POST api.github.com None /repos/jacquev6/PyGithub/statuses/1292bf0e22c796e91cc3d6e24b544aece8c21f2a {'Authorization': 'Basic login_and_password_removed'} {"state": "success", "target_url": "https://github.com/jacquev6/PyGithub/issues/67", "description": "Status successfuly created by PyGithub"} +https POST api.github.com None /repos/jacquev6/PyGithub/statuses/1292bf0e22c796e91cc3d6e24b544aece8c21f2a {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"state": "success", "target_url": "https://github.com/jacquev6/PyGithub/issues/67", "description": "Status successfuly created by PyGithub"} 201 [('status', '201 Created'), ('content-length', '603'), ('x-github-media-type', 'github.beta; format=json'), ('x-content-type-options', 'nosniff'), ('x-ratelimit-limit', '5000'), ('x-ratelimit-remaining', '4975'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('etag', '"06233b816702bedc54a6f68734a910bc"'), ('location', 'https://api.github.com/repos/jacquev6/PyGithub/statuses/277040'), ('cache-control', 'max-age=0, private, must-revalidate'), ('date', 'Sat, 08 Sep 2012 11:30:56 GMT'), ('content-type', 'application/json; charset=utf-8')] {"creator":{"gravatar_id":"b68de5ae38616c296fa345d2b9df2225","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png","url":"https://api.github.com/users/jacquev6","login":"jacquev6","id":327146},"state":"success","updated_at":"2012-09-08T11:30:56Z","target_url":"https://github.com/jacquev6/PyGithub/issues/67","url":"https://api.github.com/repos/jacquev6/PyGithub/statuses/277040","description":"Status successfuly created by PyGithub","id":277040,"created_at":"2012-09-08T11:30:56Z"} diff --git a/github/tests/ReplayData/Commit.testCreateStatusWithoutOptionalParameters.txt b/github/tests/ReplayData/Commit.testCreateStatusWithoutOptionalParameters.txt index bfd5ac0a..2860f991 100644 --- a/github/tests/ReplayData/Commit.testCreateStatusWithoutOptionalParameters.txt +++ b/github/tests/ReplayData/Commit.testCreateStatusWithoutOptionalParameters.txt @@ -1,4 +1,4 @@ -https POST api.github.com None /repos/jacquev6/PyGithub/statuses/1292bf0e22c796e91cc3d6e24b544aece8c21f2a {'Authorization': 'Basic login_and_password_removed'} {"state": "pending"} +https POST api.github.com None /repos/jacquev6/PyGithub/statuses/1292bf0e22c796e91cc3d6e24b544aece8c21f2a {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"state": "pending"} 201 [('status', '201 Created'), ('content-length', '523'), ('x-github-media-type', 'github.beta; format=json'), ('x-content-type-options', 'nosniff'), ('x-ratelimit-remaining', '4979'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('location', 'https://api.github.com/repos/jacquev6/PyGithub/statuses/277031'), ('cache-control', 'max-age=0, private, must-revalidate'), ('date', 'Sat, 08 Sep 2012 11:27:12 GMT'), ('etag', '"7e28427673d50844a69c0871e5e39a69"'), ('content-type', 'application/json; charset=utf-8')] {"description":null,"created_at":"2012-09-08T11:27:12Z","target_url":null,"state":"pending","updated_at":"2012-09-08T11:27:12Z","url":"https://api.github.com/repos/jacquev6/PyGithub/statuses/277031","id":277031,"creator":{"gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","url":"https://api.github.com/users/jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png","id":327146}} diff --git a/github/tests/ReplayData/CommitComment.testEdit.txt b/github/tests/ReplayData/CommitComment.testEdit.txt index 162dc43e..e6601d28 100644 --- a/github/tests/ReplayData/CommitComment.testEdit.txt +++ b/github/tests/ReplayData/CommitComment.testEdit.txt @@ -1,4 +1,4 @@ -https PATCH api.github.com None /repos/jacquev6/PyGithub/comments/1361949 {'Authorization': 'Basic login_and_password_removed'} {"body": "Comment edited by PyGithub"} +https PATCH api.github.com None /repos/jacquev6/PyGithub/comments/1361949 {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"body": "Comment edited by PyGithub"} 200 [('status', '200 OK'), ('x-ratelimit-remaining', '4978'), ('content-length', '713'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"97ffd9ff8370f4f284873a6397d7cafd"'), ('date', 'Tue, 22 May 2012 18:43:17 GMT'), ('content-type', 'application/json; charset=utf-8')] {"updated_at":"2012-05-22T18:43:17Z","position":null,"body":"Comment edited by PyGithub","url":"https://api.github.com/repos/jacquev6/PyGithub/comments/1361949","commit_id":"6945921c529be14c3a8f566dd1e483674516d46d","created_at":"2012-05-22T18:40:18Z","path":null,"line":null,"user":{"url":"https://api.github.com/users/jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","id":327146},"id":1361949,"html_url":"https://github.com/jacquev6/PyGithub/commit/6945921c529be14c3a8f566dd1e483674516d46d#commitcomment-1361949"} diff --git a/github/tests/ReplayData/Exceptions.testInvalidInput.txt b/github/tests/ReplayData/Exceptions.testInvalidInput.txt index 321d2aae..3524884d 100644 --- a/github/tests/ReplayData/Exceptions.testInvalidInput.txt +++ b/github/tests/ReplayData/Exceptions.testInvalidInput.txt @@ -1,4 +1,4 @@ -https POST api.github.com None /user/keys {'Authorization': 'Basic login_and_password_removed'} {"key": "xxx", "title": "Bad key"} +https POST api.github.com None /user/keys {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"key": "xxx", "title": "Bad key"} 422 [('status', '422 Unprocessable Entity'), ('x-ratelimit-remaining', '4995'), ('content-length', '221'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"73f756ef75655dd74463eb1bf4cfefe1"'), ('date', 'Wed, 30 May 2012 07:00:27 GMT'), ('content-type', 'application/json; charset=utf-8')] {"message":"Validation Failed","errors":[{"field":"key","resource":"PublicKey","message":"key is invalid. It must begin with 'ssh-rsa' or 'ssh-dss'. Check that you're copying the public half of the key","code":"custom"}]} diff --git a/github/tests/ReplayData/Gist.testCreateComment.txt b/github/tests/ReplayData/Gist.testCreateComment.txt index bfac7a39..17822052 100644 --- a/github/tests/ReplayData/Gist.testCreateComment.txt +++ b/github/tests/ReplayData/Gist.testCreateComment.txt @@ -1,4 +1,4 @@ -https POST api.github.com None /gists/2729810/comments {'Authorization': 'Basic login_and_password_removed'} {"body": "Comment created by PyGithub"} +https POST api.github.com None /gists/2729810/comments {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"body": "Comment created by PyGithub"} 201 [('status', '201 Created'), ('x-ratelimit-remaining', '4992'), ('content-length', '479'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"77456eabf6ebaafc2808cfbd4dfa5904"'), ('date', 'Sat, 19 May 2012 07:07:57 GMT'), ('content-type', 'application/json; charset=utf-8'), ('location', 'https://api.github.com/gists/comments/323629')] {"updated_at":"2012-05-19T07:07:57Z","body":"Comment created by PyGithub","url":"https://api.github.com/gists/comments/323629","created_at":"2012-05-19T07:07:57Z","user":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","id":327146},"id":323629} diff --git a/github/tests/ReplayData/Gist.testEditWithAllParameters.txt b/github/tests/ReplayData/Gist.testEditWithAllParameters.txt index 38805d60..9a17f9bf 100644 --- a/github/tests/ReplayData/Gist.testEditWithAllParameters.txt +++ b/github/tests/ReplayData/Gist.testEditWithAllParameters.txt @@ -1,4 +1,4 @@ -https PATCH api.github.com None /gists/2729810 {'Authorization': 'Basic login_and_password_removed'} {"files": {"barbaz.txt": {"content": "File also created by PyGithub"}}, "description": "Description edited by PyGithub"} +https PATCH api.github.com None /gists/2729810 {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"files": {"barbaz.txt": {"content": "File also created by PyGithub"}}, "description": "Description edited by PyGithub"} 200 [('status', '200 OK'), ('x-ratelimit-remaining', '4994'), ('content-length', '2759'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"14d4466c0580c6f8e9be17f81eb1c3b0"'), ('date', 'Sat, 19 May 2012 07:06:10 GMT'), ('content-type', 'application/json; charset=utf-8')] {"updated_at":"2012-05-19T07:06:10Z","forks":[],"url":"https://api.github.com/gists/2729810","comments":0,"public":true,"git_pull_url":"git://gist.github.com/2729810.git","files":{"barbaz.txt":{"type":"text/plain","raw_url":"https://gist.github.com/raw/2729810/92be1df4e473d2541c5c166ad145a39d0324de8b/barbaz.txt","size":29,"filename":"barbaz.txt","content":"File also created by PyGithub","language":"Text"},"foobar.txt":{"type":"text/plain","raw_url":"https://gist.github.com/raw/2729810/73a1c7f17aa0ad5d7cbb5a8ca033ce47d3d23197/foobar.txt","size":24,"filename":"foobar.txt","content":"File created by PyGithub","language":"Text"}},"html_url":"https://gist.github.com/2729810","git_push_url":"git@gist.github.com:2729810.git","user":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","id":327146},"description":"Description edited by PyGithub","created_at":"2012-05-19T07:00:58Z","id":"2729810","history":[{"url":"https://api.github.com/gists/2729810/67524fb6eb4883d979e8b4cf133003fa81a6a472","change_status":{"deletions":0,"additions":0,"total":0},"committed_at":"2012-05-19T07:06:10Z","version":"67524fb6eb4883d979e8b4cf133003fa81a6a472","user":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","id":327146}},{"url":"https://api.github.com/gists/2729810/e730170a9599696a9d776f8bb5028b35f937b6de","change_status":{"deletions":0,"additions":1,"total":1},"committed_at":"2012-05-19T07:04:31Z","version":"e730170a9599696a9d776f8bb5028b35f937b6de","user":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","id":327146}},{"url":"https://api.github.com/gists/2729810/35deb29ab1caf4c68c03d8244ad674b56de01a5c","change_status":{"deletions":0,"additions":1,"total":1},"committed_at":"2012-05-19T07:00:58Z","version":"35deb29ab1caf4c68c03d8244ad674b56de01a5c","user":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","id":327146}}]} diff --git a/github/tests/ReplayData/Gist.testEditWithoutParameters.txt b/github/tests/ReplayData/Gist.testEditWithoutParameters.txt index af76f58f..fb12bbe7 100644 --- a/github/tests/ReplayData/Gist.testEditWithoutParameters.txt +++ b/github/tests/ReplayData/Gist.testEditWithoutParameters.txt @@ -1,4 +1,4 @@ -https PATCH api.github.com None /gists/2729810 {'Authorization': 'Basic login_and_password_removed'} {} +https PATCH api.github.com None /gists/2729810 {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {} 200 [('status', '200 OK'), ('x-ratelimit-remaining', '4998'), ('content-length', '1446'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"9d90688efdf43c600be9c6c068f007dd"'), ('date', 'Sat, 19 May 2012 07:03:55 GMT'), ('content-type', 'application/json; charset=utf-8')] {"updated_at":"2012-05-19T07:00:58Z","git_push_url":"git@gist.github.com:2729810.git","forks":[],"url":"https://api.github.com/gists/2729810","comments":0,"public":true,"files":{"foobar.txt":{"type":"text/plain","raw_url":"https://gist.github.com/raw/2729810/73a1c7f17aa0ad5d7cbb5a8ca033ce47d3d23197/foobar.txt","size":24,"filename":"foobar.txt","content":"File created by PyGithub","language":"Text"}},"html_url":"https://gist.github.com/2729810","user":{"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146},"description":"Gist created by PyGithub","created_at":"2012-05-19T07:00:58Z","id":"2729810","history":[{"url":"https://api.github.com/gists/2729810/35deb29ab1caf4c68c03d8244ad674b56de01a5c","version":"35deb29ab1caf4c68c03d8244ad674b56de01a5c","change_status":{"deletions":0,"additions":1,"total":1},"committed_at":"2012-05-19T07:00:58Z","user":{"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146}}],"git_pull_url":"git://gist.github.com/2729810.git"} diff --git a/github/tests/ReplayData/GistComment.testEdit.txt b/github/tests/ReplayData/GistComment.testEdit.txt index 85cbcf52..0630398e 100644 --- a/github/tests/ReplayData/GistComment.testEdit.txt +++ b/github/tests/ReplayData/GistComment.testEdit.txt @@ -1,4 +1,4 @@ -https PATCH api.github.com None /gists/comments/323629 {'Authorization': 'Basic login_and_password_removed'} {"body": "Comment edited by PyGithub"} +https PATCH api.github.com None /gists/comments/323629 {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"body": "Comment edited by PyGithub"} 200 [('status', '200 OK'), ('content-length', '478'), ('x-ratelimit-limit', '5000'), ('x-ratelimit-remaining', '4987'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('etag', '"cea8090368993f1fb95c32cdcf4245d3"'), ('date', 'Sat, 19 May 2012 07:12:32 GMT'), ('content-type', 'application/json; charset=utf-8')] {"url":"https://api.github.com/gists/comments/323629","body":"Comment edited by PyGithub","created_at":"2012-05-19T07:07:57Z","updated_at":"2012-05-19T07:12:32Z","id":323629,"user":{"url":"https://api.github.com/users/jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","id":327146}} diff --git a/github/tests/ReplayData/GitRef.testEdit.txt b/github/tests/ReplayData/GitRef.testEdit.txt index c2c099ac..41c2d5c6 100644 --- a/github/tests/ReplayData/GitRef.testEdit.txt +++ b/github/tests/ReplayData/GitRef.testEdit.txt @@ -1,4 +1,4 @@ -https PATCH api.github.com None /repos/jacquev6/PyGithub/git/refs/heads/BranchCreatedByPyGithub {'Authorization': 'Basic login_and_password_removed'} {"sha": "04cde900a0775b51f762735637bd30de392a2793"} +https PATCH api.github.com None /repos/jacquev6/PyGithub/git/refs/heads/BranchCreatedByPyGithub {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"sha": "04cde900a0775b51f762735637bd30de392a2793"} 200 [('status', '200 OK'), ('x-ratelimit-remaining', '4986'), ('content-length', '322'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"ced480ad69948233f6520f7cd945eb34"'), ('date', 'Thu, 10 May 2012 18:49:20 GMT'), ('content-type', 'application/json; charset=utf-8')] {"url":"https://api.github.com/repos/jacquev6/PyGithub/git/refs/heads/BranchCreatedByPyGithub","object":{"url":"https://api.github.com/repos/jacquev6/PyGithub/git/commits/04cde900a0775b51f762735637bd30de392a2793","type":"commit","sha":"04cde900a0775b51f762735637bd30de392a2793"},"ref":"refs/heads/BranchCreatedByPyGithub"} diff --git a/github/tests/ReplayData/GitRef.testEditWithForce.txt b/github/tests/ReplayData/GitRef.testEditWithForce.txt index 2a0e6a5c..6c35c919 100644 --- a/github/tests/ReplayData/GitRef.testEditWithForce.txt +++ b/github/tests/ReplayData/GitRef.testEditWithForce.txt @@ -1,4 +1,4 @@ -https PATCH api.github.com None /repos/jacquev6/PyGithub/git/refs/heads/BranchCreatedByPyGithub {'Authorization': 'Basic login_and_password_removed'} {"sha": "4303c5b90e2216d927155e9609436ccb8984c495", "force": true} +https PATCH api.github.com None /repos/jacquev6/PyGithub/git/refs/heads/BranchCreatedByPyGithub {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"sha": "4303c5b90e2216d927155e9609436ccb8984c495", "force": true} 200 [('status', '200 OK'), ('x-ratelimit-remaining', '4985'), ('content-length', '322'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"fb39f29de1defbab14def8a331d00c69"'), ('date', 'Thu, 10 May 2012 18:49:21 GMT'), ('content-type', 'application/json; charset=utf-8')] {"url":"https://api.github.com/repos/jacquev6/PyGithub/git/refs/heads/BranchCreatedByPyGithub","object":{"url":"https://api.github.com/repos/jacquev6/PyGithub/git/commits/4303c5b90e2216d927155e9609436ccb8984c495","type":"commit","sha":"4303c5b90e2216d927155e9609436ccb8984c495"},"ref":"refs/heads/BranchCreatedByPyGithub"} diff --git a/github/tests/ReplayData/Hook.testEditWithAllParameters.txt b/github/tests/ReplayData/Hook.testEditWithAllParameters.txt index ec23510d..241cd01a 100644 --- a/github/tests/ReplayData/Hook.testEditWithAllParameters.txt +++ b/github/tests/ReplayData/Hook.testEditWithAllParameters.txt @@ -1,19 +1,19 @@ -https PATCH api.github.com None /repos/jacquev6/PyGithub/hooks/257993 {'Authorization': 'Basic login_and_password_removed'} {"config": {"url": "http://foobar.com"}, "name": "web", "events": ["fork", "push"]} +https PATCH api.github.com None /repos/jacquev6/PyGithub/hooks/257993 {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"config": {"url": "http://foobar.com"}, "name": "web", "events": ["fork", "push"]} 200 [('status', '200 OK'), ('x-ratelimit-remaining', '4987'), ('content-length', '305'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"43f8b86dbc2f5bbfde20abb9d9142206"'), ('date', 'Sat, 19 May 2012 06:03:18 GMT'), ('content-type', 'application/json; charset=utf-8')] {"updated_at":"2012-05-19T06:03:18Z","url":"https://api.github.com/repos/jacquev6/PyGithub/hooks/257993","last_response":{"status":"unused","message":null,"code":null},"config":{"url":"http://foobar.com"},"active":true,"events":["fork","push"],"name":"web","created_at":"2012-05-19T06:01:45Z","id":257993} -https PATCH api.github.com None /repos/jacquev6/PyGithub/hooks/257993 {'Authorization': 'Basic login_and_password_removed'} {"config": {"url": "http://foobar.com"}, "name": "web", "add_events": ["push"]} +https PATCH api.github.com None /repos/jacquev6/PyGithub/hooks/257993 {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"config": {"url": "http://foobar.com"}, "name": "web", "add_events": ["push"]} 200 [('status', '200 OK'), ('x-ratelimit-remaining', '4986'), ('content-length', '305'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"f372cc9359ed1d3b3fb8d484a09b36d7"'), ('date', 'Sat, 19 May 2012 06:03:19 GMT'), ('content-type', 'application/json; charset=utf-8')] {"updated_at":"2012-05-19T06:03:19Z","url":"https://api.github.com/repos/jacquev6/PyGithub/hooks/257993","last_response":{"status":"unused","message":null,"code":null},"config":{"url":"http://foobar.com"},"active":true,"events":["fork","push"],"name":"web","created_at":"2012-05-19T06:01:45Z","id":257993} -https PATCH api.github.com None /repos/jacquev6/PyGithub/hooks/257993 {'Authorization': 'Basic login_and_password_removed'} {"remove_events": ["fork"], "config": {"url": "http://foobar.com"}, "name": "web"} +https PATCH api.github.com None /repos/jacquev6/PyGithub/hooks/257993 {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"remove_events": ["fork"], "config": {"url": "http://foobar.com"}, "name": "web"} 200 [('status', '200 OK'), ('x-ratelimit-remaining', '4985'), ('content-length', '298'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"223ecc83a014738547fd99c826e3f125"'), ('date', 'Sat, 19 May 2012 06:03:19 GMT'), ('content-type', 'application/json; charset=utf-8')] {"updated_at":"2012-05-19T06:03:19Z","url":"https://api.github.com/repos/jacquev6/PyGithub/hooks/257993","config":{"url":"http://foobar.com"},"active":true,"last_response":{"status":"unused","message":null,"code":null},"events":["push"],"name":"web","created_at":"2012-05-19T06:01:45Z","id":257993} -https PATCH api.github.com None /repos/jacquev6/PyGithub/hooks/257993 {'Authorization': 'Basic login_and_password_removed'} {"active": true, "config": {"url": "http://foobar.com"}, "name": "web"} +https PATCH api.github.com None /repos/jacquev6/PyGithub/hooks/257993 {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"active": true, "config": {"url": "http://foobar.com"}, "name": "web"} 200 [('status', '200 OK'), ('x-ratelimit-remaining', '4984'), ('content-length', '298'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"711cf06c29a923c290e1af74dc3e019d"'), ('date', 'Sat, 19 May 2012 06:03:20 GMT'), ('content-type', 'application/json; charset=utf-8')] {"updated_at":"2012-05-19T06:03:20Z","url":"https://api.github.com/repos/jacquev6/PyGithub/hooks/257993","last_response":{"status":"unused","message":null,"code":null},"config":{"url":"http://foobar.com"},"active":true,"events":["push"],"name":"web","created_at":"2012-05-19T06:01:45Z","id":257993} diff --git a/github/tests/ReplayData/Hook.testEditWithMinimalParameters.txt b/github/tests/ReplayData/Hook.testEditWithMinimalParameters.txt index 14d546f5..64a21ca1 100644 --- a/github/tests/ReplayData/Hook.testEditWithMinimalParameters.txt +++ b/github/tests/ReplayData/Hook.testEditWithMinimalParameters.txt @@ -1,4 +1,4 @@ -https PATCH api.github.com None /repos/jacquev6/PyGithub/hooks/257993 {'Authorization': 'Basic login_and_password_removed'} {"config": {"url": "http://foobar.com/hook"}, "name": "web"} +https PATCH api.github.com None /repos/jacquev6/PyGithub/hooks/257993 {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"config": {"url": "http://foobar.com/hook"}, "name": "web"} 200 [('status', '200 OK'), ('x-ratelimit-remaining', '4990'), ('content-length', '303'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"8628a600a78bd5171c9e8d23b1ec22de"'), ('date', 'Sat, 19 May 2012 05:08:16 GMT'), ('content-type', 'application/json; charset=utf-8')] {"last_response":{"status":"unused","message":null,"code":null},"updated_at":"2012-05-19T05:08:16Z","url":"https://api.github.com/repos/jacquev6/PyGithub/hooks/257993","config":{"url":"http://foobar.com/hook"},"active":true,"events":["push"],"name":"web","created_at":"2012-05-19T05:03:14Z","id":257993} diff --git a/github/tests/ReplayData/Issue.testAddAndRemoveLabels.txt b/github/tests/ReplayData/Issue.testAddAndRemoveLabels.txt index c0e75161..4360d538 100644 --- a/github/tests/ReplayData/Issue.testAddAndRemoveLabels.txt +++ b/github/tests/ReplayData/Issue.testAddAndRemoveLabels.txt @@ -33,7 +33,7 @@ https GET api.github.com None /repos/jacquev6/PyGithub/issues/28/labels {'Author [('status', '200 OK'), ('x-ratelimit-remaining', '4986'), ('content-length', '129'), ('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/Project+management","name":"Project management","color":"444444"}] -https POST api.github.com None /repos/jacquev6/PyGithub/issues/28/labels {'Authorization': 'Basic login_and_password_removed'} ["Bug", "Question"] +https POST api.github.com None /repos/jacquev6/PyGithub/issues/28/labels {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} ["Bug", "Question"] 200 [('status', '200 OK'), ('x-ratelimit-remaining', '4985'), ('content-length', '335'), ('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')] [{"color":"e10c02","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug","name":"Bug"},{"color":"444444","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Project+management","name":"Project management"},{"color":"02e10c","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Question","name":"Question"}] diff --git a/github/tests/ReplayData/Issue.testCreateComment.txt b/github/tests/ReplayData/Issue.testCreateComment.txt index 79aad351..7d78a56d 100644 --- a/github/tests/ReplayData/Issue.testCreateComment.txt +++ b/github/tests/ReplayData/Issue.testCreateComment.txt @@ -1,4 +1,4 @@ -https POST api.github.com None /repos/jacquev6/PyGithub/issues/28/comments {'Authorization': 'Basic login_and_password_removed'} {"body": "Comment created by PyGithub"} +https POST api.github.com None /repos/jacquev6/PyGithub/issues/28/comments {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"body": "Comment created by PyGithub"} 201 [('status', '201 Created'), ('x-ratelimit-remaining', '4996'), ('content-length', '506'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"08cea7c821f6f3378e38921a9e7bc05e"'), ('date', 'Sun, 20 May 2012 11:46:43 GMT'), ('content-type', 'application/json; charset=utf-8'), ('location', 'https://api.github.com/repos/jacquev6/PyGithub/issues/comments/5808311')] {"updated_at":"2012-05-20T11:46:42Z","body":"Comment created by PyGithub","url":"https://api.github.com/repos/jacquev6/PyGithub/issues/comments/5808311","created_at":"2012-05-20T11:46:42Z","user":{"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146},"id":5808311} diff --git a/github/tests/ReplayData/Issue.testDeleteAndSetLabels.txt b/github/tests/ReplayData/Issue.testDeleteAndSetLabels.txt index 5468e70d..c4365074 100644 --- a/github/tests/ReplayData/Issue.testDeleteAndSetLabels.txt +++ b/github/tests/ReplayData/Issue.testDeleteAndSetLabels.txt @@ -23,7 +23,7 @@ https GET api.github.com None /repos/jacquev6/PyGithub/issues/28/labels {'Author [('status', '200 OK'), ('x-ratelimit-remaining', '4970'), ('content-length', '2'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"d751713988987e9331980363e24189ce"'), ('date', 'Sun, 27 May 2012 09:06:40 GMT'), ('content-type', 'application/json; charset=utf-8')] [] -https PUT api.github.com None /repos/jacquev6/PyGithub/issues/28/labels {'Authorization': 'Basic login_and_password_removed'} ["Bug", "Question"] +https PUT api.github.com None /repos/jacquev6/PyGithub/issues/28/labels {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} ["Bug", "Question"] 200 [('status', '200 OK'), ('x-ratelimit-remaining', '4969'), ('content-length', '207'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"1a56634d9c1050a88592ff55ed8adc62"'), ('date', 'Sun, 27 May 2012 09:06:40 GMT'), ('content-type', 'application/json; charset=utf-8')] [{"url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug","name":"Bug","color":"e10c02"},{"url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Question","name":"Question","color":"02e10c"}] diff --git a/github/tests/ReplayData/Issue.testEditResetAssignee.txt b/github/tests/ReplayData/Issue.testEditResetAssignee.txt index 55566f70..3ca0a070 100644 --- a/github/tests/ReplayData/Issue.testEditResetAssignee.txt +++ b/github/tests/ReplayData/Issue.testEditResetAssignee.txt @@ -1,4 +1,4 @@ -https PATCH api.github.com None /repos/jacquev6/PyGithub/issues/28 {'Authorization': 'Basic login_and_password_removed'} {"assignee": ""} +https PATCH api.github.com None /repos/jacquev6/PyGithub/issues/28 {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"assignee": ""} 200 [('status', '200 OK'), ('content-length', '1853'), ('x-ratelimit-limit', '5000'), ('x-content-type-options', 'nosniff'), ('x-ratelimit-remaining', '4980'), ('server', 'nginx'), ('connection', 'keep-alive'), ('etag', '"6947b498e9fd9f792130d6c80982b949"'), ('cache-control', 'max-age=0, private, must-revalidate'), ('date', 'Tue, 11 Sep 2012 18:47:24 GMT'), ('x-github-media-type', 'github.beta; format=json'), ('content-type', 'application/json; charset=utf-8')] {"body":"Body edited by PyGithub","closed_at":"2012-05-26T14:59:33Z","milestone":{"due_on":"2012-03-13T07:00:00Z","description":"","created_at":"2012-03-08T12:22:10Z","closed_issues":3,"title":"Version 0.4","open_issues":0,"state":"closed","creator":{"login":"jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","url":"https://api.github.com/users/jacquev6","id":327146},"number":1,"url":"https://api.github.com/repos/jacquev6/PyGithub/milestones/1","id":93546},"labels":[{"color":"e10c02","name":"Bug","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug"},{"color":"02e10c","name":"Question","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Question"}],"user":{"login":"jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","url":"https://api.github.com/users/jacquev6","id":327146},"pull_request":{"html_url":null,"patch_url":null,"diff_url":null},"created_at":"2012-05-19T10:38:23Z","comments":0,"closed_by":{"login":"jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","url":"https://api.github.com/users/jacquev6","id":327146},"title":"Issue created by PyGithub","html_url":"https://github.com/jacquev6/PyGithub/issues/28","assignee":null,"state":"closed","number":28,"updated_at":"2012-09-11T18:47:24Z","url":"https://api.github.com/repos/jacquev6/PyGithub/issues/28","id":4653757} diff --git a/github/tests/ReplayData/Issue.testEditResetMilestone.txt b/github/tests/ReplayData/Issue.testEditResetMilestone.txt index d6db72bf..a3f07035 100644 --- a/github/tests/ReplayData/Issue.testEditResetMilestone.txt +++ b/github/tests/ReplayData/Issue.testEditResetMilestone.txt @@ -1,4 +1,4 @@ -https PATCH api.github.com None /repos/jacquev6/PyGithub/issues/28 {'Authorization': 'Basic login_and_password_removed'} {"milestone": ""} +https PATCH api.github.com None /repos/jacquev6/PyGithub/issues/28 {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"milestone": ""} 200 [('status', '200 OK'), ('x-ratelimit-remaining', '4976'), ('x-github-media-type', 'github.beta; format=json'), ('x-content-type-options', 'nosniff'), ('x-ratelimit-limit', '5000'), ('content-length', '1296'), ('server', 'nginx'), ('connection', 'keep-alive'), ('etag', '"71423b9f379e4978b85005a6dc6820ed"'), ('cache-control', 'max-age=0, private, must-revalidate'), ('date', 'Tue, 11 Sep 2012 18:48:34 GMT'), ('content-type', 'application/json; charset=utf-8')] {"body":"Body edited by PyGithub","closed_at":"2012-05-26T14:59:33Z","milestone":null,"labels":[{"color":"e10c02","name":"Bug","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug"},{"color":"02e10c","name":"Question","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Question"}],"user":{"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png","login":"jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","url":"https://api.github.com/users/jacquev6","id":327146},"pull_request":{"diff_url":null,"html_url":null,"patch_url":null},"created_at":"2012-05-19T10:38:23Z","comments":0,"closed_by":{"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png","login":"jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","url":"https://api.github.com/users/jacquev6","id":327146},"title":"Issue created by PyGithub","assignee":null,"state":"closed","number":28,"html_url":"https://github.com/jacquev6/PyGithub/issues/28","updated_at":"2012-09-11T18:48:34Z","url":"https://api.github.com/repos/jacquev6/PyGithub/issues/28","id":4653757} diff --git a/github/tests/ReplayData/Issue.testEditWithAllParameters.txt b/github/tests/ReplayData/Issue.testEditWithAllParameters.txt index 1eec03f5..1409f5c1 100644 --- a/github/tests/ReplayData/Issue.testEditWithAllParameters.txt +++ b/github/tests/ReplayData/Issue.testEditWithAllParameters.txt @@ -8,7 +8,7 @@ https GET api.github.com None /repos/jacquev6/PyGithub/milestones/2 {'Authorizat [('status', '200 OK'), ('x-ratelimit-remaining', '4996'), ('content-length', '899'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"3a7652875cbbfe2a93b7307ab7a3deac"'), ('date', 'Fri, 01 Jun 2012 18:53:25 GMT'), ('content-type', 'application/json; charset=utf-8')] {"title":"Version 1.0: coherent public interface","creator":{"gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","url":"https://api.github.com/users/jacquev6","id":327146,"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"closed_issues":13,"created_at":"2012-03-08T12:22:28Z","state":"open","description":"Heavy rewrite to have:\r\n* a fully coherent public interface\r\n* usable stack-traces in case of exception\r\n* more explicit exceptions\r\n* more readable code (for library exploration, auto-completion in IDEs, etc.)\r\n\r\nSee working branch https://github.com/jacquev6/PyGithub/tree/topic/RewriteWithGeneratedCode","url":"https://api.github.com/repos/jacquev6/PyGithub/milestones/2","due_on":"2012-06-04T07:00:00Z","open_issues":6,"number":2,"id":93547} -https PATCH api.github.com None /repos/jacquev6/PyGithub/issues/28 {'Authorization': 'Basic login_and_password_removed'} {"body": "Body edited by PyGithub", "title": "Title edited by PyGithub", "labels": ["Bug"], "assignee": "jacquev6", "state": "open", "milestone": 2} +https PATCH api.github.com None /repos/jacquev6/PyGithub/issues/28 {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"body": "Body edited by PyGithub", "title": "Title edited by PyGithub", "labels": ["Bug"], "assignee": "jacquev6", "state": "open", "milestone": 2} 200 [('status', '200 OK'), ('x-ratelimit-remaining', '4992'), ('content-length', '2034'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"98bbbf2b2187bf5cdd9aead53ecc2b97"'), ('date', 'Sat, 19 May 2012 10:42:26 GMT'), ('content-type', 'application/json; charset=utf-8')] {"assignee":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","id":327146},"updated_at":"2012-05-19T10:42:25Z","body":"Body edited by PyGithub","url":"https://api.github.com/repos/jacquev6/PyGithub/issues/28","comments":0,"number":28,"title":"Title edited by PyGithub","pull_request":{"diff_url":null,"patch_url":null,"html_url":null},"closed_at":null,"labels":[{"url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug","name":"Bug","color":"e10c02"}],"closed_by":null,"html_url":"https://github.com/jacquev6/PyGithub/issues/28","created_at":"2012-05-19T10:38:23Z","state":"open","user":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","id":327146},"id":4653757,"milestone":{"url":"https://api.github.com/repos/jacquev6/PyGithub/milestones/2","due_on":null,"closed_issues":1,"creator":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","id":327146},"number":2,"open_issues":11,"title":"Version 1.0: coherent public interface","created_at":"2012-03-08T12:22:28Z","state":"open","description":"Heavy rewrite to have:\r\n* a fully coherent public interface\r\n* usable stack-traces in case of exception\r\n* more explicit exceptions\r\n* more readable code (for library exploration, auto-completion in IDEs, etc.)\r\n\r\nSee working branch https://github.com/jacquev6/PyGithub/tree/topic/RewriteWithGeneratedCode","id":93547}} diff --git a/github/tests/ReplayData/Issue.testEditWithoutParameters.txt b/github/tests/ReplayData/Issue.testEditWithoutParameters.txt index 046a536c..bc00ef8e 100644 --- a/github/tests/ReplayData/Issue.testEditWithoutParameters.txt +++ b/github/tests/ReplayData/Issue.testEditWithoutParameters.txt @@ -1,4 +1,4 @@ -https PATCH api.github.com None /repos/jacquev6/PyGithub/issues/28 {'Authorization': 'Basic login_and_password_removed'} {} +https PATCH api.github.com None /repos/jacquev6/PyGithub/issues/28 {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {} 200 [('status', '200 OK'), ('x-ratelimit-remaining', '4996'), ('content-length', '748'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"771af112ee4f9ad5858f5c9b5141b319"'), ('date', 'Sat, 19 May 2012 10:41:03 GMT'), ('content-type', 'application/json; charset=utf-8')] {"assignee":null,"updated_at":"2012-05-19T10:38:23Z","body":null,"url":"https://api.github.com/repos/jacquev6/PyGithub/issues/28","comments":0,"number":28,"title":"Issue created by PyGithub","pull_request":{"patch_url":null,"diff_url":null,"html_url":null},"closed_at":null,"labels":[],"closed_by":null,"html_url":"https://github.com/jacquev6/PyGithub/issues/28","created_at":"2012-05-19T10:38:23Z","state":"open","user":{"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146},"id":4653757,"milestone":null} diff --git a/github/tests/ReplayData/Issue50.testAddLabelToIssue.txt b/github/tests/ReplayData/Issue50.testAddLabelToIssue.txt index b7e329d5..4841e774 100644 --- a/github/tests/ReplayData/Issue50.testAddLabelToIssue.txt +++ b/github/tests/ReplayData/Issue50.testAddLabelToIssue.txt @@ -3,7 +3,7 @@ https GET api.github.com None /repos/jacquev6/PyGithub/labels/Label%20with%20spa [('status', '200 OK'), ('content-length', '197'), ('x-ratelimit-limit', '5000'), ('vary', 'Accept, Authorization, Cookie'), ('x-ratelimit-remaining', '4918'), ('server', 'nginx/1.0.13'), ('last-modified', 'Thu, 28 Jun 2012 19:29:52 GMT'), ('connection', 'keep-alive'), ('etag', '"c536d81e7479c8c9acfa7deeddeb6e72"'), ('cache-control', 'private, max-age=60'), ('date', 'Thu, 28 Jun 2012 19:54:44 GMT'), ('content-type', 'application/json; charset=utf-8')] {"color":"ffff00","name":"Label with spaces and strange characters (&*#$)","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Label+with+spaces+and+strange+characters+%28%26%2A%23%24%29"} -https POST api.github.com None /repos/jacquev6/PyGithub/issues/50/labels {'Authorization': 'Basic login_and_password_removed'} ["Label with spaces and strange characters (&*#$)"] +https POST api.github.com None /repos/jacquev6/PyGithub/issues/50/labels {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} ["Label with spaces and strange characters (&*#$)"] 200 [('status', '200 OK'), ('content-length', '419'), ('x-ratelimit-limit', '5000'), ('x-ratelimit-remaining', '4917'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('etag', '"e1d0a1c54608a676af0cdc1f63e04da7"'), ('cache-control', 'max-age=0, private, must-revalidate'), ('date', 'Thu, 28 Jun 2012 19:54:44 GMT'), ('content-type', 'application/json; charset=utf-8')] [{"color":"e10c02","name":"Bug","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug"},{"color":"ffff00","name":"Label with spaces and strange characters (&*#$)","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Label+with+spaces+and+strange+characters+%28%26%2A%23%24%29"},{"color":"e10c02","name":"RequestedByUser","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/RequestedByUser"}] diff --git a/github/tests/ReplayData/Issue50.testCreateIssueWithLabel.txt b/github/tests/ReplayData/Issue50.testCreateIssueWithLabel.txt index a7d404b9..d41d7171 100644 --- a/github/tests/ReplayData/Issue50.testCreateIssueWithLabel.txt +++ b/github/tests/ReplayData/Issue50.testCreateIssueWithLabel.txt @@ -3,7 +3,7 @@ https GET api.github.com None /repos/jacquev6/PyGithub/labels/Label%20with%20spa [('status', '200 OK'), ('content-length', '197'), ('x-ratelimit-limit', '5000'), ('vary', 'Accept, Authorization, Cookie'), ('x-ratelimit-remaining', '4908'), ('server', 'nginx/1.0.13'), ('last-modified', 'Thu, 28 Jun 2012 19:29:52 GMT'), ('connection', 'keep-alive'), ('etag', '"c536d81e7479c8c9acfa7deeddeb6e72"'), ('cache-control', 'private, max-age=60'), ('date', 'Thu, 28 Jun 2012 19:56:20 GMT'), ('content-type', 'application/json; charset=utf-8')] {"color":"ffff00","name":"Label with spaces and strange characters (&*#$)","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Label+with+spaces+and+strange+characters+%28%26%2A%23%24%29"} -https POST api.github.com None /repos/jacquev6/PyGithub/issues {'Authorization': 'Basic login_and_password_removed'} {"labels": ["Label with spaces and strange characters (&*#$)"], "title": "Issue created by PyGithub to test issue #50"} +https POST api.github.com None /repos/jacquev6/PyGithub/issues {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"labels": ["Label with spaces and strange characters (&*#$)"], "title": "Issue created by PyGithub to test issue #50"} 201 [('status', '201 Created'), ('content-length', '963'), ('x-ratelimit-limit', '5000'), ('x-ratelimit-remaining', '4907'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('etag', '"e1e5db9ef97e084a3d36ede8dc41c0d9"'), ('location', 'https://api.github.com/repos/jacquev6/PyGithub/issues/52'), ('cache-control', 'max-age=0, private, must-revalidate'), ('date', 'Thu, 28 Jun 2012 19:56:21 GMT'), ('content-type', 'application/json; charset=utf-8')] {"labels":[{"color":"ffff00","name":"Label with spaces and strange characters (&*#$)","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Label+with+spaces+and+strange+characters+%28%26%2A%23%24%29"}],"body":null,"state":"open","closed_at":null,"assignee":null,"comments":0,"title":"Issue created by PyGithub to test issue #50","created_at":"2012-06-28T19:56:21Z","number":52,"milestone":null,"html_url":"https://github.com/jacquev6/PyGithub/issues/52","url":"https://api.github.com/repos/jacquev6/PyGithub/issues/52","closed_by":null,"user":{"login":"jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/jacquev6","id":327146},"id":5330629,"pull_request":{"diff_url":null,"patch_url":null,"html_url":null},"updated_at":"2012-06-28T19:56:21Z"} diff --git a/github/tests/ReplayData/Issue50.testCreateLabel.txt b/github/tests/ReplayData/Issue50.testCreateLabel.txt index 5372bd48..75ecf7e3 100644 --- a/github/tests/ReplayData/Issue50.testCreateLabel.txt +++ b/github/tests/ReplayData/Issue50.testCreateLabel.txt @@ -1,4 +1,4 @@ -https POST api.github.com None /repos/jacquev6/PyGithub/labels {'Authorization': 'Basic login_and_password_removed'} {"color": "ffff00", "name": "Label with spaces and strange characters (&*#$)"} +https POST api.github.com None /repos/jacquev6/PyGithub/labels {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"color": "ffff00", "name": "Label with spaces and strange characters (&*#$)"} 201 [('status', '201 Created'), ('content-length', '197'), ('etag', '"99cbb3bf0f7ee7d6278c2ddd3ef42577"'), ('x-ratelimit-remaining', '4968'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('location', 'https://api.github.com/repos/jacquev6/PyGithub/labels/Label+with+spaces+and+strange+characters+%28%26%2A%23%24%29'), ('cache-control', 'max-age=0, private, must-revalidate'), ('date', 'Thu, 28 Jun 2012 19:29:52 GMT'), ('content-type', 'application/json; charset=utf-8')] {"color":"ffff00","name":"Label with spaces and strange characters (&*#$)","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Label+with+spaces+and+strange+characters+%28%26%2A%23%24%29"} diff --git a/github/tests/ReplayData/Issue50.testSetIssueLabels.txt b/github/tests/ReplayData/Issue50.testSetIssueLabels.txt index 4951cf68..28902a6f 100644 --- a/github/tests/ReplayData/Issue50.testSetIssueLabels.txt +++ b/github/tests/ReplayData/Issue50.testSetIssueLabels.txt @@ -13,7 +13,7 @@ https GET api.github.com None /repos/jacquev6/PyGithub/labels/Label%20with%20spa [('status', '200 OK'), ('x-ratelimit-remaining', '4887'), ('x-ratelimit-limit', '5000'), ('vary', 'Accept, Authorization, Cookie'), ('content-length', '197'), ('server', 'nginx/1.0.13'), ('last-modified', 'Thu, 28 Jun 2012 19:29:52 GMT'), ('connection', 'keep-alive'), ('etag', '"c536d81e7479c8c9acfa7deeddeb6e72"'), ('cache-control', 'private, max-age=60'), ('date', 'Thu, 28 Jun 2012 20:04:07 GMT'), ('content-type', 'application/json; charset=utf-8')] {"color":"ffff00","name":"Label with spaces and strange characters (&*#$)","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Label+with+spaces+and+strange+characters+%28%26%2A%23%24%29"} -https PUT api.github.com None /repos/jacquev6/PyGithub/issues/50/labels {'Authorization': 'Basic login_and_password_removed'} ["Bug", "RequestedByUser", "Label with spaces and strange characters (&*#$)"] +https PUT api.github.com None /repos/jacquev6/PyGithub/issues/50/labels {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} ["Bug", "RequestedByUser", "Label with spaces and strange characters (&*#$)"] 200 [('status', '200 OK'), ('content-length', '419'), ('x-ratelimit-limit', '5000'), ('x-ratelimit-remaining', '4886'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('etag', '"e1d0a1c54608a676af0cdc1f63e04da7"'), ('cache-control', 'max-age=0, private, must-revalidate'), ('date', 'Thu, 28 Jun 2012 20:04:08 GMT'), ('content-type', 'application/json; charset=utf-8')] [{"color":"e10c02","name":"Bug","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug"},{"color":"ffff00","name":"Label with spaces and strange characters (&*#$)","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Label+with+spaces+and+strange+characters+%28%26%2A%23%24%29"},{"color":"e10c02","name":"RequestedByUser","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/RequestedByUser"}] diff --git a/github/tests/ReplayData/Issue87.setUp.txt b/github/tests/ReplayData/Issue87.setUp.txt index d95818ba..f7c35ef7 100644 --- a/github/tests/ReplayData/Issue87.setUp.txt +++ b/github/tests/ReplayData/Issue87.setUp.txt @@ -1,10 +1,10 @@ https GET api.github.com None /user {'Authorization': 'Basic login_and_password_removed'} null 200 -[('status', '200 OK'), ('x-ratelimit-remaining', '4982'), ('x-ratelimit-limit', '5000'), ('x-content-type-options', 'nosniff'), ('vary', 'Accept, Authorization, Cookie'), ('content-length', '806'), ('server', 'nginx'), ('last-modified', 'Fri, 14 Sep 2012 18:47:46 GMT'), ('connection', 'keep-alive'), ('etag', '"434dfe5d3f50558fe3cea087cb95c401"'), ('cache-control', 'private, s-maxage=60, max-age=60'), ('date', 'Mon, 17 Sep 2012 18:44:54 GMT'), ('x-github-media-type', 'github.beta; format=json'), ('content-type', 'application/json; charset=utf-8')] -{"followers":13,"type":"User","blog":"http://vincent-jacques.net","bio":"","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png","html_url":"https://github.com/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","total_private_repos":3,"collaborators":0,"disk_usage":15956,"following":28,"created_at":"2010-07-09T06:10:06Z","owned_private_repos":3,"email":"vincent@vincent-jacques.net","location":"Paris, France","public_gists":3,"company":"Criteo","plan":{"collaborators":1,"space":614400,"private_repos":5,"name":"micro"},"private_gists":5,"public_repos":13,"name":"Vincent Jacques","hireable":false,"id":327146,"url":"https://api.github.com/users/jacquev6"} +[('status', '200 OK'), ('content-length', '806'), ('x-github-media-type', 'github.beta; format=json'), ('x-content-type-options', 'nosniff'), ('vary', 'Accept, Authorization, Cookie'), ('x-ratelimit-remaining', '4703'), ('server', 'nginx'), ('last-modified', 'Tue, 25 Sep 2012 07:42:42 GMT'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"e199a6b2e012ed6ffb1e6a935f4ba856"'), ('cache-control', 'private, s-maxage=60, max-age=60'), ('date', 'Tue, 25 Sep 2012 19:50:45 GMT'), ('content-type', 'application/json; charset=utf-8')] +{"type":"User","blog":"http://vincent-jacques.net","public_gists":3,"html_url":"https://github.com/jacquev6","login":"jacquev6","followers":14,"company":"Criteo","hireable":false,"private_gists":5,"plan":{"space":614400,"private_repos":5,"name":"micro","collaborators":1},"created_at":"2010-07-09T06:10:06Z","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png","email":"vincent@vincent-jacques.net","bio":"","disk_usage":18788,"public_repos":13,"total_private_repos":4,"following":29,"name":"Vincent Jacques","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","owned_private_repos":4,"collaborators":1,"id":327146,"location":"Paris, France","url":"https://api.github.com/users/jacquev6"} https GET api.github.com None /repos/jacquev6/PyGithub {'Authorization': 'Basic login_and_password_removed'} null 200 -[('status', '200 OK'), ('x-ratelimit-remaining', '4981'), ('x-ratelimit-limit', '5000'), ('x-content-type-options', 'nosniff'), ('vary', 'Accept, Authorization, Cookie'), ('content-length', '1238'), ('server', 'nginx'), ('last-modified', 'Mon, 17 Sep 2012 18:38:11 GMT'), ('connection', 'keep-alive'), ('etag', '"50b4ead2c3bc28c85ba0f5f1a2082c49"'), ('cache-control', 'private, s-maxage=60, max-age=60'), ('date', 'Mon, 17 Sep 2012 18:44:54 GMT'), ('x-github-media-type', 'github.beta; format=json'), ('content-type', 'application/json; charset=utf-8')] -{"git_url":"git://github.com/jacquev6/PyGithub.git","has_wiki":true,"html_url":"https://github.com/jacquev6/PyGithub","owner":{"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146,"url":"https://api.github.com/users/jacquev6"},"watchers":75,"watchers_count":75,"description":"Python library implementing the full Github API v3","forks_count":19,"created_at":"2012-02-25T12:53:47Z","open_issues":13,"open_issues_count":13,"has_issues":true,"svn_url":"https://github.com/jacquev6/PyGithub","pushed_at":"2012-09-17T18:38:01Z","network_count":19,"forks":19,"permissions":{"push":true,"pull":true,"admin":true},"language":"Python","master_branch":"master","size":408,"fork":false,"has_downloads":true,"clone_url":"https://github.com/jacquev6/PyGithub.git","updated_at":"2012-09-17T18:38:11Z","full_name":"jacquev6/PyGithub","name":"PyGithub","mirror_url":null,"private":false,"id":3544490,"homepage":"http://vincent-jacques.net/PyGithub","ssh_url":"git@github.com:jacquev6/PyGithub.git","url":"https://api.github.com/repos/jacquev6/PyGithub"} +[('status', '200 OK'), ('content-length', '1238'), ('x-github-media-type', 'github.beta; format=json'), ('x-content-type-options', 'nosniff'), ('vary', 'Accept, Authorization, Cookie'), ('x-ratelimit-remaining', '4702'), ('server', 'nginx'), ('last-modified', 'Mon, 24 Sep 2012 18:51:20 GMT'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"d0aaa41da0d7452a0dad489a3a4fcd35"'), ('cache-control', 'private, s-maxage=60, max-age=60'), ('date', 'Tue, 25 Sep 2012 19:50:46 GMT'), ('content-type', 'application/json; charset=utf-8')] +{"open_issues":16,"mirror_url":null,"has_issues":true,"language":"Python","homepage":"http://vincent-jacques.net/PyGithub","owner":{"login":"jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","id":327146,"url":"https://api.github.com/users/jacquev6"},"html_url":"https://github.com/jacquev6/PyGithub","master_branch":"master","description":"Python library implementing the full Github API v3","forks_count":20,"has_downloads":true,"created_at":"2012-02-25T12:53:47Z","svn_url":"https://github.com/jacquev6/PyGithub","git_url":"git://github.com/jacquev6/PyGithub.git","network_count":20,"watchers_count":79,"size":408,"fork":false,"ssh_url":"git@github.com:jacquev6/PyGithub.git","pushed_at":"2012-09-17T19:28:28Z","forks":20,"has_wiki":true,"name":"PyGithub","permissions":{"pull":true,"admin":true,"push":true},"watchers":79,"open_issues_count":16,"clone_url":"https://github.com/jacquev6/PyGithub.git","private":false,"updated_at":"2012-09-24T18:51:20Z","full_name":"jacquev6/PyGithub","id":3544490,"url":"https://api.github.com/repos/jacquev6/PyGithub"} diff --git a/github/tests/ReplayData/Issue87.testCreateIssueWithEscapedPercentInBody.txt b/github/tests/ReplayData/Issue87.testCreateIssueWithEscapedPercentInBody.txt index 3032e75e..e3867a23 100644 --- a/github/tests/ReplayData/Issue87.testCreateIssueWithEscapedPercentInBody.txt +++ b/github/tests/ReplayData/Issue87.testCreateIssueWithEscapedPercentInBody.txt @@ -1,5 +1,5 @@ -https POST api.github.com None /repos/jacquev6/PyGithub/issues {'Authorization': 'Basic login_and_password_removed'} {"body": "Escaped percent %25 in body", "title": "Issue created by PyGithub"} +https POST api.github.com None /repos/jacquev6/PyGithub/issues {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"body": "Escaped percent %25 in body", "title": "Issue created by PyGithub"} 201 -[('status', '201 Created'), ('x-ratelimit-remaining', '4983'), ('x-github-media-type', 'github.beta; format=json'), ('x-content-type-options', 'nosniff'), ('content-length', '778'), ('server', 'nginx'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('location', 'https://api.github.com/repos/jacquev6/PyGithub/issues/91'), ('cache-control', 'max-age=0, private, must-revalidate'), ('date', 'Mon, 17 Sep 2012 18:44:53 GMT'), ('etag', '"c1d3cbf79e8bc820168394d7cec01075"'), ('content-type', 'application/json; charset=utf-8')] -{"number":91,"updated_at":"2012-09-17T18:44:53Z","milestone":null,"assignee":null,"body":"Escaped percent %25 in body","closed_at":null,"labels":[],"user":{"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png","login":"jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","id":327146,"url":"https://api.github.com/users/jacquev6"},"closed_by":null,"pull_request":{"diff_url":null,"patch_url":null,"html_url":null},"created_at":"2012-09-17T18:44:53Z","comments":0,"title":"Issue created by PyGithub","id":6929191,"html_url":"https://github.com/jacquev6/PyGithub/issues/91","state":"open","url":"https://api.github.com/repos/jacquev6/PyGithub/issues/91"} +[('status', '201 Created'), ('content-length', '778'), ('x-github-media-type', 'github.beta; format=json'), ('x-content-type-options', 'nosniff'), ('etag', '"5b11ec85aeed655554b5e7b977975ea0"'), ('x-ratelimit-remaining', '4710'), ('server', 'nginx'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('location', 'https://api.github.com/repos/jacquev6/PyGithub/issues/96'), ('cache-control', 'max-age=0, private, must-revalidate'), ('date', 'Tue, 25 Sep 2012 19:50:41 GMT'), ('content-type', 'application/json; charset=utf-8')] +{"closed_by":null,"created_at":"2012-09-25T19:50:41Z","comments":0,"title":"Issue created by PyGithub","state":"open","assignee":null,"number":96,"updated_at":"2012-09-25T19:50:41Z","html_url":"https://github.com/jacquev6/PyGithub/issues/96","milestone":null,"body":"Escaped percent %25 in body","labels":[],"user":{"gravatar_id":"b68de5ae38616c296fa345d2b9df2225","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png","id":327146,"login":"jacquev6","url":"https://api.github.com/users/jacquev6"},"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"closed_at":null,"id":7132212,"url":"https://api.github.com/repos/jacquev6/PyGithub/issues/96"} diff --git a/github/tests/ReplayData/Issue87.testCreateIssueWithEscapedPercentInTitle.txt b/github/tests/ReplayData/Issue87.testCreateIssueWithEscapedPercentInTitle.txt index 6bacd750..4dc0eae7 100644 --- a/github/tests/ReplayData/Issue87.testCreateIssueWithEscapedPercentInTitle.txt +++ b/github/tests/ReplayData/Issue87.testCreateIssueWithEscapedPercentInTitle.txt @@ -1,5 +1,5 @@ -https POST api.github.com None /repos/jacquev6/PyGithub/issues {'Authorization': 'Basic login_and_password_removed'} {"title": "Issue with escaped percent %25 in title created by PyGithub"} +https POST api.github.com None /repos/jacquev6/PyGithub/issues {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"title": "Issue with escaped percent %25 in title created by PyGithub"} 201 -[('status', '201 Created'), ('x-ratelimit-remaining', '4980'), ('x-ratelimit-limit', '5000'), ('x-content-type-options', 'nosniff'), ('content-length', '787'), ('server', 'nginx'), ('connection', 'keep-alive'), ('etag', '"e8eaf00565488844bcf29ee7a67dcec9"'), ('location', 'https://api.github.com/repos/jacquev6/PyGithub/issues/92'), ('cache-control', 'max-age=0, private, must-revalidate'), ('date', 'Mon, 17 Sep 2012 18:44:55 GMT'), ('x-github-media-type', 'github.beta; format=json'), ('content-type', 'application/json; charset=utf-8')] -{"body":null,"labels":[],"user":{"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146,"url":"https://api.github.com/users/jacquev6"},"html_url":"https://github.com/jacquev6/PyGithub/issues/92","created_at":"2012-09-17T18:44:55Z","comments":0,"title":"Issue with escaped percent %25 in title created by PyGithub","milestone":null,"assignee":null,"state":"open","closed_at":null,"number":92,"updated_at":"2012-09-17T18:44:55Z","closed_by":null,"id":6929193,"pull_request":{"diff_url":null,"html_url":null,"patch_url":null},"url":"https://api.github.com/repos/jacquev6/PyGithub/issues/92"} +[('status', '201 Created'), ('x-ratelimit-remaining', '4707'), ('x-github-media-type', 'github.beta; format=json'), ('x-content-type-options', 'nosniff'), ('etag', '"50db679c69dac05fd00490516c95521a"'), ('content-length', '787'), ('server', 'nginx'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('location', 'https://api.github.com/repos/jacquev6/PyGithub/issues/97'), ('cache-control', 'max-age=0, private, must-revalidate'), ('date', 'Tue, 25 Sep 2012 19:50:43 GMT'), ('content-type', 'application/json; charset=utf-8')] +{"body":null,"assignee":null,"labels":[],"user":{"login":"jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","id":327146,"url":"https://api.github.com/users/jacquev6"},"html_url":"https://github.com/jacquev6/PyGithub/issues/97","milestone":null,"created_at":"2012-09-25T19:50:43Z","comments":0,"title":"Issue with escaped percent %25 in title created by PyGithub","pull_request":{"diff_url":null,"html_url":null,"patch_url":null},"closed_at":null,"state":"open","closed_by":null,"number":97,"updated_at":"2012-09-25T19:50:43Z","id":7132216,"url":"https://api.github.com/repos/jacquev6/PyGithub/issues/97"} diff --git a/github/tests/ReplayData/Issue87.testCreateIssueWithPercentInBody.txt b/github/tests/ReplayData/Issue87.testCreateIssueWithPercentInBody.txt index 2682914b..06d9b8fb 100644 --- a/github/tests/ReplayData/Issue87.testCreateIssueWithPercentInBody.txt +++ b/github/tests/ReplayData/Issue87.testCreateIssueWithPercentInBody.txt @@ -1,5 +1,5 @@ -https POST api.github.com None /repos/jacquev6/PyGithub/issues {'Authorization': 'Basic login_and_password_removed'} {"body": "Percent % in body", "title": "Issue created by PyGithub"} -500 -[('date', 'Mon, 17 Sep 2012 18:43:18 GMT'), ('transfer-encoding', 'chunked'), ('connection', 'keep-alive'), ('server', 'nginx')] - +https POST api.github.com None /repos/jacquev6/PyGithub/issues {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"body": "Percent % in body", "title": "Issue created by PyGithub"} +201 +[('status', '201 Created'), ('content-length', '768'), ('x-github-media-type', 'github.beta; format=json'), ('x-content-type-options', 'nosniff'), ('x-ratelimit-remaining', '4704'), ('server', 'nginx'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('location', 'https://api.github.com/repos/jacquev6/PyGithub/issues/98'), ('cache-control', 'max-age=0, private, must-revalidate'), ('date', 'Tue, 25 Sep 2012 19:50:45 GMT'), ('etag', '"41fe20e6fee4a38d4b11589129459e15"'), ('content-type', 'application/json; charset=utf-8')] +{"body":"Percent % in body","assignee":null,"labels":[],"user":{"login":"jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","id":327146,"url":"https://api.github.com/users/jacquev6"},"html_url":"https://github.com/jacquev6/PyGithub/issues/98","milestone":null,"created_at":"2012-09-25T19:50:45Z","comments":0,"title":"Issue created by PyGithub","pull_request":{"html_url":null,"diff_url":null,"patch_url":null},"closed_at":null,"state":"open","closed_by":null,"number":98,"updated_at":"2012-09-25T19:50:45Z","id":7132217,"url":"https://api.github.com/repos/jacquev6/PyGithub/issues/98"} diff --git a/github/tests/ReplayData/Issue87.testCreateIssueWithPercentInTitle.txt b/github/tests/ReplayData/Issue87.testCreateIssueWithPercentInTitle.txt index 7ed1293d..8a56d50e 100644 --- a/github/tests/ReplayData/Issue87.testCreateIssueWithPercentInTitle.txt +++ b/github/tests/ReplayData/Issue87.testCreateIssueWithPercentInTitle.txt @@ -1,5 +1,5 @@ -https POST api.github.com None /repos/jacquev6/PyGithub/issues {'Authorization': 'Basic login_and_password_removed'} {"title": "Issue with percent % in title created by PyGithub"} -500 -[('date', 'Mon, 17 Sep 2012 18:43:20 GMT'), ('transfer-encoding', 'chunked'), ('connection', 'keep-alive'), ('server', 'nginx')] - +https POST api.github.com None /repos/jacquev6/PyGithub/issues {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"title": "Issue with percent % in title created by PyGithub"} +201 +[('status', '201 Created'), ('x-ratelimit-remaining', '4701'), ('x-ratelimit-limit', '5000'), ('x-content-type-options', 'nosniff'), ('content-length', '777'), ('server', 'nginx'), ('connection', 'keep-alive'), ('etag', '"4f8b2cd3aecb26240538f54c3e4ff8f6"'), ('location', 'https://api.github.com/repos/jacquev6/PyGithub/issues/99'), ('cache-control', 'max-age=0, private, must-revalidate'), ('date', 'Tue, 25 Sep 2012 19:50:46 GMT'), ('x-github-media-type', 'github.beta; format=json'), ('content-type', 'application/json; charset=utf-8')] +{"body":null,"assignee":null,"labels":[],"user":{"login":"jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","id":327146,"url":"https://api.github.com/users/jacquev6"},"closed_at":null,"milestone":null,"created_at":"2012-09-25T19:50:46Z","comments":0,"closed_by":null,"title":"Issue with percent % in title created by PyGithub","pull_request":{"patch_url":null,"diff_url":null,"html_url":null},"state":"open","number":99,"updated_at":"2012-09-25T19:50:46Z","id":7132221,"html_url":"https://github.com/jacquev6/PyGithub/issues/99","url":"https://api.github.com/repos/jacquev6/PyGithub/issues/99"} diff --git a/github/tests/ReplayData/IssueComment.testEdit.txt b/github/tests/ReplayData/IssueComment.testEdit.txt index 5d8b4785..fcfe6a13 100644 --- a/github/tests/ReplayData/IssueComment.testEdit.txt +++ b/github/tests/ReplayData/IssueComment.testEdit.txt @@ -1,4 +1,4 @@ -https PATCH api.github.com None /repos/jacquev6/PyGithub/issues/comments/5808311 {'Authorization': 'Basic login_and_password_removed'} {"body": "Comment edited by PyGithub"} +https PATCH api.github.com None /repos/jacquev6/PyGithub/issues/comments/5808311 {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"body": "Comment edited by PyGithub"} 200 [('status', '200 OK'), ('x-ratelimit-remaining', '4980'), ('content-length', '505'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"1599061186ef7ca2dbf5bdee1711746a"'), ('date', 'Sun, 20 May 2012 11:53:59 GMT'), ('content-type', 'application/json; charset=utf-8')] {"updated_at":"2012-05-20T11:53:59Z","body":"Comment edited by PyGithub","url":"https://api.github.com/repos/jacquev6/PyGithub/issues/comments/5808311","created_at":"2012-05-20T11:46:42Z","user":{"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146},"id":5808311} diff --git a/github/tests/ReplayData/Label.testEdit.txt b/github/tests/ReplayData/Label.testEdit.txt index 0275ae11..2de51a02 100644 --- a/github/tests/ReplayData/Label.testEdit.txt +++ b/github/tests/ReplayData/Label.testEdit.txt @@ -1,4 +1,4 @@ -https PATCH api.github.com None /repos/jacquev6/PyGithub/labels/Bug {'Authorization': 'Basic login_and_password_removed'} {"color": "0000ff", "name": "LabelEditedByPyGithub"} +https PATCH api.github.com None /repos/jacquev6/PyGithub/labels/Bug {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"color": "0000ff", "name": "LabelEditedByPyGithub"} 200 [('status', '200 OK'), ('x-ratelimit-remaining', '4965'), ('content-length', '133'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"57435796bd4f14b84ad92105669cfab1"'), ('date', 'Sat, 19 May 2012 10:17:44 GMT'), ('content-type', 'application/json; charset=utf-8')] {"url":"https://api.github.com/repos/jacquev6/PyGithub/labels/LabelEditedByPyGithub","name":"LabelEditedByPyGithub","color":"0000ff"} diff --git a/github/tests/ReplayData/Markdown.testRenderGithubFlavoredMarkdown.txt b/github/tests/ReplayData/Markdown.testRenderGithubFlavoredMarkdown.txt index 2f84c3f0..a8765f09 100644 --- a/github/tests/ReplayData/Markdown.testRenderGithubFlavoredMarkdown.txt +++ b/github/tests/ReplayData/Markdown.testRenderGithubFlavoredMarkdown.txt @@ -1,4 +1,4 @@ -https POST api.github.com None /markdown {'Authorization': 'Basic login_and_password_removed'} {"text": "MyTitle\n=======\n\nIssue #1", "mode": "gfm", "context": "jacquev6/PyGithub"} +https POST api.github.com None /markdown {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"text": "MyTitle\n=======\n\nIssue #1", "mode": "gfm", "context": "jacquev6/PyGithub"} 200 [('status', '200 OK'), ('content-length', '150'), ('x-ratelimit-remaining', '4988'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"63251bf7dbb58f62c59ae39bb72c7a38"'), ('cache-control', 'max-age=0, private, must-revalidate'), ('date', 'Fri, 13 Jul 2012 11:59:58 GMT'), ('content-type', 'text/html;charset=utf-8')]

MyTitle

Issue #1

diff --git a/github/tests/ReplayData/Markdown.testRenderMarkdown.txt b/github/tests/ReplayData/Markdown.testRenderMarkdown.txt index 5f53cde7..9c61b865 100644 --- a/github/tests/ReplayData/Markdown.testRenderMarkdown.txt +++ b/github/tests/ReplayData/Markdown.testRenderMarkdown.txt @@ -1,4 +1,4 @@ -https POST api.github.com None /markdown {'Authorization': 'Basic login_and_password_removed'} {"text": "MyTitle\n=======\n\nIssue #1"} +https POST api.github.com None /markdown {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"text": "MyTitle\n=======\n\nIssue #1"} 200 [('status', '200 OK'), ('content-length', '133'), ('x-ratelimit-remaining', '4985'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"4cb17c0ebe3cc45c1a7f27d4d0850c54"'), ('cache-control', 'max-age=0, private, must-revalidate'), ('date', 'Fri, 13 Jul 2012 11:59:59 GMT'), ('content-type', 'text/html;charset=utf-8')]

MyTitle

Issue #1

diff --git a/github/tests/ReplayData/Milestone.testEditWithAllParameters.txt b/github/tests/ReplayData/Milestone.testEditWithAllParameters.txt index 31fd1499..f0c5fdfd 100644 --- a/github/tests/ReplayData/Milestone.testEditWithAllParameters.txt +++ b/github/tests/ReplayData/Milestone.testEditWithAllParameters.txt @@ -1,4 +1,4 @@ -https PATCH api.github.com None /repos/jacquev6/PyGithub/milestones/1 {'Authorization': 'Basic login_and_password_removed'} {"due_on": "2012-06-16", "state": "closed", "description": "Description edited by PyGithub", "title": "Title edited twice by PyGithub"} +https PATCH api.github.com None /repos/jacquev6/PyGithub/milestones/1 {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"due_on": "2012-06-16", "state": "closed", "description": "Description edited by PyGithub", "title": "Title edited twice by PyGithub"} 200 [('status', '200 OK'), ('x-ratelimit-remaining', '4946'), ('content-length', '606'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"ac9f76c61e1fe0e76cd26e77e59d5797"'), ('date', 'Sat, 19 May 2012 10:30:15 GMT'), ('content-type', 'application/json; charset=utf-8')] {"url":"https://api.github.com/repos/jacquev6/PyGithub/milestones/5","due_on":"2012-06-16T07:00:00Z","creator":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","id":327146},"number":5,"open_issues":0,"title":"Title edited twice by PyGithub","closed_issues":0,"created_at":"2012-05-19T10:24:13Z","state":"closed","description":"Description edited by PyGithub","id":121463} diff --git a/github/tests/ReplayData/Milestone.testEditWithMinimalParameters.txt b/github/tests/ReplayData/Milestone.testEditWithMinimalParameters.txt index 856e5176..410b0574 100644 --- a/github/tests/ReplayData/Milestone.testEditWithMinimalParameters.txt +++ b/github/tests/ReplayData/Milestone.testEditWithMinimalParameters.txt @@ -1,4 +1,4 @@ -https PATCH api.github.com None /repos/jacquev6/PyGithub/milestones/1 {'Authorization': 'Basic login_and_password_removed'} {"title": "Title edited by PyGithub"} +https PATCH api.github.com None /repos/jacquev6/PyGithub/milestones/1 {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"title": "Title edited by PyGithub"} 200 [('status', '200 OK'), ('x-ratelimit-remaining', '4954'), ('content-length', '599'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"df00dd4d1183f48c313b9cf04330623b"'), ('date', 'Sat, 19 May 2012 10:29:02 GMT'), ('content-type', 'application/json; charset=utf-8')] {"closed_issues":0,"url":"https://api.github.com/repos/jacquev6/PyGithub/milestones/5","due_on":"2012-06-15T07:00:00Z","creator":{"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146},"number":5,"open_issues":0,"title":"Title edited by PyGithub","created_at":"2012-05-19T10:24:13Z","state":"open","description":"Description created by PyGithub","id":121463} diff --git a/github/tests/ReplayData/NamedUser.testCreateGist.txt b/github/tests/ReplayData/NamedUser.testCreateGist.txt index e7ea70b7..f8ef3149 100644 --- a/github/tests/ReplayData/NamedUser.testCreateGist.txt +++ b/github/tests/ReplayData/NamedUser.testCreateGist.txt @@ -1,4 +1,4 @@ -https POST api.github.com None /users/jacquev6/gists {'Authorization': 'Basic login_and_password_removed'} {"files": {"foobar.txt": {"content": "File created by PyGithub"}}, "public": true, "description": "Gist created by PyGithub on a NamedUser"} +https POST api.github.com None /users/jacquev6/gists {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"files": {"foobar.txt": {"content": "File created by PyGithub"}}, "public": true, "description": "Gist created by PyGithub on a NamedUser"} 201 [('status', '201 Created'), ('x-ratelimit-remaining', '4961'), ('content-length', '1461'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"a0bf182f5ec61a0c78e9078da61ef220"'), ('date', 'Sun, 20 May 2012 12:14:08 GMT'), ('content-type', 'application/json; charset=utf-8'), ('location', 'https://api.github.com/gists/2757859')] {"updated_at":"2012-05-20T12:14:08Z","forks":[],"url":"https://api.github.com/gists/2757859","comments":0,"public":true,"git_pull_url":"git://gist.github.com/2757859.git","git_push_url":"git@gist.github.com:2757859.git","files":{"foobar.txt":{"type":"text/plain","size":24,"filename":"foobar.txt","raw_url":"https://gist.github.com/raw/2757859/73a1c7f17aa0ad5d7cbb5a8ca033ce47d3d23197/foobar.txt","content":"File created by PyGithub","language":"Text"}},"html_url":"https://gist.github.com/2757859","user":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","id":327146},"description":"Gist created by PyGithub on a NamedUser","created_at":"2012-05-20T12:14:08Z","id":"2757859","history":[{"change_status":{"deletions":0,"additions":1,"total":1},"url":"https://api.github.com/gists/2757859/a371de5450f93699fe3cb0386897abe69cdc967e","committed_at":"2012-05-20T12:14:08Z","version":"a371de5450f93699fe3cb0386897abe69cdc967e","user":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","id":327146}}]} diff --git a/github/tests/ReplayData/NamedUser.testCreateGistWithoutDescription.txt b/github/tests/ReplayData/NamedUser.testCreateGistWithoutDescription.txt index 477b89be..c11e8757 100644 --- a/github/tests/ReplayData/NamedUser.testCreateGistWithoutDescription.txt +++ b/github/tests/ReplayData/NamedUser.testCreateGistWithoutDescription.txt @@ -1,4 +1,4 @@ -https POST api.github.com None /users/jacquev6/gists {'Authorization': 'Basic login_and_password_removed'} {"files": {"foobar.txt": {"content": "File created by PyGithub"}}, "public": true} +https POST api.github.com None /users/jacquev6/gists {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"files": {"foobar.txt": {"content": "File created by PyGithub"}}, "public": true} 201 [('status', '201 Created'), ('x-ratelimit-remaining', '4959'), ('content-length', '1424'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"70ddb8edc443c90302048551cc26e7b9"'), ('date', 'Sat, 26 May 2012 11:08:22 GMT'), ('content-type', 'application/json; charset=utf-8'), ('location', 'https://api.github.com/gists/2793505')] {"git_push_url":"git@gist.github.com:2793505.git","updated_at":"2012-05-26T11:08:22Z","url":"https://api.github.com/gists/2793505","comments":0,"public":true,"forks":[],"files":{"foobar.txt":{"type":"text/plain","raw_url":"https://gist.github.com/raw/2793505/73a1c7f17aa0ad5d7cbb5a8ca033ce47d3d23197/foobar.txt","size":24,"filename":"foobar.txt","content":"File created by PyGithub","language":"Text"}},"user":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146,"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"description":null,"created_at":"2012-05-26T11:08:22Z","git_pull_url":"git://gist.github.com/2793505.git","id":"2793505","history":[{"url":"https://api.github.com/gists/2793505/a456dbfb5e6fd94cb96beba0a2c5684b251d3384","version":"a456dbfb5e6fd94cb96beba0a2c5684b251d3384","change_status":{"deletions":0,"additions":1,"total":1},"committed_at":"2012-05-26T11:08:22Z","user":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146,"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"}}],"html_url":"https://gist.github.com/2793505"} diff --git a/github/tests/ReplayData/Organization.testCreateRepoWithAllArguments.txt b/github/tests/ReplayData/Organization.testCreateRepoWithAllArguments.txt index 442d3c83..ea8dd982 100644 --- a/github/tests/ReplayData/Organization.testCreateRepoWithAllArguments.txt +++ b/github/tests/ReplayData/Organization.testCreateRepoWithAllArguments.txt @@ -3,7 +3,7 @@ https GET api.github.com None /teams/141496 {'Authorization': 'Basic login_and_p [('status', '200 OK'), ('x-ratelimit-remaining', '4994'), ('x-ratelimit-limit', '5000'), ('content-length', '128'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('etag', '"b93241eaf4384574f38b352b25595e28"'), ('date', 'Fri, 01 Jun 2012 19:35:59 GMT'), ('content-type', 'application/json; charset=utf-8')] {"repos_count":1,"permission":"push","url":"https://api.github.com/teams/141496","name":"Members","id":141496,"members_count":1} -https POST api.github.com None /orgs/BeaverSoftware/repos {'Authorization': 'Basic login_and_password_removed'} {"has_wiki": false, "name": "TestPyGithub2", "has_downloads": false, "private": false, "team_id": 141496, "has_issues": false, "homepage": "http://foobar.com", "description": "Repo created by PyGithub"} +https POST api.github.com None /orgs/BeaverSoftware/repos {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"has_wiki": false, "name": "TestPyGithub2", "has_downloads": false, "private": false, "team_id": 141496, "has_issues": false, "homepage": "http://foobar.com", "description": "Repo created by PyGithub"} 201 [('status', '201 Created'), ('x-ratelimit-remaining', '4969'), ('content-length', '1501'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"feb513e01eaf8e89967068fe8ed44cc7"'), ('date', 'Sun, 27 May 2012 05:20:43 GMT'), ('content-type', 'application/json; charset=utf-8'), ('location', 'https://api.github.com/repos/BeaverSoftware/TestPyGithub2')] {"organization":{"url":"https://api.github.com/users/BeaverSoftware","gravatar_id":"d563e337cac2fdc644e2aaaad1e23266","avatar_url":"https://secure.gravatar.com/avatar/d563e337cac2fdc644e2aaaad1e23266?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png","login":"BeaverSoftware","id":1424031},"clone_url":"https://github.com/BeaverSoftware/TestPyGithub2.git","has_downloads":false,"watchers":1,"updated_at":"2012-05-27T05:20:42Z","permissions":{"pull":true,"admin":true,"push":true},"homepage":"http://foobar.com","url":"https://api.github.com/repos/BeaverSoftware/TestPyGithub2","mirror_url":null,"has_wiki":false,"has_issues":false,"fork":false,"forks":1,"size":0,"private":false,"open_issues":0,"svn_url":"https://github.com/BeaverSoftware/TestPyGithub2","owner":{"url":"https://api.github.com/users/BeaverSoftware","gravatar_id":"d563e337cac2fdc644e2aaaad1e23266","avatar_url":"https://secure.gravatar.com/avatar/d563e337cac2fdc644e2aaaad1e23266?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png","login":"BeaverSoftware","id":1424031},"name":"TestPyGithub2","language":null,"description":"Repo created by PyGithub","ssh_url":"git@github.com:BeaverSoftware/TestPyGithub2.git","pushed_at":"2012-05-27T05:20:42Z","created_at":"2012-05-27T05:20:42Z","id":4460019,"git_url":"git://github.com/BeaverSoftware/TestPyGithub2.git","html_url":"https://github.com/BeaverSoftware/TestPyGithub2","full_name":"BeaverSoftware/TestPyGithub2"} diff --git a/github/tests/ReplayData/Organization.testCreateRepoWithMinimalArguments.txt b/github/tests/ReplayData/Organization.testCreateRepoWithMinimalArguments.txt index d94abad3..04287bf6 100644 --- a/github/tests/ReplayData/Organization.testCreateRepoWithMinimalArguments.txt +++ b/github/tests/ReplayData/Organization.testCreateRepoWithMinimalArguments.txt @@ -1,4 +1,4 @@ -https POST api.github.com None /orgs/BeaverSoftware/repos {'Authorization': 'Basic login_and_password_removed'} {"name": "TestPyGithub"} +https POST api.github.com None /orgs/BeaverSoftware/repos {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"name": "TestPyGithub"} 201 [('status', '201 Created'), ('x-ratelimit-remaining', '4971'), ('content-length', '1453'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"074f73773c425ba61e6a7738dc89b6ed"'), ('date', 'Sun, 27 May 2012 05:20:24 GMT'), ('content-type', 'application/json; charset=utf-8'), ('location', 'https://api.github.com/repos/BeaverSoftware/TestPyGithub')] {"organization":{"url":"https://api.github.com/users/BeaverSoftware","gravatar_id":"d563e337cac2fdc644e2aaaad1e23266","avatar_url":"https://secure.gravatar.com/avatar/d563e337cac2fdc644e2aaaad1e23266?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png","login":"BeaverSoftware","id":1424031},"clone_url":"https://github.com/BeaverSoftware/TestPyGithub.git","has_downloads":true,"watchers":1,"updated_at":"2012-05-27T05:20:24Z","permissions":{"pull":true,"admin":true,"push":true},"homepage":null,"url":"https://api.github.com/repos/BeaverSoftware/TestPyGithub","mirror_url":null,"has_wiki":true,"has_issues":true,"fork":false,"forks":1,"size":0,"private":false,"open_issues":0,"svn_url":"https://github.com/BeaverSoftware/TestPyGithub","owner":{"url":"https://api.github.com/users/BeaverSoftware","gravatar_id":"d563e337cac2fdc644e2aaaad1e23266","avatar_url":"https://secure.gravatar.com/avatar/d563e337cac2fdc644e2aaaad1e23266?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png","login":"BeaverSoftware","id":1424031},"name":"TestPyGithub","language":null,"description":null,"ssh_url":"git@github.com:BeaverSoftware/TestPyGithub.git","pushed_at":"2012-05-27T05:20:24Z","created_at":"2012-05-27T05:20:24Z","id":4460018,"git_url":"git://github.com/BeaverSoftware/TestPyGithub.git","html_url":"https://github.com/BeaverSoftware/TestPyGithub","full_name":"BeaverSoftware/TestPyGithub"} diff --git a/github/tests/ReplayData/Organization.testCreateTeam.txt b/github/tests/ReplayData/Organization.testCreateTeam.txt index dafa032b..a37b7198 100644 --- a/github/tests/ReplayData/Organization.testCreateTeam.txt +++ b/github/tests/ReplayData/Organization.testCreateTeam.txt @@ -1,4 +1,4 @@ -https POST api.github.com None /orgs/BeaverSoftware/teams {'Authorization': 'Basic login_and_password_removed'} {"name": "Team created by PyGithub"} +https POST api.github.com None /orgs/BeaverSoftware/teams {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"name": "Team created by PyGithub"} 201 [('status', '201 Created'), ('x-ratelimit-remaining', '4988'), ('content-length', '145'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"189a318993cde3e040f2efb4f634f8a8"'), ('date', 'Sat, 26 May 2012 20:58:53 GMT'), ('content-type', 'application/json; charset=utf-8'), ('location', 'https://api.github.com/teams/189850')] {"url":"https://api.github.com/teams/189850","members_count":0,"repos_count":0,"name":"Team created by PyGithub","permission":"pull","id":189850} diff --git a/github/tests/ReplayData/Organization.testCreateTeamWithAllArguments.txt b/github/tests/ReplayData/Organization.testCreateTeamWithAllArguments.txt index 2a0cd9ae..8c9f6c56 100644 --- a/github/tests/ReplayData/Organization.testCreateTeamWithAllArguments.txt +++ b/github/tests/ReplayData/Organization.testCreateTeamWithAllArguments.txt @@ -3,7 +3,7 @@ https GET api.github.com None /repos/BeaverSoftware/FatherBeaver {'Authorization [('status', '200 OK'), ('x-ratelimit-remaining', '4992'), ('content-length', '1431'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"4ecd2c151a469cfa6cd45e6beff1269b"'), ('date', 'Fri, 01 Jun 2012 19:40:56 GMT'), ('content-type', 'application/json; charset=utf-8')] {"has_downloads":true,"watchers":2,"mirror_url":null,"language":null,"description":"","ssh_url":"git@github.com:BeaverSoftware/FatherBeaver.git","created_at":"2012-02-09T19:32:21Z","url":"https://api.github.com/repos/BeaverSoftware/FatherBeaver","fork":false,"full_name":"BeaverSoftware/FatherBeaver","organization":{"avatar_url":"https://secure.gravatar.com/avatar/d563e337cac2fdc644e2aaaad1e23266?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png","gravatar_id":"d563e337cac2fdc644e2aaaad1e23266","login":"BeaverSoftware","url":"https://api.github.com/users/BeaverSoftware","id":1424031},"permissions":{"admin":true,"pull":true,"push":true},"has_wiki":true,"has_issues":true,"forks":1,"size":0,"svn_url":"https://github.com/BeaverSoftware/FatherBeaver","git_url":"git://github.com/BeaverSoftware/FatherBeaver.git","private":false,"updated_at":"2012-02-16T21:51:15Z","homepage":"","owner":{"avatar_url":"https://secure.gravatar.com/avatar/d563e337cac2fdc644e2aaaad1e23266?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png","gravatar_id":"d563e337cac2fdc644e2aaaad1e23266","login":"BeaverSoftware","url":"https://api.github.com/users/BeaverSoftware","id":1424031},"name":"FatherBeaver","open_issues":0,"html_url":"https://github.com/BeaverSoftware/FatherBeaver","id":3400397,"clone_url":"https://github.com/BeaverSoftware/FatherBeaver.git","pushed_at":null} -https POST api.github.com None /orgs/BeaverSoftware/teams {'Authorization': 'Basic login_and_password_removed'} {"repo_names": ["BeaverSoftware/FatherBeaver"], "name": "Team also created by PyGithub", "permission": "push"} +https POST api.github.com None /orgs/BeaverSoftware/teams {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"repo_names": ["BeaverSoftware/FatherBeaver"], "name": "Team also created by PyGithub", "permission": "push"} 201 [('status', '201 Created'), ('x-ratelimit-remaining', '4982'), ('content-length', '150'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"6e3fb00de6ca4c112feee3a1438d6f0e"'), ('date', 'Sat, 26 May 2012 21:00:26 GMT'), ('content-type', 'application/json; charset=utf-8'), ('location', 'https://api.github.com/teams/189852')] {"repos_count":1,"url":"https://api.github.com/teams/189852","members_count":0,"name":"Team also created by PyGithub","permission":"push","id":189852} diff --git a/github/tests/ReplayData/Organization.testEditWithAllArguments.txt b/github/tests/ReplayData/Organization.testEditWithAllArguments.txt index b5879a8a..4269c75a 100644 --- a/github/tests/ReplayData/Organization.testEditWithAllArguments.txt +++ b/github/tests/ReplayData/Organization.testEditWithAllArguments.txt @@ -1,4 +1,4 @@ -https PATCH api.github.com None /orgs/BeaverSoftware {'Authorization': 'Basic login_and_password_removed'} {"name": "Name edited by PyGithub", "billing_email": "BeaverSoftware2@vincent-jacques.net", "company": "Company edited by PyGithub", "blog": "http://vincent-jacques.net", "location": "Location edited by PyGithub", "email": "BeaverSoftware2@vincent-jacques.net"} +https PATCH api.github.com None /orgs/BeaverSoftware {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"name": "Name edited by PyGithub", "billing_email": "BeaverSoftware2@vincent-jacques.net", "company": "Company edited by PyGithub", "blog": "http://vincent-jacques.net", "location": "Location edited by PyGithub", "email": "BeaverSoftware2@vincent-jacques.net"} 200 [('status', '200 OK'), ('x-ratelimit-remaining', '4992'), ('content-length', '833'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"fe61098c87e054abfa5626e6a76bbcbd"'), ('date', 'Sat, 26 May 2012 20:50:35 GMT'), ('content-type', 'application/json; charset=utf-8')] {"public_gists":0,"type":"Organization","disk_usage":112,"private_gists":0,"public_repos":2,"url":"https://api.github.com/orgs/BeaverSoftware","total_private_repos":0,"plan":{"private_repos":0,"name":"free","space":307200},"blog":"http://vincent-jacques.net","avatar_url":"https://secure.gravatar.com/avatar/d563e337cac2fdc644e2aaaad1e23266?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png","owned_private_repos":0,"collaborators":0,"company":"Company edited by PyGithub","login":"BeaverSoftware","email":"BeaverSoftware2@vincent-jacques.net","followers":0,"name":"Name edited by PyGithub","created_at":"2012-02-09T19:20:12Z","location":"Location edited by PyGithub","id":1424031,"billing_email":"BeaverSoftware2@vincent-jacques.net","following":0,"html_url":"https://github.com/BeaverSoftware"} diff --git a/github/tests/ReplayData/Organization.testEditWithoutArguments.txt b/github/tests/ReplayData/Organization.testEditWithoutArguments.txt index 151a8aaf..9b3b41ae 100644 --- a/github/tests/ReplayData/Organization.testEditWithoutArguments.txt +++ b/github/tests/ReplayData/Organization.testEditWithoutArguments.txt @@ -1,4 +1,4 @@ -https PATCH api.github.com None /orgs/BeaverSoftware {'Authorization': 'Basic login_and_password_removed'} {} +https PATCH api.github.com None /orgs/BeaverSoftware {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {} 200 [('status', '200 OK'), ('x-ratelimit-remaining', '4996'), ('content-length', '716'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"a9ca2dd89f69da85bebd949477894af0"'), ('date', 'Fri, 11 May 2012 09:07:56 GMT'), ('content-type', 'application/json; charset=utf-8')] {"owned_private_repos":0,"private_gists":0,"type":"Organization","following":0,"company":null,"html_url":"https://github.com/BeaverSoftware","blog":null,"avatar_url":"https://secure.gravatar.com/avatar/d563e337cac2fdc644e2aaaad1e23266?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png","followers":0,"url":"https://api.github.com/orgs/BeaverSoftware","public_repos":2,"login":"BeaverSoftware","collaborators":0,"email":null,"disk_usage":112,"plan":{"private_repos":0,"space":307200,"name":"free"},"created_at":"2012-02-09T19:20:12Z","name":null,"total_private_repos":0,"billing_email":"BeaverSoftware@vincent-jacques.net","public_gists":0,"id":1424031,"location":"Paris, France"} diff --git a/github/tests/ReplayData/PullRequest.testCreateComment.txt b/github/tests/ReplayData/PullRequest.testCreateComment.txt index 6c4d7ef7..39a16e55 100644 --- a/github/tests/ReplayData/PullRequest.testCreateComment.txt +++ b/github/tests/ReplayData/PullRequest.testCreateComment.txt @@ -1,9 +1,9 @@ https GET api.github.com None /repos/jacquev6/PyGithub/commits/8a4f306d4b223682dd19410d4a9150636ebe4206 {'Authorization': 'Basic login_and_password_removed'} null 200 [('status', '200 OK'), ('x-ratelimit-remaining', '4989'), ('content-length', '19468'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"54236e7f65246e5fdb1122bd461e4a5d"'), ('date', 'Fri, 01 Jun 2012 19:43:25 GMT'), ('content-type', 'application/json; charset=utf-8')] -{"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","stats":{"additions":131,"total":135,"deletions":4},"files":[{"changes":17,"additions":14,"status":"modified","sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","patch":"@@ -110,7 +110,7 @@ def user( self ):\n return self.__user\n \n def add_to_labels( self, *labels ):\n- post_parameters = labels\n+ post_parameters = [ label.name for label in labels ]\n status, headers, data = self.__requester.request(\n \"POST\",\n str( self.url ) + \"/labels\",\n@@ -131,7 +131,12 @@ def create_comment( self, body ):\n return IssueComment.IssueComment( self.__requester, data, completion = NoCompletion )\n \n def delete_labels( self ):\n- pass\n+ status, headers, data = self.__requester.request(\n+ \"DELETE\",\n+ str( self.url ) + \"/labels\",\n+ None,\n+ None\n+ )\n \n def edit( self, title = DefaultValueForOptionalParameters, body = DefaultValueForOptionalParameters, assignee = DefaultValueForOptionalParameters, state = DefaultValueForOptionalParameters, milestone = DefaultValueForOptionalParameters, labels = DefaultValueForOptionalParameters ):\n post_parameters = {\n@@ -216,7 +221,13 @@ def remove_from_labels( self, label ):\n )\n \n def set_labels( self, *labels ):\n- pass\n+ post_parameters = [ label.name for label in labels ]\n+ status, headers, data = self.__requester.request(\n+ \"PUT\",\n+ str( self.url ) + \"/labels\",\n+ None,\n+ post_parameters\n+ )\n \n def __initAttributes( self ):\n self.__assignee = None","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Issue.py","filename":"src/github/Issue.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Issue.py","deletions":3},{"changes":7,"additions":7,"status":"modified","sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","patch":"@@ -1,6 +1,8 @@\n # WARNING: this file is generated automaticaly.\n # Do not modify it manually, your work would be lost.\n \n+import urllib\n+\n import PaginatedList\n from GithubObject import *\n \n@@ -43,6 +45,11 @@ def edit( self, name, color ):\n )\n self.__useAttributes( data )\n \n+ # @toto Remove '_identity' from the normalized json description\n+ @property\n+ def _identity( self ):\n+ return urllib.quote( self.name )\n+\n def __initAttributes( self ):\n self.__color = None\n self.__name = None","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Label.py","filename":"src/github/Label.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Label.py","deletions":0},{"changes":26,"additions":25,"status":"modified","sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","patch":"@@ -3,7 +3,8 @@\n class Issue( Framework.TestCase ):\r\n def setUp( self ):\r\n Framework.TestCase.setUp( self )\r\n- self.issue = self.g.get_user().get_repo( \"PyGithub\" ).get_issue( 28 )\r\n+ self.repo = self.g.get_user().get_repo( \"PyGithub\" )\r\n+ self.issue = self.repo.get_issue( 28 )\r\n \r\n def testAttributes( self ):\r\n self.assertEqual( self.issue.assignee.login, \"jacquev6\" )\r\n@@ -47,3 +48,26 @@ def testGetComments( self ):\n \r\n def testGetEvents( self ):\r\n self.assertListKeyEqual( self.issue.get_events(), lambda e: e.id, [ 15819975, 15820048 ] )\r\n+\r\n+ def testGetLabels( self ):\r\n+ self.assertListKeyEqual( self.issue.get_labels(), lambda l: l.name, [ \"Bug\", \"Project management\", \"Question\" ] )\r\n+\r\n+ def testAddAndRemoveLabels( self ):\r\n+ bug = self.repo.get_label( \"Bug\" )\r\n+ question = self.repo.get_label( \"Question\" )\r\n+ self.assertListKeyEqual( self.issue.get_labels(), lambda l: l.name, [ \"Bug\", \"Project management\", \"Question\" ] )\r\n+ self.issue.remove_from_labels( bug )\r\n+ self.assertListKeyEqual( self.issue.get_labels(), lambda l: l.name, [ \"Project management\", \"Question\" ] )\r\n+ self.issue.remove_from_labels( question )\r\n+ self.assertListKeyEqual( self.issue.get_labels(), lambda l: l.name, [ \"Project management\" ] )\r\n+ self.issue.add_to_labels( bug, question )\r\n+ self.assertListKeyEqual( self.issue.get_labels(), lambda l: l.name, [ \"Bug\", \"Project management\", \"Question\" ] )\r\n+\r\n+ def testDeleteAndSetLabels( self ):\r\n+ bug = self.repo.get_label( \"Bug\" )\r\n+ question = self.repo.get_label( \"Question\" )\r\n+ self.assertListKeyEqual( self.issue.get_labels(), lambda l: l.name, [ \"Bug\", \"Project management\", \"Question\" ] )\r\n+ self.issue.delete_labels()\r\n+ self.assertListKeyEqual( self.issue.get_labels(), lambda l: l.name, [] )\r\n+ self.issue.set_labels( bug, question )\r\n+ self.assertListKeyEqual( self.issue.get_labels(), lambda l: l.name, [ \"Bug\", \"Question\" ] )\r","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/test/Issue.py","filename":"test/Issue.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/test/Issue.py","deletions":1},{"changes":45,"additions":45,"status":"added","sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","patch":"@@ -0,0 +1,45 @@\n+GET /repos/jacquev6/PyGithub/labels/Bug {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4992'), ('content-length', '97'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"569c414d87e8ec43ec269a9e28bc2982\"'), ('date', 'Sun, 27 May 2012 09:04:01 GMT'), ('content-type', 'application/json; charset=utf-8')]\n+{\"color\":\"e10c02\",\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug\",\"name\":\"Bug\"}\n+\n+GET /repos/jacquev6/PyGithub/labels/Question {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4991'), ('content-length', '107'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"b659c8dcc1212c71f826547c3cc7ae99\"'), ('date', 'Sun, 27 May 2012 09:04:02 GMT'), ('content-type', 'application/json; charset=utf-8')]\n+{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\",\"color\":\"02e10c\"}\n+\n+GET /repos/jacquev6/PyGithub/issues/28/labels {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4990'), ('content-length', '335'), ('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')]\n+[{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug\",\"name\":\"Bug\",\"color\":\"e10c02\"},{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Project+management\",\"name\":\"Project management\",\"color\":\"444444\"},{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\",\"color\":\"02e10c\"}]\n+\n+DELETE /repos/jacquev6/PyGithub/issues/28/labels/Bug {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4989'), ('content-length', '237'), ('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')]\n+[{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Project+management\",\"name\":\"Project management\",\"color\":\"444444\"},{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\",\"color\":\"02e10c\"}]\n+\n+GET /repos/jacquev6/PyGithub/issues/28/labels {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4988'), ('content-length', '237'), ('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')]\n+[{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Project+management\",\"name\":\"Project management\",\"color\":\"444444\"},{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\",\"color\":\"02e10c\"}]\n+\n+DELETE /repos/jacquev6/PyGithub/issues/28/labels/Question {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4987'), ('content-length', '129'), ('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')]\n+[{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Project+management\",\"name\":\"Project management\",\"color\":\"444444\"}]\n+\n+GET /repos/jacquev6/PyGithub/issues/28/labels {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4986'), ('content-length', '129'), ('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')]\n+[{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Project+management\",\"name\":\"Project management\",\"color\":\"444444\"}]\n+\n+POST /repos/jacquev6/PyGithub/issues/28/labels {'Authorization': 'Basic login_and_password_removed'} [\"Bug\", \"Question\"]\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4985'), ('content-length', '335'), ('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')]\n+[{\"color\":\"e10c02\",\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug\",\"name\":\"Bug\"},{\"color\":\"444444\",\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Project+management\",\"name\":\"Project management\"},{\"color\":\"02e10c\",\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\"}]\n+\n+GET /repos/jacquev6/PyGithub/issues/28/labels {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4984'), ('content-length', '335'), ('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')]\n+[{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug\",\"name\":\"Bug\",\"color\":\"e10c02\"},{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Project+management\",\"name\":\"Project management\",\"color\":\"444444\"},{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\",\"color\":\"02e10c\"}]\n+","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/test/ReplayData/Issue.testAddAndRemoveLabels.txt","filename":"test/ReplayData/Issue.testAddAndRemoveLabels.txt","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/test/ReplayData/Issue.testAddAndRemoveLabels.txt","deletions":0},{"changes":35,"additions":35,"status":"added","sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","patch":"@@ -0,0 +1,35 @@\n+GET /repos/jacquev6/PyGithub/labels/Bug {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4974'), ('content-length', '97'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"fe2e942523eecb156d100829a6347516\"'), ('date', 'Sun, 27 May 2012 09:06:37 GMT'), ('content-type', 'application/json; charset=utf-8')]\n+{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug\",\"name\":\"Bug\",\"color\":\"e10c02\"}\n+\n+GET /repos/jacquev6/PyGithub/labels/Question {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4973'), ('content-length', '107'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"931e58d337b2290717303141eda89cd7\"'), ('date', 'Sun, 27 May 2012 09:06:38 GMT'), ('content-type', 'application/json; charset=utf-8')]\n+{\"color\":\"02e10c\",\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\"}\n+\n+GET /repos/jacquev6/PyGithub/issues/28/labels {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4972'), ('content-length', '335'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"d135d74d2ea2159d044676a220d41d3a\"'), ('date', 'Sun, 27 May 2012 09:06:39 GMT'), ('content-type', 'application/json; charset=utf-8')]\n+[{\"color\":\"e10c02\",\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug\",\"name\":\"Bug\"},{\"color\":\"444444\",\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Project+management\",\"name\":\"Project management\"},{\"color\":\"02e10c\",\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\"}]\n+\n+DELETE /repos/jacquev6/PyGithub/issues/28/labels {'Authorization': 'Basic login_and_password_removed'} null\n+204\n+[('status', '204 No Content'), ('x-ratelimit-remaining', '4971'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"d41d8cd98f00b204e9800998ecf8427e\"'), ('date', 'Sun, 27 May 2012 09:06:39 GMT')]\n+\n+\n+GET /repos/jacquev6/PyGithub/issues/28/labels {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4970'), ('content-length', '2'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"d751713988987e9331980363e24189ce\"'), ('date', 'Sun, 27 May 2012 09:06:40 GMT'), ('content-type', 'application/json; charset=utf-8')]\n+[]\n+\n+PUT /repos/jacquev6/PyGithub/issues/28/labels {'Authorization': 'Basic login_and_password_removed'} [\"Bug\", \"Question\"]\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4969'), ('content-length', '207'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"1a56634d9c1050a88592ff55ed8adc62\"'), ('date', 'Sun, 27 May 2012 09:06:40 GMT'), ('content-type', 'application/json; charset=utf-8')]\n+[{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug\",\"name\":\"Bug\",\"color\":\"e10c02\"},{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\",\"color\":\"02e10c\"}]\n+\n+GET /repos/jacquev6/PyGithub/issues/28/labels {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4968'), ('content-length', '207'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"1a56634d9c1050a88592ff55ed8adc62\"'), ('date', 'Sun, 27 May 2012 09:06:41 GMT'), ('content-type', 'application/json; charset=utf-8')]\n+[{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug\",\"name\":\"Bug\",\"color\":\"e10c02\"},{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\",\"color\":\"02e10c\"}]\n+","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/test/ReplayData/Issue.testDeleteAndSetLabels.txt","filename":"test/ReplayData/Issue.testDeleteAndSetLabels.txt","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/test/ReplayData/Issue.testDeleteAndSetLabels.txt","deletions":0},{"changes":5,"additions":5,"status":"added","sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","patch":"@@ -0,0 +1,5 @@\n+GET /repos/jacquev6/PyGithub/issues/28/labels {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4996'), ('content-length', '335'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"c9f9beccb03030beaf7b80927da6fef6\"'), ('date', 'Sun, 27 May 2012 08:56:31 GMT'), ('content-type', 'application/json; charset=utf-8')]\n+[{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug\",\"name\":\"Bug\",\"color\":\"e10c02\"},{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Project+management\",\"name\":\"Project management\",\"color\":\"444444\"},{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\",\"color\":\"02e10c\"}]\n+","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/test/ReplayData/Issue.testGetLabels.txt","filename":"test/ReplayData/Issue.testGetLabels.txt","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/test/ReplayData/Issue.testGetLabels.txt","deletions":0}],"parents":[{"sha":"93dcae5cf207de376c91d0599226e7c7563e1d16","url":"https://api.github.com/repos/jacquev6/PyGithub/commits/93dcae5cf207de376c91d0599226e7c7563e1d16"}],"commit":{"tree":{"sha":"fa0251344d6b0b9f69f33c1faf6e3323001b309d","url":"https://api.github.com/repos/jacquev6/PyGithub/git/trees/fa0251344d6b0b9f69f33c1faf6e3323001b309d"},"message":"Test (and implement) Issue.*_label*\n\nAnd this commit will be used to test PullRequests","url":"https://api.github.com/repos/jacquev6/PyGithub/git/commits/8a4f306d4b223682dd19410d4a9150636ebe4206","author":{"email":"vincent@vincent-jacques.net","date":"2012-05-27T02:07:47-07:00","name":"Vincent Jacques"},"committer":{"email":"vincent@vincent-jacques.net","date":"2012-05-27T02:07:47-07:00","name":"Vincent Jacques"}},"author":{"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","url":"https://api.github.com/users/jacquev6","id":327146},"url":"https://api.github.com/repos/jacquev6/PyGithub/commits/8a4f306d4b223682dd19410d4a9150636ebe4206","committer":{"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","url":"https://api.github.com/users/jacquev6","id":327146}} +{"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","stats":{"additions":131,"total":135,"deletions":4},"files":[{"changes":17,"additions":14,"status":"modified","sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","patch":"@@ -110,7 +110,7 @@ def user( self ):\n return self.__user\n \n def add_to_labels( self, *labels ):\n- post_parameters = labels\n+ post_parameters = [ label.name for label in labels ]\n status, headers, data = self.__requester.request(\n \"POST\",\n str( self.url ) + \"/labels\",\n@@ -131,7 +131,12 @@ def create_comment( self, body ):\n return IssueComment.IssueComment( self.__requester, data, completion = NoCompletion )\n \n def delete_labels( self ):\n- pass\n+ status, headers, data = self.__requester.request(\n+ \"DELETE\",\n+ str( self.url ) + \"/labels\",\n+ None,\n+ None\n+ )\n \n def edit( self, title = DefaultValueForOptionalParameters, body = DefaultValueForOptionalParameters, assignee = DefaultValueForOptionalParameters, state = DefaultValueForOptionalParameters, milestone = DefaultValueForOptionalParameters, labels = DefaultValueForOptionalParameters ):\n post_parameters = {\n@@ -216,7 +221,13 @@ def remove_from_labels( self, label ):\n )\n \n def set_labels( self, *labels ):\n- pass\n+ post_parameters = [ label.name for label in labels ]\n+ status, headers, data = self.__requester.request(\n+ \"PUT\",\n+ str( self.url ) + \"/labels\",\n+ None,\n+ post_parameters\n+ )\n \n def __initAttributes( self ):\n self.__assignee = None","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Issue.py","filename":"src/github/Issue.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Issue.py","deletions":3},{"changes":7,"additions":7,"status":"modified","sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","patch":"@@ -1,6 +1,8 @@\n # WARNING: this file is generated automaticaly.\n # Do not modify it manually, your work would be lost.\n \n+import urllib\n+\n import PaginatedList\n from GithubObject import *\n \n@@ -43,6 +45,11 @@ def edit( self, name, color ):\n )\n self.__useAttributes( data )\n \n+ # @toto Remove '_identity' from the normalized json description\n+ @property\n+ def _identity( self ):\n+ return urllib.quote( self.name )\n+\n def __initAttributes( self ):\n self.__color = None\n self.__name = None","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Label.py","filename":"src/github/Label.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Label.py","deletions":0},{"changes":26,"additions":25,"status":"modified","sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","patch":"@@ -3,7 +3,8 @@\n class Issue( Framework.TestCase ):\r\n def setUp( self ):\r\n Framework.TestCase.setUp( self )\r\n- self.issue = self.g.get_user().get_repo( \"PyGithub\" ).get_issue( 28 )\r\n+ self.repo = self.g.get_user().get_repo( \"PyGithub\" )\r\n+ self.issue = self.repo.get_issue( 28 )\r\n \r\n def testAttributes( self ):\r\n self.assertEqual( self.issue.assignee.login, \"jacquev6\" )\r\n@@ -47,3 +48,26 @@ def testGetComments( self ):\n \r\n def testGetEvents( self ):\r\n self.assertListKeyEqual( self.issue.get_events(), lambda e: e.id, [ 15819975, 15820048 ] )\r\n+\r\n+ def testGetLabels( self ):\r\n+ self.assertListKeyEqual( self.issue.get_labels(), lambda l: l.name, [ \"Bug\", \"Project management\", \"Question\" ] )\r\n+\r\n+ def testAddAndRemoveLabels( self ):\r\n+ bug = self.repo.get_label( \"Bug\" )\r\n+ question = self.repo.get_label( \"Question\" )\r\n+ self.assertListKeyEqual( self.issue.get_labels(), lambda l: l.name, [ \"Bug\", \"Project management\", \"Question\" ] )\r\n+ self.issue.remove_from_labels( bug )\r\n+ self.assertListKeyEqual( self.issue.get_labels(), lambda l: l.name, [ \"Project management\", \"Question\" ] )\r\n+ self.issue.remove_from_labels( question )\r\n+ self.assertListKeyEqual( self.issue.get_labels(), lambda l: l.name, [ \"Project management\" ] )\r\n+ self.issue.add_to_labels( bug, question )\r\n+ self.assertListKeyEqual( self.issue.get_labels(), lambda l: l.name, [ \"Bug\", \"Project management\", \"Question\" ] )\r\n+\r\n+ def testDeleteAndSetLabels( self ):\r\n+ bug = self.repo.get_label( \"Bug\" )\r\n+ question = self.repo.get_label( \"Question\" )\r\n+ self.assertListKeyEqual( self.issue.get_labels(), lambda l: l.name, [ \"Bug\", \"Project management\", \"Question\" ] )\r\n+ self.issue.delete_labels()\r\n+ self.assertListKeyEqual( self.issue.get_labels(), lambda l: l.name, [] )\r\n+ self.issue.set_labels( bug, question )\r\n+ self.assertListKeyEqual( self.issue.get_labels(), lambda l: l.name, [ \"Bug\", \"Question\" ] )\r","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/test/Issue.py","filename":"test/Issue.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/test/Issue.py","deletions":1},{"changes":45,"additions":45,"status":"added","sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","patch":"@@ -0,0 +1,45 @@\n+GET /repos/jacquev6/PyGithub/labels/Bug {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4992'), ('content-length', '97'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"569c414d87e8ec43ec269a9e28bc2982\"'), ('date', 'Sun, 27 May 2012 09:04:01 GMT'), ('content-type', 'application/json; charset=utf-8')]\n+{\"color\":\"e10c02\",\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug\",\"name\":\"Bug\"}\n+\n+GET /repos/jacquev6/PyGithub/labels/Question {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4991'), ('content-length', '107'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"b659c8dcc1212c71f826547c3cc7ae99\"'), ('date', 'Sun, 27 May 2012 09:04:02 GMT'), ('content-type', 'application/json; charset=utf-8')]\n+{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\",\"color\":\"02e10c\"}\n+\n+GET /repos/jacquev6/PyGithub/issues/28/labels {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4990'), ('content-length', '335'), ('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')]\n+[{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug\",\"name\":\"Bug\",\"color\":\"e10c02\"},{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Project+management\",\"name\":\"Project management\",\"color\":\"444444\"},{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\",\"color\":\"02e10c\"}]\n+\n+DELETE /repos/jacquev6/PyGithub/issues/28/labels/Bug {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4989'), ('content-length', '237'), ('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')]\n+[{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Project+management\",\"name\":\"Project management\",\"color\":\"444444\"},{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\",\"color\":\"02e10c\"}]\n+\n+GET /repos/jacquev6/PyGithub/issues/28/labels {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4988'), ('content-length', '237'), ('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')]\n+[{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Project+management\",\"name\":\"Project management\",\"color\":\"444444\"},{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\",\"color\":\"02e10c\"}]\n+\n+DELETE /repos/jacquev6/PyGithub/issues/28/labels/Question {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4987'), ('content-length', '129'), ('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')]\n+[{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Project+management\",\"name\":\"Project management\",\"color\":\"444444\"}]\n+\n+GET /repos/jacquev6/PyGithub/issues/28/labels {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4986'), ('content-length', '129'), ('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')]\n+[{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Project+management\",\"name\":\"Project management\",\"color\":\"444444\"}]\n+\n+POST /repos/jacquev6/PyGithub/issues/28/labels {'Authorization': 'Basic login_and_password_removed'} [\"Bug\", \"Question\"]\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4985'), ('content-length', '335'), ('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')]\n+[{\"color\":\"e10c02\",\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug\",\"name\":\"Bug\"},{\"color\":\"444444\",\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Project+management\",\"name\":\"Project management\"},{\"color\":\"02e10c\",\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\"}]\n+\n+GET /repos/jacquev6/PyGithub/issues/28/labels {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4984'), ('content-length', '335'), ('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')]\n+[{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug\",\"name\":\"Bug\",\"color\":\"e10c02\"},{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Project+management\",\"name\":\"Project management\",\"color\":\"444444\"},{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\",\"color\":\"02e10c\"}]\n+","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/test/ReplayData/Issue.testAddAndRemoveLabels.txt","filename":"test/ReplayData/Issue.testAddAndRemoveLabels.txt","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/test/ReplayData/Issue.testAddAndRemoveLabels.txt","deletions":0},{"changes":35,"additions":35,"status":"added","sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","patch":"@@ -0,0 +1,35 @@\n+GET /repos/jacquev6/PyGithub/labels/Bug {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4974'), ('content-length', '97'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"fe2e942523eecb156d100829a6347516\"'), ('date', 'Sun, 27 May 2012 09:06:37 GMT'), ('content-type', 'application/json; charset=utf-8')]\n+{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug\",\"name\":\"Bug\",\"color\":\"e10c02\"}\n+\n+GET /repos/jacquev6/PyGithub/labels/Question {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4973'), ('content-length', '107'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"931e58d337b2290717303141eda89cd7\"'), ('date', 'Sun, 27 May 2012 09:06:38 GMT'), ('content-type', 'application/json; charset=utf-8')]\n+{\"color\":\"02e10c\",\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\"}\n+\n+GET /repos/jacquev6/PyGithub/issues/28/labels {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4972'), ('content-length', '335'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"d135d74d2ea2159d044676a220d41d3a\"'), ('date', 'Sun, 27 May 2012 09:06:39 GMT'), ('content-type', 'application/json; charset=utf-8')]\n+[{\"color\":\"e10c02\",\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug\",\"name\":\"Bug\"},{\"color\":\"444444\",\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Project+management\",\"name\":\"Project management\"},{\"color\":\"02e10c\",\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\"}]\n+\n+DELETE /repos/jacquev6/PyGithub/issues/28/labels {'Authorization': 'Basic login_and_password_removed'} null\n+204\n+[('status', '204 No Content'), ('x-ratelimit-remaining', '4971'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"d41d8cd98f00b204e9800998ecf8427e\"'), ('date', 'Sun, 27 May 2012 09:06:39 GMT')]\n+\n+\n+GET /repos/jacquev6/PyGithub/issues/28/labels {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4970'), ('content-length', '2'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"d751713988987e9331980363e24189ce\"'), ('date', 'Sun, 27 May 2012 09:06:40 GMT'), ('content-type', 'application/json; charset=utf-8')]\n+[]\n+\n+PUT /repos/jacquev6/PyGithub/issues/28/labels {'Authorization': 'Basic login_and_password_removed'} [\"Bug\", \"Question\"]\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4969'), ('content-length', '207'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"1a56634d9c1050a88592ff55ed8adc62\"'), ('date', 'Sun, 27 May 2012 09:06:40 GMT'), ('content-type', 'application/json; charset=utf-8')]\n+[{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug\",\"name\":\"Bug\",\"color\":\"e10c02\"},{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\",\"color\":\"02e10c\"}]\n+\n+GET /repos/jacquev6/PyGithub/issues/28/labels {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4968'), ('content-length', '207'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"1a56634d9c1050a88592ff55ed8adc62\"'), ('date', 'Sun, 27 May 2012 09:06:41 GMT'), ('content-type', 'application/json; charset=utf-8')]\n+[{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug\",\"name\":\"Bug\",\"color\":\"e10c02\"},{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\",\"color\":\"02e10c\"}]\n+","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/test/ReplayData/Issue.testDeleteAndSetLabels.txt","filename":"test/ReplayData/Issue.testDeleteAndSetLabels.txt","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/test/ReplayData/Issue.testDeleteAndSetLabels.txt","deletions":0},{"changes":5,"additions":5,"status":"added","sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","patch":"@@ -0,0 +1,5 @@\n+GET /repos/jacquev6/PyGithub/issues/28/labels {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4996'), ('content-length', '335'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"c9f9beccb03030beaf7b80927da6fef6\"'), ('date', 'Sun, 27 May 2012 08:56:31 GMT'), ('content-type', 'application/json; charset=utf-8')]\n+[{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug\",\"name\":\"Bug\",\"color\":\"e10c02\"},{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Project+management\",\"name\":\"Project management\",\"color\":\"444444\"},{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\",\"color\":\"02e10c\"}]\n+","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/test/ReplayData/Issue.testGetLabels.txt","filename":"test/ReplayData/Issue.testGetLabels.txt","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/test/ReplayData/Issue.testGetLabels.txt","deletions":0}],"parents":[{"sha":"93dcae5cf207de376c91d0599226e7c7563e1d16","url":"https://api.github.com/repos/jacquev6/PyGithub/commits/93dcae5cf207de376c91d0599226e7c7563e1d16"}],"commit":{"tree":{"sha":"fa0251344d6b0b9f69f33c1faf6e3323001b309d","url":"https://api.github.com/repos/jacquev6/PyGithub/git/trees/fa0251344d6b0b9f69f33c1faf6e3323001b309d"},"message":"Test (and implement) Issue.*_label*\n\nAnd this commit will be used to test PullRequests","url":"https://api.github.com/repos/jacquev6/PyGithub/git/commits/8a4f306d4b223682dd19410d4a9150636ebe4206","author":{"email":"vincent@vincent-jacques.net","date":"2012-05-27T02:07:47-07:00","name":"Vincent Jacques"},"committer":{"email":"vincent@vincent-jacques.net","date":"2012-05-27T02:07:47-07:00","name":"Vincent Jacques"}},"author":{"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","url":"https://api.github.com/users/jacquev6","id":327146},"url":"https://api.github.com/repos/jacquev6/PyGithub/commits/8a4f306d4b223682dd19410d4a9150636ebe4206","committer":{"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","url":"https://api.github.com/users/jacquev6","id":327146}} -https POST api.github.com None /repos/jacquev6/PyGithub/pulls/31/comments {'Authorization': 'Basic login_and_password_removed'} {"body": "Comment created by PyGithub", "commit_id": "8a4f306d4b223682dd19410d4a9150636ebe4206", "position": 5, "path": "src/github/Issue.py"} +https POST api.github.com None /repos/jacquev6/PyGithub/pulls/31/comments {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"body": "Comment created by PyGithub", "commit_id": "8a4f306d4b223682dd19410d4a9150636ebe4206", "position": 5, "path": "src/github/Issue.py"} 201 [('status', '201 Created'), ('x-ratelimit-remaining', '4953'), ('content-length', '937'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"7ca841d45253326d61bee20c809872dc"'), ('date', 'Sun, 27 May 2012 09:40:12 GMT'), ('content-type', 'application/json; charset=utf-8'), ('location', 'https://api.github.com/repos/jacquev6/PyGithub/pulls/comments/886298')] {"updated_at":"2012-05-27T09:40:12Z","position":5,"original_position":5,"body":"Comment created by PyGithub","url":"https://api.github.com/repos/jacquev6/PyGithub/pulls/comments/886298","commit_id":"8a4f306d4b223682dd19410d4a9150636ebe4206","created_at":"2012-05-27T09:40:12Z","user":{"url":"https://api.github.com/users/jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146},"original_commit_id":"8a4f306d4b223682dd19410d4a9150636ebe4206","path":"src/github/Issue.py","id":886298,"_links":{"self":{"href":"https://api.github.com/repos/jacquev6/PyGithub/pulls/comments/886298"},"html":{"href":"https://github.com/jacquev6/PyGithub/pull/31#r886298"},"pull_request":{"href":"https://api.github.com/repos/jacquev6/PyGithub/pulls/31"}}} diff --git a/github/tests/ReplayData/PullRequest.testCreateIssueComment.txt b/github/tests/ReplayData/PullRequest.testCreateIssueComment.txt index 839d2ff7..cc06f0f8 100644 --- a/github/tests/ReplayData/PullRequest.testCreateIssueComment.txt +++ b/github/tests/ReplayData/PullRequest.testCreateIssueComment.txt @@ -1,4 +1,4 @@ -https POST api.github.com None /repos/jacquev6/PyGithub/issues/31/comments {'Authorization': 'Basic login_and_password_removed'} {"body": "Issue comment created by PyGithub"} +https POST api.github.com None /repos/jacquev6/PyGithub/issues/31/comments {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"body": "Issue comment created by PyGithub"} 201 [('status', '201 Created'), ('content-length', '517'), ('x-github-media-type', 'github.beta; format=json'), ('x-content-type-options', 'nosniff'), ('x-ratelimit-remaining', '4976'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('location', 'https://api.github.com/repos/jacquev6/PyGithub/issues/comments/8387331'), ('cache-control', 'max-age=0, private, must-revalidate'), ('date', 'Sat, 08 Sep 2012 12:57:51 GMT'), ('etag', '"6d189ee4b6415276097b091d11a77ce0"'), ('content-type', 'application/json; charset=utf-8')] {"body":"Issue comment created by PyGithub","user":{"gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png","url":"https://api.github.com/users/jacquev6","id":327146},"created_at":"2012-09-08T12:57:51Z","updated_at":"2012-09-08T12:57:51Z","url":"https://api.github.com/repos/jacquev6/PyGithub/issues/comments/8387331","id":8387331} diff --git a/github/tests/ReplayData/PullRequest.testEditWithAllArguments.txt b/github/tests/ReplayData/PullRequest.testEditWithAllArguments.txt index 358970d5..af911e43 100644 --- a/github/tests/ReplayData/PullRequest.testEditWithAllArguments.txt +++ b/github/tests/ReplayData/PullRequest.testEditWithAllArguments.txt @@ -1,4 +1,4 @@ -https PATCH api.github.com None /repos/jacquev6/PyGithub/pulls/31 {'Authorization': 'Basic login_and_password_removed'} {"body": "Body edited by PyGithub", "state": "open", "title": "Title edited by PyGithub"} +https PATCH api.github.com None /repos/jacquev6/PyGithub/pulls/31 {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"body": "Body edited by PyGithub", "state": "open", "title": "Title edited by PyGithub"} 200 [('status', '200 OK'), ('x-ratelimit-remaining', '4979'), ('content-length', '4477'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"892e1599c76b5b026bc67423b4a69c26"'), ('date', 'Sun, 27 May 2012 10:18:08 GMT'), ('content-type', 'application/json; charset=utf-8')] {"merged_by":null,"user":{"gravatar_id":"b68de5ae38616c296fa345d2b9df2225","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/jacquev6","login":"jacquev6","id":327146},"title":"Title edited by PyGithub","state":"open","comments":0,"merged_at":null,"updated_at":"2012-05-27T10:18:08Z","deletions":384,"head":{"user":{"gravatar_id":"d563e337cac2fdc644e2aaaad1e23266","avatar_url":"https://secure.gravatar.com/avatar/d563e337cac2fdc644e2aaaad1e23266?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png","url":"https://api.github.com/users/BeaverSoftware","login":"BeaverSoftware","id":1424031},"repo":{"description":"Python library implementing the full Github API v3","full_name":"BeaverSoftware/PyGithub","has_wiki":false,"has_issues":false,"updated_at":"2012-05-27T09:09:17Z","forks":0,"mirror_url":null,"homepage":"http://vincent-jacques.net/PyGithub","ssh_url":"git@github.com:BeaverSoftware/PyGithub.git","open_issues":0,"fork":true,"svn_url":"https://github.com/BeaverSoftware/PyGithub","pushed_at":"2012-05-27T09:09:17Z","size":176,"html_url":"https://github.com/BeaverSoftware/PyGithub","private":false,"url":"https://api.github.com/repos/BeaverSoftware/PyGithub","clone_url":"https://github.com/BeaverSoftware/PyGithub.git","owner":{"gravatar_id":"d563e337cac2fdc644e2aaaad1e23266","avatar_url":"https://secure.gravatar.com/avatar/d563e337cac2fdc644e2aaaad1e23266?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png","url":"https://api.github.com/users/BeaverSoftware","login":"BeaverSoftware","id":1424031},"name":"PyGithub","has_downloads":true,"language":"Python","watchers":1,"git_url":"git://github.com/BeaverSoftware/PyGithub.git","id":4460787,"created_at":"2012-05-27T08:50:04Z"},"label":"BeaverSoftware:master","sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","ref":"master"},"body":"Body edited by PyGithub","merged":false,"additions":511,"number":31,"_links":{"comments":{"href":"https://api.github.com/repos/jacquev6/PyGithub/issues/31/comments"},"issue":{"href":"https://api.github.com/repos/jacquev6/PyGithub/issues/31"},"self":{"href":"https://api.github.com/repos/jacquev6/PyGithub/pulls/31"},"review_comments":{"href":"https://api.github.com/repos/jacquev6/PyGithub/pulls/31/comments"},"html":{"href":"https://github.com/jacquev6/PyGithub/pull/31"}},"closed_at":null,"diff_url":"https://github.com/jacquev6/PyGithub/pull/31.diff","mergeable":true,"commits":3,"changed_files":45,"html_url":"https://github.com/jacquev6/PyGithub/pull/31","url":"https://api.github.com/repos/jacquev6/PyGithub/pulls/31","review_comments":1,"issue_url":"https://github.com/jacquev6/PyGithub/issues/31","id":1436215,"base":{"user":{"gravatar_id":"b68de5ae38616c296fa345d2b9df2225","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/jacquev6","login":"jacquev6","id":327146},"repo":{"description":"Python library implementing the full Github API v3","full_name":"jacquev6/PyGithub","has_wiki":false,"has_issues":true,"updated_at":"2012-05-27T08:50:04Z","forks":3,"mirror_url":null,"homepage":"http://vincent-jacques.net/PyGithub","ssh_url":"git@github.com:jacquev6/PyGithub.git","open_issues":17,"fork":false,"svn_url":"https://github.com/jacquev6/PyGithub","pushed_at":"2012-05-27T07:29:24Z","size":308,"html_url":"https://github.com/jacquev6/PyGithub","private":false,"url":"https://api.github.com/repos/jacquev6/PyGithub","clone_url":"https://github.com/jacquev6/PyGithub.git","owner":{"gravatar_id":"b68de5ae38616c296fa345d2b9df2225","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/jacquev6","login":"jacquev6","id":327146},"name":"PyGithub","has_downloads":true,"language":"Python","watchers":15,"git_url":"git://github.com/jacquev6/PyGithub.git","id":3544490,"created_at":"2012-02-25T12:53:47Z"},"label":"jacquev6:topic/RewriteWithGeneratedCode","sha":"ed866fc43833802ab553e5ff8581c81bb00dd433","ref":"topic/RewriteWithGeneratedCode"},"created_at":"2012-05-27T09:25:36Z","patch_url":"https://github.com/jacquev6/PyGithub/pull/31.patch"} diff --git a/github/tests/ReplayData/PullRequest.testEditWithoutArguments.txt b/github/tests/ReplayData/PullRequest.testEditWithoutArguments.txt index 7e57f5d2..9ae82813 100644 --- a/github/tests/ReplayData/PullRequest.testEditWithoutArguments.txt +++ b/github/tests/ReplayData/PullRequest.testEditWithoutArguments.txt @@ -1,4 +1,4 @@ -https PATCH api.github.com None /repos/jacquev6/PyGithub/pulls/31 {'Authorization': 'Basic login_and_password_removed'} {} +https PATCH api.github.com None /repos/jacquev6/PyGithub/pulls/31 {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {} 200 [('status', '200 OK'), ('x-ratelimit-remaining', '4983'), ('content-length', '4486'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"f64654209621a4117940acf5b8ac7918"'), ('date', 'Sun, 27 May 2012 10:16:02 GMT'), ('content-type', 'application/json; charset=utf-8')] {"merged":false,"mergeable":true,"head":{"ref":"master","label":"BeaverSoftware:master","repo":{"clone_url":"https://github.com/BeaverSoftware/PyGithub.git","has_downloads":true,"watchers":1,"git_url":"git://github.com/BeaverSoftware/PyGithub.git","updated_at":"2012-05-27T09:09:17Z","homepage":"http://vincent-jacques.net/PyGithub","url":"https://api.github.com/repos/BeaverSoftware/PyGithub","mirror_url":null,"has_wiki":false,"has_issues":false,"fork":true,"forks":0,"size":176,"private":false,"open_issues":0,"svn_url":"https://github.com/BeaverSoftware/PyGithub","owner":{"url":"https://api.github.com/users/BeaverSoftware","avatar_url":"https://secure.gravatar.com/avatar/d563e337cac2fdc644e2aaaad1e23266?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png","gravatar_id":"d563e337cac2fdc644e2aaaad1e23266","login":"BeaverSoftware","id":1424031},"name":"PyGithub","language":"Python","description":"Python library implementing the full Github API v3","ssh_url":"git@github.com:BeaverSoftware/PyGithub.git","pushed_at":"2012-05-27T09:09:17Z","created_at":"2012-05-27T08:50:04Z","id":4460787,"html_url":"https://github.com/BeaverSoftware/PyGithub","full_name":"BeaverSoftware/PyGithub"},"user":{"url":"https://api.github.com/users/BeaverSoftware","avatar_url":"https://secure.gravatar.com/avatar/d563e337cac2fdc644e2aaaad1e23266?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png","gravatar_id":"d563e337cac2fdc644e2aaaad1e23266","login":"BeaverSoftware","id":1424031},"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},"updated_at":"2012-05-27T10:16:02Z","issue_url":"https://github.com/jacquev6/PyGithub/issues/31","body":"Body of the pull request","patch_url":"https://github.com/jacquev6/PyGithub/pull/31.patch","diff_url":"https://github.com/jacquev6/PyGithub/pull/31.diff","url":"https://api.github.com/repos/jacquev6/PyGithub/pulls/31","comments":0,"base":{"ref":"topic/RewriteWithGeneratedCode","label":"jacquev6:topic/RewriteWithGeneratedCode","repo":{"clone_url":"https://github.com/jacquev6/PyGithub.git","has_downloads":true,"watchers":15,"git_url":"git://github.com/jacquev6/PyGithub.git","updated_at":"2012-05-27T08:50:04Z","homepage":"http://vincent-jacques.net/PyGithub","url":"https://api.github.com/repos/jacquev6/PyGithub","mirror_url":null,"has_wiki":false,"has_issues":true,"fork":false,"forks":3,"size":308,"private":false,"open_issues":17,"svn_url":"https://github.com/jacquev6/PyGithub","owner":{"url":"https://api.github.com/users/jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146},"name":"PyGithub","language":"Python","description":"Python library implementing the full Github API v3","ssh_url":"git@github.com:jacquev6/PyGithub.git","pushed_at":"2012-05-27T07:29:24Z","created_at":"2012-02-25T12:53:47Z","id":3544490,"html_url":"https://github.com/jacquev6/PyGithub","full_name":"jacquev6/PyGithub"},"user":{"url":"https://api.github.com/users/jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146},"sha":"ed866fc43833802ab553e5ff8581c81bb00dd433"},"number":31,"merged_by":null,"closed_at":null,"title":"Pull request created by PyGithub","deletions":384,"merged_at":null,"_links":{"self":{"href":"https://api.github.com/repos/jacquev6/PyGithub/pulls/31"},"comments":{"href":"https://api.github.com/repos/jacquev6/PyGithub/issues/31/comments"},"issue":{"href":"https://api.github.com/repos/jacquev6/PyGithub/issues/31"},"html":{"href":"https://github.com/jacquev6/PyGithub/pull/31"},"review_comments":{"href":"https://api.github.com/repos/jacquev6/PyGithub/pulls/31/comments"}},"changed_files":45,"additions":511,"created_at":"2012-05-27T09:25:36Z","user":{"url":"https://api.github.com/users/jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146},"state":"open","id":1436215,"review_comments":1,"commits":3,"html_url":"https://github.com/jacquev6/PyGithub/pull/31"} diff --git a/github/tests/ReplayData/PullRequest.testGetFiles.txt b/github/tests/ReplayData/PullRequest.testGetFiles.txt index 161cce04..79092db2 100644 --- a/github/tests/ReplayData/PullRequest.testGetFiles.txt +++ b/github/tests/ReplayData/PullRequest.testGetFiles.txt @@ -1,5 +1,5 @@ https GET api.github.com None /repos/jacquev6/PyGithub/pulls/31/files {'Authorization': 'Basic login_and_password_removed'} null 200 [('status', '200 OK'), ('x-ratelimit-remaining', '4971'), ('content-length', '169480'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"a6f83dd38ea0a62d423fefb7b8353561"'), ('date', 'Sun, 27 May 2012 10:21:15 GMT'), ('content-type', 'application/json; charset=utf-8')] -[{"patch":"@@ -70,7 +70,7 @@ def __useAttributes( self, attributes ):\n \n # @toto No need to check if attribute is in attributes when attribute is mandatory\n {% for attribute in class.attributes|dictsort:\"name\" %}\n- if \"{{ attribute.name }}\" in attributes and attributes[ \"{{ attribute.name }}\" ] is not None:\n+ if \"{{ attribute.name }}\" in attributes and attributes[ \"{{ attribute.name }}\" ] is not None: # pragma no branch\n \n {% if attribute.type.cardinality == \"scalar\" %}\n {% if attribute.type.simple %}","status":"modified","deletions":1,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/codegen/templates/GithubObject.py","changes":2,"additions":1,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/codegen/templates/GithubObject.py","filename":"codegen/templates/GithubObject.py"},{"patch":"@@ -568,78 +568,78 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"avatar_url\", \"bio\", \"blog\", \"collaborators\", \"company\", \"created_at\", \"disk_usage\", \"email\", \"followers\", \"following\", \"gravatar_id\", \"hireable\", \"html_url\", \"id\", \"location\", \"login\", \"name\", \"owned_private_repos\", \"plan\", \"private_gists\", \"public_gists\", \"public_repos\", \"total_private_repos\", \"type\", \"url\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"avatar_url\" in attributes and attributes[ \"avatar_url\" ] is not None:\n+ if \"avatar_url\" in attributes and attributes[ \"avatar_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"avatar_url\" ], ( str, unicode ) )\n self.__avatar_url = attributes[ \"avatar_url\" ]\n- if \"bio\" in attributes and attributes[ \"bio\" ] is not None:\n+ if \"bio\" in attributes and attributes[ \"bio\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"bio\" ], ( str, unicode ) )\n self.__bio = attributes[ \"bio\" ]\n- if \"blog\" in attributes and attributes[ \"blog\" ] is not None:\n+ if \"blog\" in attributes and attributes[ \"blog\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"blog\" ], ( str, unicode ) )\n self.__blog = attributes[ \"blog\" ]\n- if \"collaborators\" in attributes and attributes[ \"collaborators\" ] is not None:\n+ if \"collaborators\" in attributes and attributes[ \"collaborators\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"collaborators\" ], int )\n self.__collaborators = attributes[ \"collaborators\" ]\n- if \"company\" in attributes and attributes[ \"company\" ] is not None:\n+ if \"company\" in attributes and attributes[ \"company\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"company\" ], ( str, unicode ) )\n self.__company = attributes[ \"company\" ]\n- if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None:\n+ if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"created_at\" ], ( str, unicode ) )\n self.__created_at = attributes[ \"created_at\" ]\n- if \"disk_usage\" in attributes and attributes[ \"disk_usage\" ] is not None:\n+ if \"disk_usage\" in attributes and attributes[ \"disk_usage\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"disk_usage\" ], int )\n self.__disk_usage = attributes[ \"disk_usage\" ]\n- if \"email\" in attributes and attributes[ \"email\" ] is not None:\n+ if \"email\" in attributes and attributes[ \"email\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"email\" ], ( str, unicode ) )\n self.__email = attributes[ \"email\" ]\n- if \"followers\" in attributes and attributes[ \"followers\" ] is not None:\n+ if \"followers\" in attributes and attributes[ \"followers\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"followers\" ], int )\n self.__followers = attributes[ \"followers\" ]\n- if \"following\" in attributes and attributes[ \"following\" ] is not None:\n+ if \"following\" in attributes and attributes[ \"following\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"following\" ], int )\n self.__following = attributes[ \"following\" ]\n- if \"gravatar_id\" in attributes and attributes[ \"gravatar_id\" ] is not None:\n+ if \"gravatar_id\" in attributes and attributes[ \"gravatar_id\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"gravatar_id\" ], ( str, unicode ) )\n self.__gravatar_id = attributes[ \"gravatar_id\" ]\n- if \"hireable\" in attributes and attributes[ \"hireable\" ] is not None:\n+ if \"hireable\" in attributes and attributes[ \"hireable\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"hireable\" ], bool )\n self.__hireable = attributes[ \"hireable\" ]\n- if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None:\n+ if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"html_url\" ], ( str, unicode ) )\n self.__html_url = attributes[ \"html_url\" ]\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"id\" ], int )\n self.__id = attributes[ \"id\" ]\n- if \"location\" in attributes and attributes[ \"location\" ] is not None:\n+ if \"location\" in attributes and attributes[ \"location\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"location\" ], ( str, unicode ) )\n self.__location = attributes[ \"location\" ]\n- if \"login\" in attributes and attributes[ \"login\" ] is not None:\n+ if \"login\" in attributes and attributes[ \"login\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"login\" ], ( str, unicode ) )\n self.__login = attributes[ \"login\" ]\n- if \"name\" in attributes and attributes[ \"name\" ] is not None:\n+ if \"name\" in attributes and attributes[ \"name\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"name\" ], ( str, unicode ) )\n self.__name = attributes[ \"name\" ]\n- if \"owned_private_repos\" in attributes and attributes[ \"owned_private_repos\" ] is not None:\n+ if \"owned_private_repos\" in attributes and attributes[ \"owned_private_repos\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"owned_private_repos\" ], int )\n self.__owned_private_repos = attributes[ \"owned_private_repos\" ]\n- if \"plan\" in attributes and attributes[ \"plan\" ] is not None:\n+ if \"plan\" in attributes and attributes[ \"plan\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"plan\" ], dict )\n self.__plan = Plan.Plan( self.__requester, attributes[ \"plan\" ], completion = LazyCompletion )\n- if \"private_gists\" in attributes and attributes[ \"private_gists\" ] is not None:\n+ if \"private_gists\" in attributes and attributes[ \"private_gists\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"private_gists\" ], int )\n self.__private_gists = attributes[ \"private_gists\" ]\n- if \"public_gists\" in attributes and attributes[ \"public_gists\" ] is not None:\n+ if \"public_gists\" in attributes and attributes[ \"public_gists\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"public_gists\" ], int )\n self.__public_gists = attributes[ \"public_gists\" ]\n- if \"public_repos\" in attributes and attributes[ \"public_repos\" ] is not None:\n+ if \"public_repos\" in attributes and attributes[ \"public_repos\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"public_repos\" ], int )\n self.__public_repos = attributes[ \"public_repos\" ]\n- if \"total_private_repos\" in attributes and attributes[ \"total_private_repos\" ] is not None:\n+ if \"total_private_repos\" in attributes and attributes[ \"total_private_repos\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"total_private_repos\" ], int )\n self.__total_private_repos = attributes[ \"total_private_repos\" ]\n- if \"type\" in attributes and attributes[ \"type\" ] is not None:\n+ if \"type\" in attributes and attributes[ \"type\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"type\" ], ( str, unicode ) )\n self.__type = attributes[ \"type\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"url\" ], ( str, unicode ) )\n self.__url = attributes[ \"url\" ]","status":"modified","deletions":25,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/AuthenticatedUser.py","changes":50,"additions":25,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/AuthenticatedUser.py","filename":"src/github/AuthenticatedUser.py"},{"patch":"@@ -117,21 +117,21 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"app\", \"created_at\", \"id\", \"note\", \"note_url\", \"scopes\", \"token\", \"updated_at\", \"url\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"app\" in attributes and attributes[ \"app\" ] is not None:\n+ if \"app\" in attributes and attributes[ \"app\" ] is not None: # pragma no branch\n self.__app = attributes[ \"app\" ]\n- if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None:\n+ if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None: # pragma no branch\n self.__created_at = attributes[ \"created_at\" ]\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n self.__id = attributes[ \"id\" ]\n- if \"note\" in attributes and attributes[ \"note\" ] is not None:\n+ if \"note\" in attributes and attributes[ \"note\" ] is not None: # pragma no branch\n self.__note = attributes[ \"note\" ]\n- if \"note_url\" in attributes and attributes[ \"note_url\" ] is not None:\n+ if \"note_url\" in attributes and attributes[ \"note_url\" ] is not None: # pragma no branch\n self.__note_url = attributes[ \"note_url\" ]\n- if \"scopes\" in attributes and attributes[ \"scopes\" ] is not None:\n+ if \"scopes\" in attributes and attributes[ \"scopes\" ] is not None: # pragma no branch\n self.__scopes = attributes[ \"scopes\" ]\n- if \"token\" in attributes and attributes[ \"token\" ] is not None:\n+ if \"token\" in attributes and attributes[ \"token\" ] is not None: # pragma no branch\n self.__token = attributes[ \"token\" ]\n- if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None:\n+ if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None: # pragma no branch\n self.__updated_at = attributes[ \"updated_at\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n self.__url = attributes[ \"url\" ]","status":"modified","deletions":9,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Authorization.py","changes":18,"additions":9,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Authorization.py","filename":"src/github/Authorization.py"},{"patch":"@@ -28,9 +28,9 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"commit\", \"name\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"commit\" in attributes and attributes[ \"commit\" ] is not None:\n+ if \"commit\" in attributes and attributes[ \"commit\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"commit\" ], dict )\n self.__commit = Commit.Commit( self.__requester, attributes[ \"commit\" ], completion = LazyCompletion )\n- if \"name\" in attributes and attributes[ \"name\" ] is not None:\n+ if \"name\" in attributes and attributes[ \"name\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"name\" ], ( str, unicode ) )\n self.__name = attributes[ \"name\" ]","status":"modified","deletions":2,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Branch.py","changes":4,"additions":2,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Branch.py","filename":"src/github/Branch.py"},{"patch":"@@ -120,33 +120,33 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"author\", \"commit\", \"committer\", \"files\", \"parents\", \"sha\", \"stats\", \"url\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"author\" in attributes and attributes[ \"author\" ] is not None:\n+ if \"author\" in attributes and attributes[ \"author\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"author\" ], dict )\n self.__author = NamedUser.NamedUser( self.__requester, attributes[ \"author\" ], completion = LazyCompletion )\n- if \"commit\" in attributes and attributes[ \"commit\" ] is not None:\n+ if \"commit\" in attributes and attributes[ \"commit\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"commit\" ], dict )\n self.__commit = GitCommit.GitCommit( self.__requester, attributes[ \"commit\" ], completion = LazyCompletion )\n- if \"committer\" in attributes and attributes[ \"committer\" ] is not None:\n+ if \"committer\" in attributes and attributes[ \"committer\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"committer\" ], dict )\n self.__committer = NamedUser.NamedUser( self.__requester, attributes[ \"committer\" ], completion = LazyCompletion )\n- if \"files\" in attributes and attributes[ \"files\" ] is not None:\n+ if \"files\" in attributes and attributes[ \"files\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"files\" ], list ) and ( len( attributes[ \"files\" ] ) == 0 or isinstance( attributes[ \"files\" ][ 0 ], dict ) )\n self.__files = [\n CommitFile.CommitFile( self.__requester, element, completion = LazyCompletion )\n for element in attributes[ \"files\" ]\n ]\n- if \"parents\" in attributes and attributes[ \"parents\" ] is not None:\n+ if \"parents\" in attributes and attributes[ \"parents\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"parents\" ], list ) and ( len( attributes[ \"parents\" ] ) == 0 or isinstance( attributes[ \"parents\" ][ 0 ], dict ) )\n self.__parents = [\n Commit( self.__requester, element, completion = LazyCompletion )\n for element in attributes[ \"parents\" ]\n ]\n- if \"sha\" in attributes and attributes[ \"sha\" ] is not None:\n+ if \"sha\" in attributes and attributes[ \"sha\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"sha\" ], ( str, unicode ) )\n self.__sha = attributes[ \"sha\" ]\n- if \"stats\" in attributes and attributes[ \"stats\" ] is not None:\n+ if \"stats\" in attributes and attributes[ \"stats\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"stats\" ], dict )\n self.__stats = CommitStats.CommitStats( self.__requester, attributes[ \"stats\" ], completion = LazyCompletion )\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"url\" ], ( str, unicode ) )\n self.__url = attributes[ \"url\" ]","status":"modified","deletions":8,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Commit.py","changes":16,"additions":8,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Commit.py","filename":"src/github/Commit.py"},{"patch":"@@ -121,36 +121,36 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"body\", \"commit_id\", \"created_at\", \"html_url\", \"id\", \"line\", \"path\", \"position\", \"updated_at\", \"url\", \"user\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"body\" in attributes and attributes[ \"body\" ] is not None:\n+ if \"body\" in attributes and attributes[ \"body\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"body\" ], ( str, unicode ) )\n self.__body = attributes[ \"body\" ]\n- if \"commit_id\" in attributes and attributes[ \"commit_id\" ] is not None:\n+ if \"commit_id\" in attributes and attributes[ \"commit_id\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"commit_id\" ], ( str, unicode ) )\n self.__commit_id = attributes[ \"commit_id\" ]\n- if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None:\n+ if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"created_at\" ], ( str, unicode ) )\n self.__created_at = attributes[ \"created_at\" ]\n- if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None:\n+ if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"html_url\" ], ( str, unicode ) )\n self.__html_url = attributes[ \"html_url\" ]\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"id\" ], int )\n self.__id = attributes[ \"id\" ]\n- if \"line\" in attributes and attributes[ \"line\" ] is not None:\n+ if \"line\" in attributes and attributes[ \"line\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"line\" ], int )\n self.__line = attributes[ \"line\" ]\n- if \"path\" in attributes and attributes[ \"path\" ] is not None:\n+ if \"path\" in attributes and attributes[ \"path\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"path\" ], ( str, unicode ) )\n self.__path = attributes[ \"path\" ]\n- if \"position\" in attributes and attributes[ \"position\" ] is not None:\n+ if \"position\" in attributes and attributes[ \"position\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"position\" ], int )\n self.__position = attributes[ \"position\" ]\n- if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None:\n+ if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"updated_at\" ], ( str, unicode ) )\n self.__updated_at = attributes[ \"updated_at\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"url\" ], ( str, unicode ) )\n self.__url = attributes[ \"url\" ]\n- if \"user\" in attributes and attributes[ \"user\" ] is not None:\n+ if \"user\" in attributes and attributes[ \"user\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"user\" ], dict )\n self.__user = NamedUser.NamedUser( self.__requester, attributes[ \"user\" ], completion = LazyCompletion )","status":"modified","deletions":11,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/CommitComment.py","changes":22,"additions":11,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/CommitComment.py","filename":"src/github/CommitComment.py"},{"patch":"@@ -62,21 +62,21 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"additions\", \"blob_url\", \"changes\", \"deletions\", \"filename\", \"patch\", \"raw_url\", \"sha\", \"status\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"additions\" in attributes and attributes[ \"additions\" ] is not None:\n+ if \"additions\" in attributes and attributes[ \"additions\" ] is not None: # pragma no branch\n self.__additions = attributes[ \"additions\" ]\n- if \"blob_url\" in attributes and attributes[ \"blob_url\" ] is not None:\n+ if \"blob_url\" in attributes and attributes[ \"blob_url\" ] is not None: # pragma no branch\n self.__blob_url = attributes[ \"blob_url\" ]\n- if \"changes\" in attributes and attributes[ \"changes\" ] is not None:\n+ if \"changes\" in attributes and attributes[ \"changes\" ] is not None: # pragma no branch\n self.__changes = attributes[ \"changes\" ]\n- if \"deletions\" in attributes and attributes[ \"deletions\" ] is not None:\n+ if \"deletions\" in attributes and attributes[ \"deletions\" ] is not None: # pragma no branch\n self.__deletions = attributes[ \"deletions\" ]\n- if \"filename\" in attributes and attributes[ \"filename\" ] is not None:\n+ if \"filename\" in attributes and attributes[ \"filename\" ] is not None: # pragma no branch\n self.__filename = attributes[ \"filename\" ]\n- if \"patch\" in attributes and attributes[ \"patch\" ] is not None:\n+ if \"patch\" in attributes and attributes[ \"patch\" ] is not None: # pragma no branch\n self.__patch = attributes[ \"patch\" ]\n- if \"raw_url\" in attributes and attributes[ \"raw_url\" ] is not None:\n+ if \"raw_url\" in attributes and attributes[ \"raw_url\" ] is not None: # pragma no branch\n self.__raw_url = attributes[ \"raw_url\" ]\n- if \"sha\" in attributes and attributes[ \"sha\" ] is not None:\n+ if \"sha\" in attributes and attributes[ \"sha\" ] is not None: # pragma no branch\n self.__sha = attributes[ \"sha\" ]\n- if \"status\" in attributes and attributes[ \"status\" ] is not None:\n+ if \"status\" in attributes and attributes[ \"status\" ] is not None: # pragma no branch\n self.__status = attributes[ \"status\" ]","status":"modified","deletions":9,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/CommitFile.py","changes":18,"additions":9,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/CommitFile.py","filename":"src/github/CommitFile.py"},{"patch":"@@ -32,12 +32,12 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"additions\", \"deletions\", \"total\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"additions\" in attributes and attributes[ \"additions\" ] is not None:\n+ if \"additions\" in attributes and attributes[ \"additions\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"additions\" ], int )\n self.__additions = attributes[ \"additions\" ]\n- if \"deletions\" in attributes and attributes[ \"deletions\" ] is not None:\n+ if \"deletions\" in attributes and attributes[ \"deletions\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"deletions\" ], int )\n self.__deletions = attributes[ \"deletions\" ]\n- if \"total\" in attributes and attributes[ \"total\" ] is not None:\n+ if \"total\" in attributes and attributes[ \"total\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"total\" ], int )\n self.__total = attributes[ \"total\" ]","status":"modified","deletions":3,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/CommitStats.py","changes":6,"additions":3,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/CommitStats.py","filename":"src/github/CommitStats.py"},{"patch":"@@ -162,43 +162,43 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"accesskeyid\", \"acl\", \"bucket\", \"content_type\", \"created_at\", \"description\", \"download_count\", \"expirationdate\", \"html_url\", \"id\", \"mime_type\", \"name\", \"path\", \"policy\", \"prefix\", \"redirect\", \"s3_url\", \"signature\", \"size\", \"url\", \"x-amz-meta-content-disposition\" ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"accesskeyid\" in attributes and attributes[ \"accesskeyid\" ] is not None:\n+ if \"accesskeyid\" in attributes and attributes[ \"accesskeyid\" ] is not None: # pragma no branch\n self.__accesskeyid = attributes[ \"accesskeyid\" ]\n- if \"acl\" in attributes and attributes[ \"acl\" ] is not None:\n+ if \"acl\" in attributes and attributes[ \"acl\" ] is not None: # pragma no branch\n self.__acl = attributes[ \"acl\" ]\n- if \"bucket\" in attributes and attributes[ \"bucket\" ] is not None:\n+ if \"bucket\" in attributes and attributes[ \"bucket\" ] is not None: # pragma no branch\n self.__bucket = attributes[ \"bucket\" ]\n- if \"content_type\" in attributes and attributes[ \"content_type\" ] is not None:\n+ if \"content_type\" in attributes and attributes[ \"content_type\" ] is not None: # pragma no branch\n self.__content_type = attributes[ \"content_type\" ]\n- if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None:\n+ if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None: # pragma no branch\n self.__created_at = attributes[ \"created_at\" ]\n- if \"description\" in attributes and attributes[ \"description\" ] is not None:\n+ if \"description\" in attributes and attributes[ \"description\" ] is not None: # pragma no branch\n self.__description = attributes[ \"description\" ]\n- if \"download_count\" in attributes and attributes[ \"download_count\" ] is not None:\n+ if \"download_count\" in attributes and attributes[ \"download_count\" ] is not None: # pragma no branch\n self.__download_count = attributes[ \"download_count\" ]\n- if \"expirationdate\" in attributes and attributes[ \"expirationdate\" ] is not None:\n+ if \"expirationdate\" in attributes and attributes[ \"expirationdate\" ] is not None: # pragma no branch\n self.__expirationdate = attributes[ \"expirationdate\" ]\n- if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None:\n+ if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None: # pragma no branch\n self.__html_url = attributes[ \"html_url\" ]\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n self.__id = attributes[ \"id\" ]\n- if \"mime_type\" in attributes and attributes[ \"mime_type\" ] is not None:\n+ if \"mime_type\" in attributes and attributes[ \"mime_type\" ] is not None: # pragma no branch\n self.__mime_type = attributes[ \"mime_type\" ]\n- if \"name\" in attributes and attributes[ \"name\" ] is not None:\n+ if \"name\" in attributes and attributes[ \"name\" ] is not None: # pragma no branch\n self.__name = attributes[ \"name\" ]\n- if \"path\" in attributes and attributes[ \"path\" ] is not None:\n+ if \"path\" in attributes and attributes[ \"path\" ] is not None: # pragma no branch\n self.__path = attributes[ \"path\" ]\n- if \"policy\" in attributes and attributes[ \"policy\" ] is not None:\n+ if \"policy\" in attributes and attributes[ \"policy\" ] is not None: # pragma no branch\n self.__policy = attributes[ \"policy\" ]\n- if \"prefix\" in attributes and attributes[ \"prefix\" ] is not None:\n+ if \"prefix\" in attributes and attributes[ \"prefix\" ] is not None: # pragma no branch\n self.__prefix = attributes[ \"prefix\" ]\n- if \"redirect\" in attributes and attributes[ \"redirect\" ] is not None:\n+ if \"redirect\" in attributes and attributes[ \"redirect\" ] is not None: # pragma no branch\n self.__redirect = attributes[ \"redirect\" ]\n- if \"s3_url\" in attributes and attributes[ \"s3_url\" ] is not None:\n+ if \"s3_url\" in attributes and attributes[ \"s3_url\" ] is not None: # pragma no branch\n self.__s3_url = attributes[ \"s3_url\" ]\n- if \"signature\" in attributes and attributes[ \"signature\" ] is not None:\n+ if \"signature\" in attributes and attributes[ \"signature\" ] is not None: # pragma no branch\n self.__signature = attributes[ \"signature\" ]\n- if \"size\" in attributes and attributes[ \"size\" ] is not None:\n+ if \"size\" in attributes and attributes[ \"size\" ] is not None: # pragma no branch\n self.__size = attributes[ \"size\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n self.__url = attributes[ \"url\" ]","status":"modified","deletions":20,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Download.py","changes":40,"additions":20,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Download.py","filename":"src/github/Download.py"},{"patch":"@@ -60,22 +60,22 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"actor\", \"created_at\", \"id\", \"org\", \"payload\", \"public\", \"repo\", \"type\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"actor\" in attributes and attributes[ \"actor\" ] is not None:\n+ if \"actor\" in attributes and attributes[ \"actor\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"actor\" ], dict )\n self.__actor = NamedUser.NamedUser( self.__requester, attributes[ \"actor\" ], completion = LazyCompletion )\n- if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None:\n+ if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None: # pragma no branch\n self.__created_at = attributes[ \"created_at\" ]\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n self.__id = attributes[ \"id\" ]\n- if \"org\" in attributes and attributes[ \"org\" ] is not None:\n+ if \"org\" in attributes and attributes[ \"org\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"org\" ], dict )\n self.__org = Organization.Organization( self.__requester, attributes[ \"org\" ], completion = LazyCompletion )\n- if \"payload\" in attributes and attributes[ \"payload\" ] is not None:\n+ if \"payload\" in attributes and attributes[ \"payload\" ] is not None: # pragma no branch\n self.__payload = attributes[ \"payload\" ]\n- if \"public\" in attributes and attributes[ \"public\" ] is not None:\n+ if \"public\" in attributes and attributes[ \"public\" ] is not None: # pragma no branch\n self.__public = attributes[ \"public\" ]\n- if \"repo\" in attributes and attributes[ \"repo\" ] is not None:\n+ if \"repo\" in attributes and attributes[ \"repo\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"repo\" ], dict )\n self.__repo = Repository.Repository( self.__requester, attributes[ \"repo\" ], completion = LazyCompletion )\n- if \"type\" in attributes and attributes[ \"type\" ] is not None:\n+ if \"type\" in attributes and attributes[ \"type\" ] is not None: # pragma no branch\n self.__type = attributes[ \"type\" ]","status":"modified","deletions":8,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Event.py","changes":16,"additions":8,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Event.py","filename":"src/github/Event.py"},{"patch":"@@ -220,53 +220,53 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"comments\", \"created_at\", \"description\", \"files\", \"fork_of\", \"forks\", \"git_pull_url\", \"git_push_url\", \"history\", \"html_url\", \"id\", \"public\", \"updated_at\", \"url\", \"user\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"comments\" in attributes and attributes[ \"comments\" ] is not None:\n+ if \"comments\" in attributes and attributes[ \"comments\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"comments\" ], int )\n self.__comments = attributes[ \"comments\" ]\n- if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None:\n+ if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"created_at\" ], ( str, unicode ) )\n self.__created_at = attributes[ \"created_at\" ]\n- if \"description\" in attributes and attributes[ \"description\" ] is not None:\n+ if \"description\" in attributes and attributes[ \"description\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"description\" ], ( str, unicode ) )\n self.__description = attributes[ \"description\" ]\n- if \"files\" in attributes and attributes[ \"files\" ] is not None:\n+ if \"files\" in attributes and attributes[ \"files\" ] is not None: # pragma no branch\n self.__files = attributes[ \"files\" ]\n- if \"fork_of\" in attributes and attributes[ \"fork_of\" ] is not None:\n+ if \"fork_of\" in attributes and attributes[ \"fork_of\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"fork_of\" ], dict )\n self.__fork_of = Gist( self.__requester, attributes[ \"fork_of\" ], completion = LazyCompletion )\n- if \"forks\" in attributes and attributes[ \"forks\" ] is not None:\n+ if \"forks\" in attributes and attributes[ \"forks\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"forks\" ], list ) and ( len( attributes[ \"forks\" ] ) == 0 or isinstance( attributes[ \"forks\" ][ 0 ], dict ) )\n self.__forks = [\n Gist( self.__requester, element, completion = LazyCompletion )\n for element in attributes[ \"forks\" ]\n ]\n- if \"git_pull_url\" in attributes and attributes[ \"git_pull_url\" ] is not None:\n+ if \"git_pull_url\" in attributes and attributes[ \"git_pull_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"git_pull_url\" ], ( str, unicode ) )\n self.__git_pull_url = attributes[ \"git_pull_url\" ]\n- if \"git_push_url\" in attributes and attributes[ \"git_push_url\" ] is not None:\n+ if \"git_push_url\" in attributes and attributes[ \"git_push_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"git_push_url\" ], ( str, unicode ) )\n self.__git_push_url = attributes[ \"git_push_url\" ]\n- if \"history\" in attributes and attributes[ \"history\" ] is not None:\n+ if \"history\" in attributes and attributes[ \"history\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"history\" ], list ) and ( len( attributes[ \"history\" ] ) == 0 or isinstance( attributes[ \"history\" ][ 0 ], dict ) )\n self.__history = [\n GistHistoryState.GistHistoryState( self.__requester, element, completion = LazyCompletion )\n for element in attributes[ \"history\" ]\n ]\n- if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None:\n+ if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"html_url\" ], ( str, unicode ) )\n self.__html_url = attributes[ \"html_url\" ]\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"id\" ], ( str, unicode ) )\n self.__id = attributes[ \"id\" ]\n- if \"public\" in attributes and attributes[ \"public\" ] is not None:\n+ if \"public\" in attributes and attributes[ \"public\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"public\" ], bool )\n self.__public = attributes[ \"public\" ]\n- if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None:\n+ if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"updated_at\" ], ( str, unicode ) )\n self.__updated_at = attributes[ \"updated_at\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"url\" ], ( str, unicode ) )\n self.__url = attributes[ \"url\" ]\n- if \"user\" in attributes and attributes[ \"user\" ] is not None:\n+ if \"user\" in attributes and attributes[ \"user\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"user\" ], dict )\n self.__user = NamedUser.NamedUser( self.__requester, attributes[ \"user\" ], completion = LazyCompletion )","status":"modified","deletions":15,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Gist.py","changes":30,"additions":15,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Gist.py","filename":"src/github/Gist.py"},{"patch":"@@ -68,16 +68,16 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"body\", \"created_at\", \"id\", \"updated_at\", \"url\", \"user\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"body\" in attributes and attributes[ \"body\" ] is not None:\n+ if \"body\" in attributes and attributes[ \"body\" ] is not None: # pragma no branch\n self.__body = attributes[ \"body\" ]\n- if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None:\n+ if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None: # pragma no branch\n self.__created_at = attributes[ \"created_at\" ]\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n self.__id = attributes[ \"id\" ]\n- if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None:\n+ if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None: # pragma no branch\n self.__updated_at = attributes[ \"updated_at\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n self.__url = attributes[ \"url\" ]\n- if \"user\" in attributes and attributes[ \"user\" ] is not None:\n+ if \"user\" in attributes and attributes[ \"user\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"user\" ], dict )\n self.__user = NamedUser.NamedUser( self.__requester, attributes[ \"user\" ], completion = LazyCompletion )","status":"modified","deletions":6,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GistComment.py","changes":12,"additions":6,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GistComment.py","filename":"src/github/GistComment.py"},{"patch":"@@ -44,18 +44,18 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"change_status\", \"committed_at\", \"url\", \"user\", \"version\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"change_status\" in attributes and attributes[ \"change_status\" ] is not None:\n+ if \"change_status\" in attributes and attributes[ \"change_status\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"change_status\" ], dict )\n self.__change_status = CommitStats.CommitStats( self.__requester, attributes[ \"change_status\" ], completion = LazyCompletion )\n- if \"committed_at\" in attributes and attributes[ \"committed_at\" ] is not None:\n+ if \"committed_at\" in attributes and attributes[ \"committed_at\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"committed_at\" ], ( str, unicode ) )\n self.__committed_at = attributes[ \"committed_at\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"url\" ], ( str, unicode ) )\n self.__url = attributes[ \"url\" ]\n- if \"user\" in attributes and attributes[ \"user\" ] is not None:\n+ if \"user\" in attributes and attributes[ \"user\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"user\" ], dict )\n self.__user = NamedUser.NamedUser( self.__requester, attributes[ \"user\" ], completion = LazyCompletion )\n- if \"version\" in attributes and attributes[ \"version\" ] is not None:\n+ if \"version\" in attributes and attributes[ \"version\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"version\" ], ( str, unicode ) )\n self.__version = attributes[ \"version\" ]","status":"modified","deletions":5,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GistHistoryState.py","changes":10,"additions":5,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GistHistoryState.py","filename":"src/github/GistHistoryState.py"},{"patch":"@@ -32,12 +32,12 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"date\", \"email\", \"name\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"date\" in attributes and attributes[ \"date\" ] is not None:\n+ if \"date\" in attributes and attributes[ \"date\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"date\" ], ( str, unicode ) )\n self.__date = attributes[ \"date\" ]\n- if \"email\" in attributes and attributes[ \"email\" ] is not None:\n+ if \"email\" in attributes and attributes[ \"email\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"email\" ], ( str, unicode ) )\n self.__email = attributes[ \"email\" ]\n- if \"name\" in attributes and attributes[ \"name\" ] is not None:\n+ if \"name\" in attributes and attributes[ \"name\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"name\" ], ( str, unicode ) )\n self.__name = attributes[ \"name\" ]","status":"modified","deletions":3,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GitAuthor.py","changes":6,"additions":3,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GitAuthor.py","filename":"src/github/GitAuthor.py"},{"patch":"@@ -42,18 +42,18 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"content\", \"encoding\", \"sha\", \"size\", \"url\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"content\" in attributes and attributes[ \"content\" ] is not None:\n+ if \"content\" in attributes and attributes[ \"content\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"content\" ], ( str, unicode ) )\n self.__content = attributes[ \"content\" ]\n- if \"encoding\" in attributes and attributes[ \"encoding\" ] is not None:\n+ if \"encoding\" in attributes and attributes[ \"encoding\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"encoding\" ], ( str, unicode ) )\n self.__encoding = attributes[ \"encoding\" ]\n- if \"sha\" in attributes and attributes[ \"sha\" ] is not None:\n+ if \"sha\" in attributes and attributes[ \"sha\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"sha\" ], ( str, unicode ) )\n self.__sha = attributes[ \"sha\" ]\n- if \"size\" in attributes and attributes[ \"size\" ] is not None:\n+ if \"size\" in attributes and attributes[ \"size\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"size\" ], int )\n self.__size = attributes[ \"size\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"url\" ], ( str, unicode ) )\n self.__url = attributes[ \"url\" ]","status":"modified","deletions":5,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GitBlob.py","changes":10,"additions":5,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GitBlob.py","filename":"src/github/GitBlob.py"},{"patch":"@@ -55,27 +55,27 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"author\", \"committer\", \"message\", \"parents\", \"sha\", \"tree\", \"url\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"author\" in attributes and attributes[ \"author\" ] is not None:\n+ if \"author\" in attributes and attributes[ \"author\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"author\" ], dict )\n self.__author = GitAuthor.GitAuthor( self.__requester, attributes[ \"author\" ], completion = LazyCompletion )\n- if \"committer\" in attributes and attributes[ \"committer\" ] is not None:\n+ if \"committer\" in attributes and attributes[ \"committer\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"committer\" ], dict )\n self.__committer = GitAuthor.GitAuthor( self.__requester, attributes[ \"committer\" ], completion = LazyCompletion )\n- if \"message\" in attributes and attributes[ \"message\" ] is not None:\n+ if \"message\" in attributes and attributes[ \"message\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"message\" ], ( str, unicode ) )\n self.__message = attributes[ \"message\" ]\n- if \"parents\" in attributes and attributes[ \"parents\" ] is not None:\n+ if \"parents\" in attributes and attributes[ \"parents\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"parents\" ], list ) and ( len( attributes[ \"parents\" ] ) == 0 or isinstance( attributes[ \"parents\" ][ 0 ], dict ) )\n self.__parents = [\n GitCommit( self.__requester, element, completion = LazyCompletion )\n for element in attributes[ \"parents\" ]\n ]\n- if \"sha\" in attributes and attributes[ \"sha\" ] is not None:\n+ if \"sha\" in attributes and attributes[ \"sha\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"sha\" ], ( str, unicode ) )\n self.__sha = attributes[ \"sha\" ]\n- if \"tree\" in attributes and attributes[ \"tree\" ] is not None:\n+ if \"tree\" in attributes and attributes[ \"tree\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"tree\" ], dict )\n self.__tree = GitTree.GitTree( self.__requester, attributes[ \"tree\" ], completion = LazyCompletion )\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"url\" ], ( str, unicode ) )\n self.__url = attributes[ \"url\" ]","status":"modified","deletions":7,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GitCommit.py","changes":14,"additions":7,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GitCommit.py","filename":"src/github/GitCommit.py"},{"patch":"@@ -32,12 +32,12 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"sha\", \"type\", \"url\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"sha\" in attributes and attributes[ \"sha\" ] is not None:\n+ if \"sha\" in attributes and attributes[ \"sha\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"sha\" ], ( str, unicode ) )\n self.__sha = attributes[ \"sha\" ]\n- if \"type\" in attributes and attributes[ \"type\" ] is not None:\n+ if \"type\" in attributes and attributes[ \"type\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"type\" ], ( str, unicode ) )\n self.__type = attributes[ \"type\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"url\" ], ( str, unicode ) )\n self.__url = attributes[ \"url\" ]","status":"modified","deletions":3,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GitObject.py","changes":6,"additions":3,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GitObject.py","filename":"src/github/GitObject.py"},{"patch":"@@ -55,12 +55,12 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"object\", \"ref\", \"url\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"object\" in attributes and attributes[ \"object\" ] is not None:\n+ if \"object\" in attributes and attributes[ \"object\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"object\" ], dict )\n self.__object = GitObject.GitObject( self.__requester, attributes[ \"object\" ], completion = LazyCompletion )\n- if \"ref\" in attributes and attributes[ \"ref\" ] is not None:\n+ if \"ref\" in attributes and attributes[ \"ref\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"ref\" ], ( str, unicode ) )\n self.__ref = attributes[ \"ref\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"url\" ], ( str, unicode ) )\n self.__url = attributes[ \"url\" ]","status":"modified","deletions":3,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GitRef.py","changes":6,"additions":3,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GitRef.py","filename":"src/github/GitRef.py"},{"patch":"@@ -49,21 +49,21 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"message\", \"object\", \"sha\", \"tag\", \"tagger\", \"url\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"message\" in attributes and attributes[ \"message\" ] is not None:\n+ if \"message\" in attributes and attributes[ \"message\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"message\" ], ( str, unicode ) )\n self.__message = attributes[ \"message\" ]\n- if \"object\" in attributes and attributes[ \"object\" ] is not None:\n+ if \"object\" in attributes and attributes[ \"object\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"object\" ], dict )\n self.__object = GitObject.GitObject( self.__requester, attributes[ \"object\" ], completion = LazyCompletion )\n- if \"sha\" in attributes and attributes[ \"sha\" ] is not None:\n+ if \"sha\" in attributes and attributes[ \"sha\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"sha\" ], ( str, unicode ) )\n self.__sha = attributes[ \"sha\" ]\n- if \"tag\" in attributes and attributes[ \"tag\" ] is not None:\n+ if \"tag\" in attributes and attributes[ \"tag\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"tag\" ], ( str, unicode ) )\n self.__tag = attributes[ \"tag\" ]\n- if \"tagger\" in attributes and attributes[ \"tagger\" ] is not None:\n+ if \"tagger\" in attributes and attributes[ \"tagger\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"tagger\" ], dict )\n self.__tagger = GitAuthor.GitAuthor( self.__requester, attributes[ \"tagger\" ], completion = LazyCompletion )\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"url\" ], ( str, unicode ) )\n self.__url = attributes[ \"url\" ]","status":"modified","deletions":6,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GitTag.py","changes":12,"additions":6,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GitTag.py","filename":"src/github/GitTag.py"},{"patch":"@@ -33,15 +33,15 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"sha\", \"tree\", \"url\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"sha\" in attributes and attributes[ \"sha\" ] is not None:\n+ if \"sha\" in attributes and attributes[ \"sha\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"sha\" ], ( str, unicode ) )\n self.__sha = attributes[ \"sha\" ]\n- if \"tree\" in attributes and attributes[ \"tree\" ] is not None:\n+ if \"tree\" in attributes and attributes[ \"tree\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"tree\" ], list ) and ( len( attributes[ \"tree\" ] ) == 0 or isinstance( attributes[ \"tree\" ][ 0 ], dict ) )\n self.__tree = [\n GitTreeElement.GitTreeElement( self.__requester, element, completion = LazyCompletion )\n for element in attributes[ \"tree\" ]\n ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"url\" ], ( str, unicode ) )\n self.__url = attributes[ \"url\" ]","status":"modified","deletions":3,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GitTree.py","changes":6,"additions":3,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GitTree.py","filename":"src/github/GitTree.py"},{"patch":"@@ -47,21 +47,21 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"mode\", \"path\", \"sha\", \"size\", \"type\", \"url\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"mode\" in attributes and attributes[ \"mode\" ] is not None:\n+ if \"mode\" in attributes and attributes[ \"mode\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"mode\" ], ( str, unicode ) )\n self.__mode = attributes[ \"mode\" ]\n- if \"path\" in attributes and attributes[ \"path\" ] is not None:\n+ if \"path\" in attributes and attributes[ \"path\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"path\" ], ( str, unicode ) )\n self.__path = attributes[ \"path\" ]\n- if \"sha\" in attributes and attributes[ \"sha\" ] is not None:\n+ if \"sha\" in attributes and attributes[ \"sha\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"sha\" ], ( str, unicode ) )\n self.__sha = attributes[ \"sha\" ]\n- if \"size\" in attributes and attributes[ \"size\" ] is not None:\n+ if \"size\" in attributes and attributes[ \"size\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"size\" ], int )\n self.__size = attributes[ \"size\" ]\n- if \"type\" in attributes and attributes[ \"type\" ] is not None:\n+ if \"type\" in attributes and attributes[ \"type\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"type\" ], ( str, unicode ) )\n self.__type = attributes[ \"type\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"url\" ], ( str, unicode ) )\n self.__url = attributes[ \"url\" ]","status":"modified","deletions":6,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GitTreeElement.py","changes":12,"additions":6,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GitTreeElement.py","filename":"src/github/GitTreeElement.py"},{"patch":"@@ -99,21 +99,21 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"active\", \"config\", \"created_at\", \"events\", \"id\", \"last_response\", \"name\", \"updated_at\", \"url\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"active\" in attributes and attributes[ \"active\" ] is not None:\n+ if \"active\" in attributes and attributes[ \"active\" ] is not None: # pragma no branch\n self.__active = attributes[ \"active\" ]\n- if \"config\" in attributes and attributes[ \"config\" ] is not None:\n+ if \"config\" in attributes and attributes[ \"config\" ] is not None: # pragma no branch\n self.__config = attributes[ \"config\" ]\n- if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None:\n+ if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None: # pragma no branch\n self.__created_at = attributes[ \"created_at\" ]\n- if \"events\" in attributes and attributes[ \"events\" ] is not None:\n+ if \"events\" in attributes and attributes[ \"events\" ] is not None: # pragma no branch\n self.__events = attributes[ \"events\" ]\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n self.__id = attributes[ \"id\" ]\n- if \"last_response\" in attributes and attributes[ \"last_response\" ] is not None:\n+ if \"last_response\" in attributes and attributes[ \"last_response\" ] is not None: # pragma no branch\n self.__last_response = attributes[ \"last_response\" ]\n- if \"name\" in attributes and attributes[ \"name\" ] is not None:\n+ if \"name\" in attributes and attributes[ \"name\" ] is not None: # pragma no branch\n self.__name = attributes[ \"name\" ]\n- if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None:\n+ if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None: # pragma no branch\n self.__updated_at = attributes[ \"updated_at\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n self.__url = attributes[ \"url\" ]","status":"modified","deletions":9,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Hook.py","changes":18,"additions":9,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Hook.py","filename":"src/github/Hook.py"},{"patch":"@@ -110,7 +110,7 @@ def user( self ):\n return self.__user\n \n def add_to_labels( self, *labels ):\n- post_parameters = labels\n+ post_parameters = [ label.name for label in labels ]\n status, headers, data = self.__requester.request(\n \"POST\",\n str( self.url ) + \"/labels\",\n@@ -131,7 +131,12 @@ def create_comment( self, body ):\n return IssueComment.IssueComment( self.__requester, data, completion = NoCompletion )\n \n def delete_labels( self ):\n- pass\n+ status, headers, data = self.__requester.request(\n+ \"DELETE\",\n+ str( self.url ) + \"/labels\",\n+ None,\n+ None\n+ )\n \n def edit( self, title = DefaultValueForOptionalParameters, body = DefaultValueForOptionalParameters, assignee = DefaultValueForOptionalParameters, state = DefaultValueForOptionalParameters, milestone = DefaultValueForOptionalParameters, labels = DefaultValueForOptionalParameters ):\n post_parameters = {\n@@ -216,7 +221,13 @@ def remove_from_labels( self, label ):\n )\n \n def set_labels( self, *labels ):\n- pass\n+ post_parameters = [ label.name for label in labels ]\n+ status, headers, data = self.__requester.request(\n+ \"PUT\",\n+ str( self.url ) + \"/labels\",\n+ None,\n+ post_parameters\n+ )\n \n def __initAttributes( self ):\n self.__assignee = None\n@@ -257,59 +268,59 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"assignee\", \"body\", \"closed_at\", \"closed_by\", \"comments\", \"created_at\", \"html_url\", \"id\", \"labels\", \"milestone\", \"number\", \"pull_request\", \"repository\", \"state\", \"title\", \"updated_at\", \"url\", \"user\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"assignee\" in attributes and attributes[ \"assignee\" ] is not None:\n+ if \"assignee\" in attributes and attributes[ \"assignee\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"assignee\" ], dict )\n self.__assignee = NamedUser.NamedUser( self.__requester, attributes[ \"assignee\" ], completion = LazyCompletion )\n- if \"body\" in attributes and attributes[ \"body\" ] is not None:\n+ if \"body\" in attributes and attributes[ \"body\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"body\" ], ( str, unicode ) )\n self.__body = attributes[ \"body\" ]\n- if \"closed_at\" in attributes and attributes[ \"closed_at\" ] is not None:\n+ if \"closed_at\" in attributes and attributes[ \"closed_at\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"closed_at\" ], ( str, unicode ) )\n self.__closed_at = attributes[ \"closed_at\" ]\n- if \"closed_by\" in attributes and attributes[ \"closed_by\" ] is not None:\n+ if \"closed_by\" in attributes and attributes[ \"closed_by\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"closed_by\" ], dict )\n self.__closed_by = NamedUser.NamedUser( self.__requester, attributes[ \"closed_by\" ], completion = LazyCompletion )\n- if \"comments\" in attributes and attributes[ \"comments\" ] is not None:\n+ if \"comments\" in attributes and attributes[ \"comments\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"comments\" ], int )\n self.__comments = attributes[ \"comments\" ]\n- if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None:\n+ if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"created_at\" ], ( str, unicode ) )\n self.__created_at = attributes[ \"created_at\" ]\n- if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None:\n+ if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"html_url\" ], ( str, unicode ) )\n self.__html_url = attributes[ \"html_url\" ]\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"id\" ], int )\n self.__id = attributes[ \"id\" ]\n- if \"labels\" in attributes and attributes[ \"labels\" ] is not None:\n+ if \"labels\" in attributes and attributes[ \"labels\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"labels\" ], list ) and ( len( attributes[ \"labels\" ] ) == 0 or isinstance( attributes[ \"labels\" ][ 0 ], dict ) )\n self.__labels = [\n Label.Label( self.__requester, element, completion = LazyCompletion )\n for element in attributes[ \"labels\" ]\n ]\n- if \"milestone\" in attributes and attributes[ \"milestone\" ] is not None:\n+ if \"milestone\" in attributes and attributes[ \"milestone\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"milestone\" ], dict )\n self.__milestone = Milestone.Milestone( self.__requester, attributes[ \"milestone\" ], completion = LazyCompletion )\n- if \"number\" in attributes and attributes[ \"number\" ] is not None:\n+ if \"number\" in attributes and attributes[ \"number\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"number\" ], int )\n self.__number = attributes[ \"number\" ]\n- if \"pull_request\" in attributes and attributes[ \"pull_request\" ] is not None:\n+ if \"pull_request\" in attributes and attributes[ \"pull_request\" ] is not None: # pragma no branch\n self.__pull_request = attributes[ \"pull_request\" ]\n- if \"repository\" in attributes and attributes[ \"repository\" ] is not None:\n+ if \"repository\" in attributes and attributes[ \"repository\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"repository\" ], dict )\n self.__repository = Repository.Repository( self.__requester, attributes[ \"repository\" ], completion = LazyCompletion )\n- if \"state\" in attributes and attributes[ \"state\" ] is not None:\n+ if \"state\" in attributes and attributes[ \"state\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"state\" ], ( str, unicode ) )\n self.__state = attributes[ \"state\" ]\n- if \"title\" in attributes and attributes[ \"title\" ] is not None:\n+ if \"title\" in attributes and attributes[ \"title\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"title\" ], ( str, unicode ) )\n self.__title = attributes[ \"title\" ]\n- if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None:\n+ if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"updated_at\" ], ( str, unicode ) )\n self.__updated_at = attributes[ \"updated_at\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"url\" ], ( str, unicode ) )\n self.__url = attributes[ \"url\" ]\n- if \"user\" in attributes and attributes[ \"user\" ] is not None:\n+ if \"user\" in attributes and attributes[ \"user\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"user\" ], dict )\n self.__user = NamedUser.NamedUser( self.__requester, attributes[ \"user\" ], completion = LazyCompletion )","status":"modified","deletions":21,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Issue.py","changes":53,"additions":32,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Issue.py","filename":"src/github/Issue.py"},{"patch":"@@ -68,16 +68,16 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"body\", \"created_at\", \"id\", \"updated_at\", \"url\", \"user\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"body\" in attributes and attributes[ \"body\" ] is not None:\n+ if \"body\" in attributes and attributes[ \"body\" ] is not None: # pragma no branch\n self.__body = attributes[ \"body\" ]\n- if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None:\n+ if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None: # pragma no branch\n self.__created_at = attributes[ \"created_at\" ]\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n self.__id = attributes[ \"id\" ]\n- if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None:\n+ if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None: # pragma no branch\n self.__updated_at = attributes[ \"updated_at\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n self.__url = attributes[ \"url\" ]\n- if \"user\" in attributes and attributes[ \"user\" ] is not None:\n+ if \"user\" in attributes and attributes[ \"user\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"user\" ], dict )\n self.__user = NamedUser.NamedUser( self.__requester, attributes[ \"user\" ], completion = LazyCompletion )","status":"modified","deletions":6,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/IssueComment.py","changes":12,"additions":6,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/IssueComment.py","filename":"src/github/IssueComment.py"},{"patch":"@@ -78,24 +78,24 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"actor\", \"commit_id\", \"created_at\", \"event\", \"id\", \"issue\", \"url\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"actor\" in attributes and attributes[ \"actor\" ] is not None:\n+ if \"actor\" in attributes and attributes[ \"actor\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"actor\" ], dict )\n self.__actor = NamedUser.NamedUser( self.__requester, attributes[ \"actor\" ], completion = LazyCompletion )\n- if \"commit_id\" in attributes and attributes[ \"commit_id\" ] is not None:\n+ if \"commit_id\" in attributes and attributes[ \"commit_id\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"commit_id\" ], ( str, unicode ) )\n self.__commit_id = attributes[ \"commit_id\" ]\n- if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None:\n+ if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"created_at\" ], ( str, unicode ) )\n self.__created_at = attributes[ \"created_at\" ]\n- if \"event\" in attributes and attributes[ \"event\" ] is not None:\n+ if \"event\" in attributes and attributes[ \"event\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"event\" ], ( str, unicode ) )\n self.__event = attributes[ \"event\" ]\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"id\" ], int )\n self.__id = attributes[ \"id\" ]\n- if \"issue\" in attributes and attributes[ \"issue\" ] is not None:\n+ if \"issue\" in attributes and attributes[ \"issue\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"issue\" ], dict )\n self.__issue = Issue.Issue( self.__requester, attributes[ \"issue\" ], completion = LazyCompletion )\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"url\" ], ( str, unicode ) )\n self.__url = attributes[ \"url\" ]","status":"modified","deletions":7,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/IssueEvent.py","changes":14,"additions":7,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/IssueEvent.py","filename":"src/github/IssueEvent.py"},{"patch":"@@ -1,6 +1,8 @@\n # WARNING: this file is generated automaticaly.\n # Do not modify it manually, your work would be lost.\n \n+import urllib\n+\n import PaginatedList\n from GithubObject import *\n \n@@ -43,6 +45,11 @@ def edit( self, name, color ):\n )\n self.__useAttributes( data )\n \n+ # @toto Remove '_identity' from the normalized json description\n+ @property\n+ def _identity( self ):\n+ return urllib.quote( self.name )\n+\n def __initAttributes( self ):\n self.__color = None\n self.__name = None\n@@ -53,9 +60,9 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"color\", \"name\", \"url\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"color\" in attributes and attributes[ \"color\" ] is not None:\n+ if \"color\" in attributes and attributes[ \"color\" ] is not None: # pragma no branch\n self.__color = attributes[ \"color\" ]\n- if \"name\" in attributes and attributes[ \"name\" ] is not None:\n+ if \"name\" in attributes and attributes[ \"name\" ] is not None: # pragma no branch\n self.__name = attributes[ \"name\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n self.__url = attributes[ \"url\" ]","status":"modified","deletions":3,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Label.py","changes":13,"additions":10,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Label.py","filename":"src/github/Label.py"},{"patch":"@@ -114,36 +114,36 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"closed_issues\", \"created_at\", \"creator\", \"description\", \"due_on\", \"id\", \"number\", \"open_issues\", \"state\", \"title\", \"url\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"closed_issues\" in attributes and attributes[ \"closed_issues\" ] is not None:\n+ if \"closed_issues\" in attributes and attributes[ \"closed_issues\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"closed_issues\" ], int )\n self.__closed_issues = attributes[ \"closed_issues\" ]\n- if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None:\n+ if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"created_at\" ], ( str, unicode ) )\n self.__created_at = attributes[ \"created_at\" ]\n- if \"creator\" in attributes and attributes[ \"creator\" ] is not None:\n+ if \"creator\" in attributes and attributes[ \"creator\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"creator\" ], dict )\n self.__creator = NamedUser.NamedUser( self.__requester, attributes[ \"creator\" ], completion = LazyCompletion )\n- if \"description\" in attributes and attributes[ \"description\" ] is not None:\n+ if \"description\" in attributes and attributes[ \"description\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"description\" ], ( str, unicode ) )\n self.__description = attributes[ \"description\" ]\n- if \"due_on\" in attributes and attributes[ \"due_on\" ] is not None:\n+ if \"due_on\" in attributes and attributes[ \"due_on\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"due_on\" ], ( str, unicode ) )\n self.__due_on = attributes[ \"due_on\" ]\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"id\" ], int )\n self.__id = attributes[ \"id\" ]\n- if \"number\" in attributes and attributes[ \"number\" ] is not None:\n+ if \"number\" in attributes and attributes[ \"number\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"number\" ], int )\n self.__number = attributes[ \"number\" ]\n- if \"open_issues\" in attributes and attributes[ \"open_issues\" ] is not None:\n+ if \"open_issues\" in attributes and attributes[ \"open_issues\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"open_issues\" ], int )\n self.__open_issues = attributes[ \"open_issues\" ]\n- if \"state\" in attributes and attributes[ \"state\" ] is not None:\n+ if \"state\" in attributes and attributes[ \"state\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"state\" ], ( str, unicode ) )\n self.__state = attributes[ \"state\" ]\n- if \"title\" in attributes and attributes[ \"title\" ] is not None:\n+ if \"title\" in attributes and attributes[ \"title\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"title\" ], ( str, unicode ) )\n self.__title = attributes[ \"title\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"url\" ], ( str, unicode ) )\n self.__url = attributes[ \"url\" ]","status":"modified","deletions":11,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Milestone.py","changes":22,"additions":11,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Milestone.py","filename":"src/github/Milestone.py"},{"patch":"@@ -365,81 +365,81 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"avatar_url\", \"bio\", \"blog\", \"collaborators\", \"company\", \"contributions\", \"created_at\", \"disk_usage\", \"email\", \"followers\", \"following\", \"gravatar_id\", \"hireable\", \"html_url\", \"id\", \"location\", \"login\", \"name\", \"owned_private_repos\", \"plan\", \"private_gists\", \"public_gists\", \"public_repos\", \"total_private_repos\", \"type\", \"url\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"avatar_url\" in attributes and attributes[ \"avatar_url\" ] is not None:\n+ if \"avatar_url\" in attributes and attributes[ \"avatar_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"avatar_url\" ], ( str, unicode ) )\n self.__avatar_url = attributes[ \"avatar_url\" ]\n- if \"bio\" in attributes and attributes[ \"bio\" ] is not None:\n+ if \"bio\" in attributes and attributes[ \"bio\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"bio\" ], ( str, unicode ) )\n self.__bio = attributes[ \"bio\" ]\n- if \"blog\" in attributes and attributes[ \"blog\" ] is not None:\n+ if \"blog\" in attributes and attributes[ \"blog\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"blog\" ], ( str, unicode ) )\n self.__blog = attributes[ \"blog\" ]\n- if \"collaborators\" in attributes and attributes[ \"collaborators\" ] is not None:\n+ if \"collaborators\" in attributes and attributes[ \"collaborators\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"collaborators\" ], int )\n self.__collaborators = attributes[ \"collaborators\" ]\n- if \"company\" in attributes and attributes[ \"company\" ] is not None:\n+ if \"company\" in attributes and attributes[ \"company\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"company\" ], ( str, unicode ) )\n self.__company = attributes[ \"company\" ]\n- if \"contributions\" in attributes and attributes[ \"contributions\" ] is not None:\n+ if \"contributions\" in attributes and attributes[ \"contributions\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"contributions\" ], int )\n self.__contributions = attributes[ \"contributions\" ]\n- if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None:\n+ if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"created_at\" ], ( str, unicode ) )\n self.__created_at = attributes[ \"created_at\" ]\n- if \"disk_usage\" in attributes and attributes[ \"disk_usage\" ] is not None:\n+ if \"disk_usage\" in attributes and attributes[ \"disk_usage\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"disk_usage\" ], int )\n self.__disk_usage = attributes[ \"disk_usage\" ]\n- if \"email\" in attributes and attributes[ \"email\" ] is not None:\n+ if \"email\" in attributes and attributes[ \"email\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"email\" ], ( str, unicode ) )\n self.__email = attributes[ \"email\" ]\n- if \"followers\" in attributes and attributes[ \"followers\" ] is not None:\n+ if \"followers\" in attributes and attributes[ \"followers\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"followers\" ], int )\n self.__followers = attributes[ \"followers\" ]\n- if \"following\" in attributes and attributes[ \"following\" ] is not None:\n+ if \"following\" in attributes and attributes[ \"following\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"following\" ], int )\n self.__following = attributes[ \"following\" ]\n- if \"gravatar_id\" in attributes and attributes[ \"gravatar_id\" ] is not None:\n+ if \"gravatar_id\" in attributes and attributes[ \"gravatar_id\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"gravatar_id\" ], ( str, unicode ) )\n self.__gravatar_id = attributes[ \"gravatar_id\" ]\n- if \"hireable\" in attributes and attributes[ \"hireable\" ] is not None:\n+ if \"hireable\" in attributes and attributes[ \"hireable\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"hireable\" ], bool )\n self.__hireable = attributes[ \"hireable\" ]\n- if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None:\n+ if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"html_url\" ], ( str, unicode ) )\n self.__html_url = attributes[ \"html_url\" ]\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"id\" ], int )\n self.__id = attributes[ \"id\" ]\n- if \"location\" in attributes and attributes[ \"location\" ] is not None:\n+ if \"location\" in attributes and attributes[ \"location\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"location\" ], ( str, unicode ) )\n self.__location = attributes[ \"location\" ]\n- if \"login\" in attributes and attributes[ \"login\" ] is not None:\n+ if \"login\" in attributes and attributes[ \"login\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"login\" ], ( str, unicode ) )\n self.__login = attributes[ \"login\" ]\n- if \"name\" in attributes and attributes[ \"name\" ] is not None:\n+ if \"name\" in attributes and attributes[ \"name\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"name\" ], ( str, unicode ) )\n self.__name = attributes[ \"name\" ]\n- if \"owned_private_repos\" in attributes and attributes[ \"owned_private_repos\" ] is not None:\n+ if \"owned_private_repos\" in attributes and attributes[ \"owned_private_repos\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"owned_private_repos\" ], int )\n self.__owned_private_repos = attributes[ \"owned_private_repos\" ]\n- if \"plan\" in attributes and attributes[ \"plan\" ] is not None:\n+ if \"plan\" in attributes and attributes[ \"plan\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"plan\" ], dict )\n self.__plan = Plan.Plan( self.__requester, attributes[ \"plan\" ], completion = LazyCompletion )\n- if \"private_gists\" in attributes and attributes[ \"private_gists\" ] is not None:\n+ if \"private_gists\" in attributes and attributes[ \"private_gists\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"private_gists\" ], int )\n self.__private_gists = attributes[ \"private_gists\" ]\n- if \"public_gists\" in attributes and attributes[ \"public_gists\" ] is not None:\n+ if \"public_gists\" in attributes and attributes[ \"public_gists\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"public_gists\" ], int )\n self.__public_gists = attributes[ \"public_gists\" ]\n- if \"public_repos\" in attributes and attributes[ \"public_repos\" ] is not None:\n+ if \"public_repos\" in attributes and attributes[ \"public_repos\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"public_repos\" ], int )\n self.__public_repos = attributes[ \"public_repos\" ]\n- if \"total_private_repos\" in attributes and attributes[ \"total_private_repos\" ] is not None:\n+ if \"total_private_repos\" in attributes and attributes[ \"total_private_repos\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"total_private_repos\" ], int )\n self.__total_private_repos = attributes[ \"total_private_repos\" ]\n- if \"type\" in attributes and attributes[ \"type\" ] is not None:\n+ if \"type\" in attributes and attributes[ \"type\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"type\" ], ( str, unicode ) )\n self.__type = attributes[ \"type\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"url\" ], ( str, unicode ) )\n self.__url = attributes[ \"url\" ]","status":"modified","deletions":26,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/NamedUser.py","changes":52,"additions":26,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/NamedUser.py","filename":"src/github/NamedUser.py"},{"patch":"@@ -390,75 +390,75 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"avatar_url\", \"billing_email\", \"blog\", \"collaborators\", \"company\", \"created_at\", \"disk_usage\", \"email\", \"followers\", \"following\", \"gravatar_id\", \"html_url\", \"id\", \"location\", \"login\", \"name\", \"owned_private_repos\", \"plan\", \"private_gists\", \"public_gists\", \"public_repos\", \"total_private_repos\", \"type\", \"url\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"avatar_url\" in attributes and attributes[ \"avatar_url\" ] is not None:\n+ if \"avatar_url\" in attributes and attributes[ \"avatar_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"avatar_url\" ], ( str, unicode ) )\n self.__avatar_url = attributes[ \"avatar_url\" ]\n- if \"billing_email\" in attributes and attributes[ \"billing_email\" ] is not None:\n+ if \"billing_email\" in attributes and attributes[ \"billing_email\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"billing_email\" ], ( str, unicode ) )\n self.__billing_email = attributes[ \"billing_email\" ]\n- if \"blog\" in attributes and attributes[ \"blog\" ] is not None:\n+ if \"blog\" in attributes and attributes[ \"blog\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"blog\" ], ( str, unicode ) )\n self.__blog = attributes[ \"blog\" ]\n- if \"collaborators\" in attributes and attributes[ \"collaborators\" ] is not None:\n+ if \"collaborators\" in attributes and attributes[ \"collaborators\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"collaborators\" ], int )\n self.__collaborators = attributes[ \"collaborators\" ]\n- if \"company\" in attributes and attributes[ \"company\" ] is not None:\n+ if \"company\" in attributes and attributes[ \"company\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"company\" ], ( str, unicode ) )\n self.__company = attributes[ \"company\" ]\n- if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None:\n+ if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"created_at\" ], ( str, unicode ) )\n self.__created_at = attributes[ \"created_at\" ]\n- if \"disk_usage\" in attributes and attributes[ \"disk_usage\" ] is not None:\n+ if \"disk_usage\" in attributes and attributes[ \"disk_usage\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"disk_usage\" ], int )\n self.__disk_usage = attributes[ \"disk_usage\" ]\n- if \"email\" in attributes and attributes[ \"email\" ] is not None:\n+ if \"email\" in attributes and attributes[ \"email\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"email\" ], ( str, unicode ) )\n self.__email = attributes[ \"email\" ]\n- if \"followers\" in attributes and attributes[ \"followers\" ] is not None:\n+ if \"followers\" in attributes and attributes[ \"followers\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"followers\" ], int )\n self.__followers = attributes[ \"followers\" ]\n- if \"following\" in attributes and attributes[ \"following\" ] is not None:\n+ if \"following\" in attributes and attributes[ \"following\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"following\" ], int )\n self.__following = attributes[ \"following\" ]\n- if \"gravatar_id\" in attributes and attributes[ \"gravatar_id\" ] is not None:\n+ if \"gravatar_id\" in attributes and attributes[ \"gravatar_id\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"gravatar_id\" ], ( str, unicode ) )\n self.__gravatar_id = attributes[ \"gravatar_id\" ]\n- if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None:\n+ if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"html_url\" ], ( str, unicode ) )\n self.__html_url = attributes[ \"html_url\" ]\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"id\" ], int )\n self.__id = attributes[ \"id\" ]\n- if \"location\" in attributes and attributes[ \"location\" ] is not None:\n+ if \"location\" in attributes and attributes[ \"location\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"location\" ], ( str, unicode ) )\n self.__location = attributes[ \"location\" ]\n- if \"login\" in attributes and attributes[ \"login\" ] is not None:\n+ if \"login\" in attributes and attributes[ \"login\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"login\" ], ( str, unicode ) )\n self.__login = attributes[ \"login\" ]\n- if \"name\" in attributes and attributes[ \"name\" ] is not None:\n+ if \"name\" in attributes and attributes[ \"name\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"name\" ], ( str, unicode ) )\n self.__name = attributes[ \"name\" ]\n- if \"owned_private_repos\" in attributes and attributes[ \"owned_private_repos\" ] is not None:\n+ if \"owned_private_repos\" in attributes and attributes[ \"owned_private_repos\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"owned_private_repos\" ], int )\n self.__owned_private_repos = attributes[ \"owned_private_repos\" ]\n- if \"plan\" in attributes and attributes[ \"plan\" ] is not None:\n+ if \"plan\" in attributes and attributes[ \"plan\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"plan\" ], dict )\n self.__plan = Plan.Plan( self.__requester, attributes[ \"plan\" ], completion = LazyCompletion )\n- if \"private_gists\" in attributes and attributes[ \"private_gists\" ] is not None:\n+ if \"private_gists\" in attributes and attributes[ \"private_gists\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"private_gists\" ], int )\n self.__private_gists = attributes[ \"private_gists\" ]\n- if \"public_gists\" in attributes and attributes[ \"public_gists\" ] is not None:\n+ if \"public_gists\" in attributes and attributes[ \"public_gists\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"public_gists\" ], int )\n self.__public_gists = attributes[ \"public_gists\" ]\n- if \"public_repos\" in attributes and attributes[ \"public_repos\" ] is not None:\n+ if \"public_repos\" in attributes and attributes[ \"public_repos\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"public_repos\" ], int )\n self.__public_repos = attributes[ \"public_repos\" ]\n- if \"total_private_repos\" in attributes and attributes[ \"total_private_repos\" ] is not None:\n+ if \"total_private_repos\" in attributes and attributes[ \"total_private_repos\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"total_private_repos\" ], int )\n self.__total_private_repos = attributes[ \"total_private_repos\" ]\n- if \"type\" in attributes and attributes[ \"type\" ] is not None:\n+ if \"type\" in attributes and attributes[ \"type\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"type\" ], ( str, unicode ) )\n self.__type = attributes[ \"type\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"url\" ], ( str, unicode ) )\n self.__url = attributes[ \"url\" ]","status":"modified","deletions":24,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Organization.py","changes":48,"additions":24,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Organization.py","filename":"src/github/Organization.py"},{"patch":"@@ -32,12 +32,12 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"admin\", \"pull\", \"push\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"admin\" in attributes and attributes[ \"admin\" ] is not None:\n+ if \"admin\" in attributes and attributes[ \"admin\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"admin\" ], bool )\n self.__admin = attributes[ \"admin\" ]\n- if \"pull\" in attributes and attributes[ \"pull\" ] is not None:\n+ if \"pull\" in attributes and attributes[ \"pull\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"pull\" ], bool )\n self.__pull = attributes[ \"pull\" ]\n- if \"push\" in attributes and attributes[ \"push\" ] is not None:\n+ if \"push\" in attributes and attributes[ \"push\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"push\" ], bool )\n self.__push = attributes[ \"push\" ]","status":"modified","deletions":3,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Permissions.py","changes":6,"additions":3,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Permissions.py","filename":"src/github/Permissions.py"},{"patch":"@@ -37,15 +37,15 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"collaborators\", \"name\", \"private_repos\", \"space\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"collaborators\" in attributes and attributes[ \"collaborators\" ] is not None:\n+ if \"collaborators\" in attributes and attributes[ \"collaborators\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"collaborators\" ], int )\n self.__collaborators = attributes[ \"collaborators\" ]\n- if \"name\" in attributes and attributes[ \"name\" ] is not None:\n+ if \"name\" in attributes and attributes[ \"name\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"name\" ], ( str, unicode ) )\n self.__name = attributes[ \"name\" ]\n- if \"private_repos\" in attributes and attributes[ \"private_repos\" ] is not None:\n+ if \"private_repos\" in attributes and attributes[ \"private_repos\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"private_repos\" ], int )\n self.__private_repos = attributes[ \"private_repos\" ]\n- if \"space\" in attributes and attributes[ \"space\" ] is not None:\n+ if \"space\" in attributes and attributes[ \"space\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"space\" ], int )\n self.__space = attributes[ \"space\" ]","status":"modified","deletions":4,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Plan.py","changes":8,"additions":4,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Plan.py","filename":"src/github/Plan.py"},{"patch":"@@ -279,56 +279,56 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"additions\", \"base\", \"body\", \"changed_files\", \"closed_at\", \"comments\", \"commits\", \"created_at\", \"deletions\", \"diff_url\", \"head\", \"html_url\", \"id\", \"issue_url\", \"mergeable\", \"merged\", \"merged_at\", \"merged_by\", \"number\", \"patch_url\", \"review_comments\", \"state\", \"title\", \"updated_at\", \"url\", \"user\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"additions\" in attributes and attributes[ \"additions\" ] is not None:\n+ if \"additions\" in attributes and attributes[ \"additions\" ] is not None: # pragma no branch\n self.__additions = attributes[ \"additions\" ]\n- if \"base\" in attributes and attributes[ \"base\" ] is not None:\n+ if \"base\" in attributes and attributes[ \"base\" ] is not None: # pragma no branch\n self.__base = attributes[ \"base\" ]\n- if \"body\" in attributes and attributes[ \"body\" ] is not None:\n+ if \"body\" in attributes and attributes[ \"body\" ] is not None: # pragma no branch\n self.__body = attributes[ \"body\" ]\n- if \"changed_files\" in attributes and attributes[ \"changed_files\" ] is not None:\n+ if \"changed_files\" in attributes and attributes[ \"changed_files\" ] is not None: # pragma no branch\n self.__changed_files = attributes[ \"changed_files\" ]\n- if \"closed_at\" in attributes and attributes[ \"closed_at\" ] is not None:\n+ if \"closed_at\" in attributes and attributes[ \"closed_at\" ] is not None: # pragma no branch\n self.__closed_at = attributes[ \"closed_at\" ]\n- if \"comments\" in attributes and attributes[ \"comments\" ] is not None:\n+ if \"comments\" in attributes and attributes[ \"comments\" ] is not None: # pragma no branch\n self.__comments = attributes[ \"comments\" ]\n- if \"commits\" in attributes and attributes[ \"commits\" ] is not None:\n+ if \"commits\" in attributes and attributes[ \"commits\" ] is not None: # pragma no branch\n self.__commits = attributes[ \"commits\" ]\n- if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None:\n+ if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None: # pragma no branch\n self.__created_at = attributes[ \"created_at\" ]\n- if \"deletions\" in attributes and attributes[ \"deletions\" ] is not None:\n+ if \"deletions\" in attributes and attributes[ \"deletions\" ] is not None: # pragma no branch\n self.__deletions = attributes[ \"deletions\" ]\n- if \"diff_url\" in attributes and attributes[ \"diff_url\" ] is not None:\n+ if \"diff_url\" in attributes and attributes[ \"diff_url\" ] is not None: # pragma no branch\n self.__diff_url = attributes[ \"diff_url\" ]\n- if \"head\" in attributes and attributes[ \"head\" ] is not None:\n+ if \"head\" in attributes and attributes[ \"head\" ] is not None: # pragma no branch\n self.__head = attributes[ \"head\" ]\n- if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None:\n+ if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None: # pragma no branch\n self.__html_url = attributes[ \"html_url\" ]\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n self.__id = attributes[ \"id\" ]\n- if \"issue_url\" in attributes and attributes[ \"issue_url\" ] is not None:\n+ if \"issue_url\" in attributes and attributes[ \"issue_url\" ] is not None: # pragma no branch\n self.__issue_url = attributes[ \"issue_url\" ]\n- if \"mergeable\" in attributes and attributes[ \"mergeable\" ] is not None:\n+ if \"mergeable\" in attributes and attributes[ \"mergeable\" ] is not None: # pragma no branch\n self.__mergeable = attributes[ \"mergeable\" ]\n- if \"merged\" in attributes and attributes[ \"merged\" ] is not None:\n+ if \"merged\" in attributes and attributes[ \"merged\" ] is not None: # pragma no branch\n self.__merged = attributes[ \"merged\" ]\n- if \"merged_at\" in attributes and attributes[ \"merged_at\" ] is not None:\n+ if \"merged_at\" in attributes and attributes[ \"merged_at\" ] is not None: # pragma no branch\n self.__merged_at = attributes[ \"merged_at\" ]\n- if \"merged_by\" in attributes and attributes[ \"merged_by\" ] is not None:\n+ if \"merged_by\" in attributes and attributes[ \"merged_by\" ] is not None: # pragma no branch\n self.__merged_by = attributes[ \"merged_by\" ]\n- if \"number\" in attributes and attributes[ \"number\" ] is not None:\n+ if \"number\" in attributes and attributes[ \"number\" ] is not None: # pragma no branch\n self.__number = attributes[ \"number\" ]\n- if \"patch_url\" in attributes and attributes[ \"patch_url\" ] is not None:\n+ if \"patch_url\" in attributes and attributes[ \"patch_url\" ] is not None: # pragma no branch\n self.__patch_url = attributes[ \"patch_url\" ]\n- if \"review_comments\" in attributes and attributes[ \"review_comments\" ] is not None:\n+ if \"review_comments\" in attributes and attributes[ \"review_comments\" ] is not None: # pragma no branch\n self.__review_comments = attributes[ \"review_comments\" ]\n- if \"state\" in attributes and attributes[ \"state\" ] is not None:\n+ if \"state\" in attributes and attributes[ \"state\" ] is not None: # pragma no branch\n self.__state = attributes[ \"state\" ]\n- if \"title\" in attributes and attributes[ \"title\" ] is not None:\n+ if \"title\" in attributes and attributes[ \"title\" ] is not None: # pragma no branch\n self.__title = attributes[ \"title\" ]\n- if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None:\n+ if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None: # pragma no branch\n self.__updated_at = attributes[ \"updated_at\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n self.__url = attributes[ \"url\" ]\n- if \"user\" in attributes and attributes[ \"user\" ] is not None:\n+ if \"user\" in attributes and attributes[ \"user\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"user\" ], dict )\n self.__user = NamedUser.NamedUser( self.__requester, attributes[ \"user\" ], completion = LazyCompletion )","status":"modified","deletions":26,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/PullRequest.py","changes":52,"additions":26,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/PullRequest.py","filename":"src/github/PullRequest.py"},{"patch":"@@ -121,26 +121,26 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"body\", \"commit_id\", \"created_at\", \"html_url\", \"id\", \"line\", \"path\", \"position\", \"updated_at\", \"url\", \"user\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"body\" in attributes and attributes[ \"body\" ] is not None:\n+ if \"body\" in attributes and attributes[ \"body\" ] is not None: # pragma no branch\n self.__body = attributes[ \"body\" ]\n- if \"commit_id\" in attributes and attributes[ \"commit_id\" ] is not None:\n+ if \"commit_id\" in attributes and attributes[ \"commit_id\" ] is not None: # pragma no branch\n self.__commit_id = attributes[ \"commit_id\" ]\n- if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None:\n+ if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None: # pragma no branch\n self.__created_at = attributes[ \"created_at\" ]\n- if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None:\n+ if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None: # pragma no branch\n self.__html_url = attributes[ \"html_url\" ]\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n self.__id = attributes[ \"id\" ]\n- if \"line\" in attributes and attributes[ \"line\" ] is not None:\n+ if \"line\" in attributes and attributes[ \"line\" ] is not None: # pragma no branch\n self.__line = attributes[ \"line\" ]\n- if \"path\" in attributes and attributes[ \"path\" ] is not None:\n+ if \"path\" in attributes and attributes[ \"path\" ] is not None: # pragma no branch\n self.__path = attributes[ \"path\" ]\n- if \"position\" in attributes and attributes[ \"position\" ] is not None:\n+ if \"position\" in attributes and attributes[ \"position\" ] is not None: # pragma no branch\n self.__position = attributes[ \"position\" ]\n- if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None:\n+ if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None: # pragma no branch\n self.__updated_at = attributes[ \"updated_at\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n self.__url = attributes[ \"url\" ]\n- if \"user\" in attributes and attributes[ \"user\" ] is not None:\n+ if \"user\" in attributes and attributes[ \"user\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"user\" ], dict )\n self.__user = NamedUser.NamedUser( self.__requester, attributes[ \"user\" ], completion = LazyCompletion )","status":"modified","deletions":11,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/PullRequestComment.py","changes":22,"additions":11,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/PullRequestComment.py","filename":"src/github/PullRequestComment.py"},{"patch":"@@ -62,21 +62,21 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"additions\", \"blob_url\", \"changes\", \"deletions\", \"filename\", \"patch\", \"raw_url\", \"sha\", \"status\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"additions\" in attributes and attributes[ \"additions\" ] is not None:\n+ if \"additions\" in attributes and attributes[ \"additions\" ] is not None: # pragma no branch\n self.__additions = attributes[ \"additions\" ]\n- if \"blob_url\" in attributes and attributes[ \"blob_url\" ] is not None:\n+ if \"blob_url\" in attributes and attributes[ \"blob_url\" ] is not None: # pragma no branch\n self.__blob_url = attributes[ \"blob_url\" ]\n- if \"changes\" in attributes and attributes[ \"changes\" ] is not None:\n+ if \"changes\" in attributes and attributes[ \"changes\" ] is not None: # pragma no branch\n self.__changes = attributes[ \"changes\" ]\n- if \"deletions\" in attributes and attributes[ \"deletions\" ] is not None:\n+ if \"deletions\" in attributes and attributes[ \"deletions\" ] is not None: # pragma no branch\n self.__deletions = attributes[ \"deletions\" ]\n- if \"filename\" in attributes and attributes[ \"filename\" ] is not None:\n+ if \"filename\" in attributes and attributes[ \"filename\" ] is not None: # pragma no branch\n self.__filename = attributes[ \"filename\" ]\n- if \"patch\" in attributes and attributes[ \"patch\" ] is not None:\n+ if \"patch\" in attributes and attributes[ \"patch\" ] is not None: # pragma no branch\n self.__patch = attributes[ \"patch\" ]\n- if \"raw_url\" in attributes and attributes[ \"raw_url\" ] is not None:\n+ if \"raw_url\" in attributes and attributes[ \"raw_url\" ] is not None: # pragma no branch\n self.__raw_url = attributes[ \"raw_url\" ]\n- if \"sha\" in attributes and attributes[ \"sha\" ] is not None:\n+ if \"sha\" in attributes and attributes[ \"sha\" ] is not None: # pragma no branch\n self.__sha = attributes[ \"sha\" ]\n- if \"status\" in attributes and attributes[ \"status\" ] is not None:\n+ if \"status\" in attributes and attributes[ \"status\" ] is not None: # pragma no branch\n self.__status = attributes[ \"status\" ]","status":"modified","deletions":9,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/PullRequestFile.py","changes":18,"additions":9,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/PullRequestFile.py","filename":"src/github/PullRequestFile.py"},{"patch":"@@ -905,96 +905,96 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"clone_url\", \"created_at\", \"description\", \"fork\", \"forks\", \"full_name\", \"git_url\", \"has_downloads\", \"has_issues\", \"has_wiki\", \"homepage\", \"html_url\", \"id\", \"language\", \"master_branch\", \"mirror_url\", \"name\", \"open_issues\", \"organization\", \"owner\", \"parent\", \"permissions\", \"private\", \"pushed_at\", \"size\", \"source\", \"ssh_url\", \"svn_url\", \"updated_at\", \"url\", \"watchers\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"clone_url\" in attributes and attributes[ \"clone_url\" ] is not None:\n+ if \"clone_url\" in attributes and attributes[ \"clone_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"clone_url\" ], ( str, unicode ) )\n self.__clone_url = attributes[ \"clone_url\" ]\n- if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None:\n+ if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"created_at\" ], ( str, unicode ) )\n self.__created_at = attributes[ \"created_at\" ]\n- if \"description\" in attributes and attributes[ \"description\" ] is not None:\n+ if \"description\" in attributes and attributes[ \"description\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"description\" ], ( str, unicode ) )\n self.__description = attributes[ \"description\" ]\n- if \"fork\" in attributes and attributes[ \"fork\" ] is not None:\n+ if \"fork\" in attributes and attributes[ \"fork\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"fork\" ], bool )\n self.__fork = attributes[ \"fork\" ]\n- if \"forks\" in attributes and attributes[ \"forks\" ] is not None:\n+ if \"forks\" in attributes and attributes[ \"forks\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"forks\" ], int )\n self.__forks = attributes[ \"forks\" ]\n- if \"full_name\" in attributes and attributes[ \"full_name\" ] is not None:\n+ if \"full_name\" in attributes and attributes[ \"full_name\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"full_name\" ], ( str, unicode ) )\n self.__full_name = attributes[ \"full_name\" ]\n- if \"git_url\" in attributes and attributes[ \"git_url\" ] is not None:\n+ if \"git_url\" in attributes and attributes[ \"git_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"git_url\" ], ( str, unicode ) )\n self.__git_url = attributes[ \"git_url\" ]\n- if \"has_downloads\" in attributes and attributes[ \"has_downloads\" ] is not None:\n+ if \"has_downloads\" in attributes and attributes[ \"has_downloads\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"has_downloads\" ], bool )\n self.__has_downloads = attributes[ \"has_downloads\" ]\n- if \"has_issues\" in attributes and attributes[ \"has_issues\" ] is not None:\n+ if \"has_issues\" in attributes and attributes[ \"has_issues\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"has_issues\" ], bool )\n self.__has_issues = attributes[ \"has_issues\" ]\n- if \"has_wiki\" in attributes and attributes[ \"has_wiki\" ] is not None:\n+ if \"has_wiki\" in attributes and attributes[ \"has_wiki\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"has_wiki\" ], bool )\n self.__has_wiki = attributes[ \"has_wiki\" ]\n- if \"homepage\" in attributes and attributes[ \"homepage\" ] is not None:\n+ if \"homepage\" in attributes and attributes[ \"homepage\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"homepage\" ], ( str, unicode ) )\n self.__homepage = attributes[ \"homepage\" ]\n- if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None:\n+ if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"html_url\" ], ( str, unicode ) )\n self.__html_url = attributes[ \"html_url\" ]\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"id\" ], int )\n self.__id = attributes[ \"id\" ]\n- if \"language\" in attributes and attributes[ \"language\" ] is not None:\n+ if \"language\" in attributes and attributes[ \"language\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"language\" ], ( str, unicode ) )\n self.__language = attributes[ \"language\" ]\n- if \"master_branch\" in attributes and attributes[ \"master_branch\" ] is not None:\n+ if \"master_branch\" in attributes and attributes[ \"master_branch\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"master_branch\" ], ( str, unicode ) )\n self.__master_branch = attributes[ \"master_branch\" ]\n- if \"mirror_url\" in attributes and attributes[ \"mirror_url\" ] is not None:\n+ if \"mirror_url\" in attributes and attributes[ \"mirror_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"mirror_url\" ], ( str, unicode ) )\n self.__mirror_url = attributes[ \"mirror_url\" ]\n- if \"name\" in attributes and attributes[ \"name\" ] is not None:\n+ if \"name\" in attributes and attributes[ \"name\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"name\" ], ( str, unicode ) )\n self.__name = attributes[ \"name\" ]\n- if \"open_issues\" in attributes and attributes[ \"open_issues\" ] is not None:\n+ if \"open_issues\" in attributes and attributes[ \"open_issues\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"open_issues\" ], int )\n self.__open_issues = attributes[ \"open_issues\" ]\n- if \"organization\" in attributes and attributes[ \"organization\" ] is not None:\n+ if \"organization\" in attributes and attributes[ \"organization\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"organization\" ], dict )\n self.__organization = Organization.Organization( self.__requester, attributes[ \"organization\" ], completion = LazyCompletion )\n- if \"owner\" in attributes and attributes[ \"owner\" ] is not None:\n+ if \"owner\" in attributes and attributes[ \"owner\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"owner\" ], dict )\n self.__owner = NamedUser.NamedUser( self.__requester, attributes[ \"owner\" ], completion = LazyCompletion )\n- if \"parent\" in attributes and attributes[ \"parent\" ] is not None:\n+ if \"parent\" in attributes and attributes[ \"parent\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"parent\" ], dict )\n self.__parent = Repository( self.__requester, attributes[ \"parent\" ], completion = LazyCompletion )\n- if \"permissions\" in attributes and attributes[ \"permissions\" ] is not None:\n+ if \"permissions\" in attributes and attributes[ \"permissions\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"permissions\" ], dict )\n self.__permissions = Permissions.Permissions( self.__requester, attributes[ \"permissions\" ], completion = LazyCompletion )\n- if \"private\" in attributes and attributes[ \"private\" ] is not None:\n+ if \"private\" in attributes and attributes[ \"private\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"private\" ], bool )\n self.__private = attributes[ \"private\" ]\n- if \"pushed_at\" in attributes and attributes[ \"pushed_at\" ] is not None:\n+ if \"pushed_at\" in attributes and attributes[ \"pushed_at\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"pushed_at\" ], ( str, unicode ) )\n self.__pushed_at = attributes[ \"pushed_at\" ]\n- if \"size\" in attributes and attributes[ \"size\" ] is not None:\n+ if \"size\" in attributes and attributes[ \"size\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"size\" ], int )\n self.__size = attributes[ \"size\" ]\n- if \"source\" in attributes and attributes[ \"source\" ] is not None:\n+ if \"source\" in attributes and attributes[ \"source\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"source\" ], dict )\n self.__source = Repository( self.__requester, attributes[ \"source\" ], completion = LazyCompletion )\n- if \"ssh_url\" in attributes and attributes[ \"ssh_url\" ] is not None:\n+ if \"ssh_url\" in attributes and attributes[ \"ssh_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"ssh_url\" ], ( str, unicode ) )\n self.__ssh_url = attributes[ \"ssh_url\" ]\n- if \"svn_url\" in attributes and attributes[ \"svn_url\" ] is not None:\n+ if \"svn_url\" in attributes and attributes[ \"svn_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"svn_url\" ], ( str, unicode ) )\n self.__svn_url = attributes[ \"svn_url\" ]\n- if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None:\n+ if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"updated_at\" ], ( str, unicode ) )\n self.__updated_at = attributes[ \"updated_at\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"url\" ], ( str, unicode ) )\n self.__url = attributes[ \"url\" ]\n- if \"watchers\" in attributes and attributes[ \"watchers\" ] is not None:\n+ if \"watchers\" in attributes and attributes[ \"watchers\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"watchers\" ], int )\n self.__watchers = attributes[ \"watchers\" ]","status":"modified","deletions":31,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Repository.py","changes":62,"additions":31,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Repository.py","filename":"src/github/Repository.py"},{"patch":"@@ -87,14 +87,14 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"id\", \"key\", \"title\", \"url\", \"verified\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n self.__id = attributes[ \"id\" ]\n- if \"key\" in attributes and attributes[ \"key\" ] is not None:\n+ if \"key\" in attributes and attributes[ \"key\" ] is not None: # pragma no branch\n self.__key = attributes[ \"key\" ]\n- if \"title\" in attributes and attributes[ \"title\" ] is not None:\n+ if \"title\" in attributes and attributes[ \"title\" ] is not None: # pragma no branch\n self.__title = attributes[ \"title\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n self.__url = attributes[ \"url\" ]\n- if \"verified\" in attributes and attributes[ \"verified\" ] is not None:\n+ if \"verified\" in attributes and attributes[ \"verified\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"verified\" ], bool )\n self.__verified = attributes[ \"verified\" ]","status":"modified","deletions":5,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/RepositoryKey.py","changes":10,"additions":5,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/RepositoryKey.py","filename":"src/github/RepositoryKey.py"},{"patch":"@@ -38,15 +38,15 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"commit\", \"name\", \"tarball_url\", \"zipball_url\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"commit\" in attributes and attributes[ \"commit\" ] is not None:\n+ if \"commit\" in attributes and attributes[ \"commit\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"commit\" ], dict )\n self.__commit = Commit.Commit( self.__requester, attributes[ \"commit\" ], completion = LazyCompletion )\n- if \"name\" in attributes and attributes[ \"name\" ] is not None:\n+ if \"name\" in attributes and attributes[ \"name\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"name\" ], ( str, unicode ) )\n self.__name = attributes[ \"name\" ]\n- if \"tarball_url\" in attributes and attributes[ \"tarball_url\" ] is not None:\n+ if \"tarball_url\" in attributes and attributes[ \"tarball_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"tarball_url\" ], ( str, unicode ) )\n self.__tarball_url = attributes[ \"tarball_url\" ]\n- if \"zipball_url\" in attributes and attributes[ \"zipball_url\" ] is not None:\n+ if \"zipball_url\" in attributes and attributes[ \"zipball_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"zipball_url\" ], ( str, unicode ) )\n self.__zipball_url = attributes[ \"zipball_url\" ]","status":"modified","deletions":4,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Tag.py","changes":8,"additions":4,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Tag.py","filename":"src/github/Tag.py"},{"patch":"@@ -172,15 +172,15 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"id\", \"members_count\", \"name\", \"permission\", \"repos_count\", \"url\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n self.__id = attributes[ \"id\" ]\n- if \"members_count\" in attributes and attributes[ \"members_count\" ] is not None:\n+ if \"members_count\" in attributes and attributes[ \"members_count\" ] is not None: # pragma no branch\n self.__members_count = attributes[ \"members_count\" ]\n- if \"name\" in attributes and attributes[ \"name\" ] is not None:\n+ if \"name\" in attributes and attributes[ \"name\" ] is not None: # pragma no branch\n self.__name = attributes[ \"name\" ]\n- if \"permission\" in attributes and attributes[ \"permission\" ] is not None:\n+ if \"permission\" in attributes and attributes[ \"permission\" ] is not None: # pragma no branch\n self.__permission = attributes[ \"permission\" ]\n- if \"repos_count\" in attributes and attributes[ \"repos_count\" ] is not None:\n+ if \"repos_count\" in attributes and attributes[ \"repos_count\" ] is not None: # pragma no branch\n self.__repos_count = attributes[ \"repos_count\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n self.__url = attributes[ \"url\" ]","status":"modified","deletions":6,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Team.py","changes":12,"additions":6,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Team.py","filename":"src/github/Team.py"},{"patch":"@@ -87,14 +87,14 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"id\", \"key\", \"title\", \"url\", \"verified\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n self.__id = attributes[ \"id\" ]\n- if \"key\" in attributes and attributes[ \"key\" ] is not None:\n+ if \"key\" in attributes and attributes[ \"key\" ] is not None: # pragma no branch\n self.__key = attributes[ \"key\" ]\n- if \"title\" in attributes and attributes[ \"title\" ] is not None:\n+ if \"title\" in attributes and attributes[ \"title\" ] is not None: # pragma no branch\n self.__title = attributes[ \"title\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n self.__url = attributes[ \"url\" ]\n- if \"verified\" in attributes and attributes[ \"verified\" ] is not None:\n+ if \"verified\" in attributes and attributes[ \"verified\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"verified\" ], bool )\n self.__verified = attributes[ \"verified\" ]","status":"modified","deletions":5,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/UserKey.py","changes":10,"additions":5,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/UserKey.py","filename":"src/github/UserKey.py"},{"patch":"@@ -3,7 +3,8 @@\n class Issue( Framework.TestCase ):\r\n def setUp( self ):\r\n Framework.TestCase.setUp( self )\r\n- self.issue = self.g.get_user().get_repo( \"PyGithub\" ).get_issue( 28 )\r\n+ self.repo = self.g.get_user().get_repo( \"PyGithub\" )\r\n+ self.issue = self.repo.get_issue( 28 )\r\n \r\n def testAttributes( self ):\r\n self.assertEqual( self.issue.assignee.login, \"jacquev6\" )\r\n@@ -47,3 +48,26 @@ def testGetComments( self ):\n \r\n def testGetEvents( self ):\r\n self.assertListKeyEqual( self.issue.get_events(), lambda e: e.id, [ 15819975, 15820048 ] )\r\n+\r\n+ def testGetLabels( self ):\r\n+ self.assertListKeyEqual( self.issue.get_labels(), lambda l: l.name, [ \"Bug\", \"Project management\", \"Question\" ] )\r\n+\r\n+ def testAddAndRemoveLabels( self ):\r\n+ bug = self.repo.get_label( \"Bug\" )\r\n+ question = self.repo.get_label( \"Question\" )\r\n+ self.assertListKeyEqual( self.issue.get_labels(), lambda l: l.name, [ \"Bug\", \"Project management\", \"Question\" ] )\r\n+ self.issue.remove_from_labels( bug )\r\n+ self.assertListKeyEqual( self.issue.get_labels(), lambda l: l.name, [ \"Project management\", \"Question\" ] )\r\n+ self.issue.remove_from_labels( question )\r\n+ self.assertListKeyEqual( self.issue.get_labels(), lambda l: l.name, [ \"Project management\" ] )\r\n+ self.issue.add_to_labels( bug, question )\r\n+ self.assertListKeyEqual( self.issue.get_labels(), lambda l: l.name, [ \"Bug\", \"Project management\", \"Question\" ] )\r\n+\r\n+ def testDeleteAndSetLabels( self ):\r\n+ bug = self.repo.get_label( \"Bug\" )\r\n+ question = self.repo.get_label( \"Question\" )\r\n+ self.assertListKeyEqual( self.issue.get_labels(), lambda l: l.name, [ \"Bug\", \"Project management\", \"Question\" ] )\r\n+ self.issue.delete_labels()\r\n+ self.assertListKeyEqual( self.issue.get_labels(), lambda l: l.name, [] )\r\n+ self.issue.set_labels( bug, question )\r\n+ self.assertListKeyEqual( self.issue.get_labels(), lambda l: l.name, [ \"Bug\", \"Question\" ] )\r","status":"modified","deletions":1,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/test/Issue.py","changes":26,"additions":25,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/test/Issue.py","filename":"test/Issue.py"},{"patch":"@@ -3,13 +3,13 @@\n class IssueEvent( Framework.TestCase ):\r\n def setUp( self ):\r\n Framework.TestCase.setUp( self )\r\n- self.event = self.g.get_user().get_repo( \"PyGithub\" ).get_issues_event( 15819975 )\r\n+ self.event = self.g.get_user().get_repo( \"PyGithub\" ).get_issues_event( 16348656 )\r\n \r\n def testAttributes( self ):\r\n self.assertEqual( self.event.actor.login, \"jacquev6\" )\r\n- self.assertEqual( self.event.commit_id, None )\r\n- self.assertEqual( self.event.created_at, \"2012-05-19T10:38:23Z\" )\r\n- self.assertEqual( self.event.event, \"subscribed\" )\r\n- self.assertEqual( self.event.id, 15819975 )\r\n- self.assertEqual( self.event.issue.number, 28 )\r\n- self.assertEqual( self.event.url, \"https://api.github.com/repos/jacquev6/PyGithub/issues/events/15819975\" )\r\n+ self.assertEqual( self.event.commit_id, \"ed866fc43833802ab553e5ff8581c81bb00dd433\" )\r\n+ self.assertEqual( self.event.created_at, \"2012-05-27T07:29:25Z\" )\r\n+ self.assertEqual( self.event.event, \"referenced\" )\r\n+ self.assertEqual( self.event.id, 16348656 )\r\n+ self.assertEqual( self.event.issue.number, 30 )\r\n+ self.assertEqual( self.event.url, \"https://api.github.com/repos/jacquev6/PyGithub/issues/events/16348656\" )\r","status":"modified","deletions":7,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/test/IssueEvent.py","changes":14,"additions":7,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/test/IssueEvent.py","filename":"test/IssueEvent.py"},{"patch":"@@ -0,0 +1,45 @@\n+GET /repos/jacquev6/PyGithub/labels/Bug {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4992'), ('content-length', '97'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"569c414d87e8ec43ec269a9e28bc2982\"'), ('date', 'Sun, 27 May 2012 09:04:01 GMT'), ('content-type', 'application/json; charset=utf-8')]\n+{\"color\":\"e10c02\",\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug\",\"name\":\"Bug\"}\n+\n+GET /repos/jacquev6/PyGithub/labels/Question {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4991'), ('content-length', '107'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"b659c8dcc1212c71f826547c3cc7ae99\"'), ('date', 'Sun, 27 May 2012 09:04:02 GMT'), ('content-type', 'application/json; charset=utf-8')]\n+{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\",\"color\":\"02e10c\"}\n+\n+GET /repos/jacquev6/PyGithub/issues/28/labels {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4990'), ('content-length', '335'), ('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')]\n+[{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug\",\"name\":\"Bug\",\"color\":\"e10c02\"},{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Project+management\",\"name\":\"Project management\",\"color\":\"444444\"},{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\",\"color\":\"02e10c\"}]\n+\n+DELETE /repos/jacquev6/PyGithub/issues/28/labels/Bug {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4989'), ('content-length', '237'), ('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')]\n+[{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Project+management\",\"name\":\"Project management\",\"color\":\"444444\"},{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\",\"color\":\"02e10c\"}]\n+\n+GET /repos/jacquev6/PyGithub/issues/28/labels {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4988'), ('content-length', '237'), ('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')]\n+[{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Project+management\",\"name\":\"Project management\",\"color\":\"444444\"},{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\",\"color\":\"02e10c\"}]\n+\n+DELETE /repos/jacquev6/PyGithub/issues/28/labels/Question {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4987'), ('content-length', '129'), ('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')]\n+[{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Project+management\",\"name\":\"Project management\",\"color\":\"444444\"}]\n+\n+GET /repos/jacquev6/PyGithub/issues/28/labels {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4986'), ('content-length', '129'), ('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')]\n+[{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Project+management\",\"name\":\"Project management\",\"color\":\"444444\"}]\n+\n+POST /repos/jacquev6/PyGithub/issues/28/labels {'Authorization': 'Basic login_and_password_removed'} [\"Bug\", \"Question\"]\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4985'), ('content-length', '335'), ('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')]\n+[{\"color\":\"e10c02\",\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug\",\"name\":\"Bug\"},{\"color\":\"444444\",\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Project+management\",\"name\":\"Project management\"},{\"color\":\"02e10c\",\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\"}]\n+\n+GET /repos/jacquev6/PyGithub/issues/28/labels {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4984'), ('content-length', '335'), ('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')]\n+[{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug\",\"name\":\"Bug\",\"color\":\"e10c02\"},{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Project+management\",\"name\":\"Project management\",\"color\":\"444444\"},{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\",\"color\":\"02e10c\"}]\n+","status":"added","deletions":0,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/test/ReplayData/Issue.testAddAndRemoveLabels.txt","changes":45,"additions":45,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/test/ReplayData/Issue.testAddAndRemoveLabels.txt","filename":"test/ReplayData/Issue.testAddAndRemoveLabels.txt"},{"patch":"@@ -0,0 +1,35 @@\n+GET /repos/jacquev6/PyGithub/labels/Bug {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4974'), ('content-length', '97'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"fe2e942523eecb156d100829a6347516\"'), ('date', 'Sun, 27 May 2012 09:06:37 GMT'), ('content-type', 'application/json; charset=utf-8')]\n+{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug\",\"name\":\"Bug\",\"color\":\"e10c02\"}\n+\n+GET /repos/jacquev6/PyGithub/labels/Question {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4973'), ('content-length', '107'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"931e58d337b2290717303141eda89cd7\"'), ('date', 'Sun, 27 May 2012 09:06:38 GMT'), ('content-type', 'application/json; charset=utf-8')]\n+{\"color\":\"02e10c\",\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\"}\n+\n+GET /repos/jacquev6/PyGithub/issues/28/labels {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4972'), ('content-length', '335'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"d135d74d2ea2159d044676a220d41d3a\"'), ('date', 'Sun, 27 May 2012 09:06:39 GMT'), ('content-type', 'application/json; charset=utf-8')]\n+[{\"color\":\"e10c02\",\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug\",\"name\":\"Bug\"},{\"color\":\"444444\",\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Project+management\",\"name\":\"Project management\"},{\"color\":\"02e10c\",\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\"}]\n+\n+DELETE /repos/jacquev6/PyGithub/issues/28/labels {'Authorization': 'Basic login_and_password_removed'} null\n+204\n+[('status', '204 No Content'), ('x-ratelimit-remaining', '4971'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"d41d8cd98f00b204e9800998ecf8427e\"'), ('date', 'Sun, 27 May 2012 09:06:39 GMT')]\n+\n+\n+GET /repos/jacquev6/PyGithub/issues/28/labels {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4970'), ('content-length', '2'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"d751713988987e9331980363e24189ce\"'), ('date', 'Sun, 27 May 2012 09:06:40 GMT'), ('content-type', 'application/json; charset=utf-8')]\n+[]\n+\n+PUT /repos/jacquev6/PyGithub/issues/28/labels {'Authorization': 'Basic login_and_password_removed'} [\"Bug\", \"Question\"]\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4969'), ('content-length', '207'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"1a56634d9c1050a88592ff55ed8adc62\"'), ('date', 'Sun, 27 May 2012 09:06:40 GMT'), ('content-type', 'application/json; charset=utf-8')]\n+[{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug\",\"name\":\"Bug\",\"color\":\"e10c02\"},{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\",\"color\":\"02e10c\"}]\n+\n+GET /repos/jacquev6/PyGithub/issues/28/labels {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4968'), ('content-length', '207'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"1a56634d9c1050a88592ff55ed8adc62\"'), ('date', 'Sun, 27 May 2012 09:06:41 GMT'), ('content-type', 'application/json; charset=utf-8')]\n+[{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug\",\"name\":\"Bug\",\"color\":\"e10c02\"},{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\",\"color\":\"02e10c\"}]\n+","status":"added","deletions":0,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/test/ReplayData/Issue.testDeleteAndSetLabels.txt","changes":35,"additions":35,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/test/ReplayData/Issue.testDeleteAndSetLabels.txt","filename":"test/ReplayData/Issue.testDeleteAndSetLabels.txt"},{"patch":"@@ -0,0 +1,5 @@\n+GET /repos/jacquev6/PyGithub/issues/28/labels {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4996'), ('content-length', '335'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"c9f9beccb03030beaf7b80927da6fef6\"'), ('date', 'Sun, 27 May 2012 08:56:31 GMT'), ('content-type', 'application/json; charset=utf-8')]\n+[{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug\",\"name\":\"Bug\",\"color\":\"e10c02\"},{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Project+management\",\"name\":\"Project management\",\"color\":\"444444\"},{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\",\"color\":\"02e10c\"}]\n+","status":"added","deletions":0,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/test/ReplayData/Issue.testGetLabels.txt","changes":5,"additions":5,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/test/ReplayData/Issue.testGetLabels.txt","filename":"test/ReplayData/Issue.testGetLabels.txt"},{"patch":"@@ -1,15 +1,15 @@\n GET /user {'Authorization': 'Basic login_and_password_removed'} null\n 200\n-[('status', '200 OK'), ('x-ratelimit-remaining', '4907'), ('content-length', '801'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"99c9bfb75395b749e9913a4729126fb5\"'), ('date', 'Sun, 27 May 2012 07:19:30 GMT'), ('content-type', 'application/json; charset=utf-8')]\n-{\"private_gists\":5,\"type\":\"User\",\"company\":\"Criteo\",\"location\":\"Paris, France\",\"hireable\":false,\"gravatar_id\":\"b68de5ae38616c296fa345d2b9df2225\",\"bio\":\"\",\"following\":24,\"blog\":\"http://vincent-jacques.net\",\"avatar_url\":\"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png\",\"total_private_repos\":5,\"followers\":13,\"owned_private_repos\":5,\"disk_usage\":16976,\"collaborators\":0,\"html_url\":\"https://github.com/jacquev6\",\"url\":\"https://api.github.com/users/jacquev6\",\"name\":\"Vincent Jacques\",\"login\":\"jacquev6\",\"public_repos\":11,\"public_gists\":3,\"email\":\"vincent@vincent-jacques.net\",\"id\":327146,\"plan\":{\"private_repos\":5,\"collaborators\":1,\"name\":\"micro\",\"space\":614400},\"created_at\":\"2010-07-09T06:10:06Z\"}\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4996'), ('content-length', '801'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"8974bb1628a3e3a6d3eb3b08c1b5a46b\"'), ('date', 'Sun, 27 May 2012 07:32:54 GMT'), ('content-type', 'application/json; charset=utf-8')]\n+{\"type\":\"User\",\"bio\":\"\",\"disk_usage\":16976,\"total_private_repos\":5,\"url\":\"https://api.github.com/users/jacquev6\",\"avatar_url\":\"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png\",\"owned_private_repos\":5,\"collaborators\":0,\"plan\":{\"collaborators\":1,\"private_repos\":5,\"name\":\"micro\",\"space\":614400},\"company\":\"Criteo\",\"gravatar_id\":\"b68de5ae38616c296fa345d2b9df2225\",\"login\":\"jacquev6\",\"email\":\"vincent@vincent-jacques.net\",\"public_gists\":3,\"followers\":13,\"name\":\"Vincent Jacques\",\"created_at\":\"2010-07-09T06:10:06Z\",\"blog\":\"http://vincent-jacques.net\",\"location\":\"Paris, France\",\"hireable\":false,\"id\":327146,\"private_gists\":5,\"public_repos\":11,\"following\":24,\"html_url\":\"https://github.com/jacquev6\"}\n \n GET /repos/jacquev6/PyGithub {'Authorization': 'Basic login_and_password_removed'} null\n 200\n-[('status', '200 OK'), ('x-ratelimit-remaining', '4906'), ('content-length', '1129'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"4c20acf0b23f75bbf25106b1a04f65a5\"'), ('date', 'Sun, 27 May 2012 07:19:31 GMT'), ('content-type', 'application/json; charset=utf-8')]\n-{\"description\":\"Python library implementing the full Github API v3\",\"full_name\":\"jacquev6/PyGithub\",\"has_wiki\":false,\"has_issues\":true,\"updated_at\":\"2012-05-27T06:55:28Z\",\"forks\":3,\"mirror_url\":null,\"homepage\":\"http://vincent-jacques.net/PyGithub\",\"ssh_url\":\"git@github.com:jacquev6/PyGithub.git\",\"open_issues\":16,\"fork\":false,\"svn_url\":\"https://github.com/jacquev6/PyGithub\",\"pushed_at\":\"2012-05-27T06:00:28Z\",\"size\":308,\"html_url\":\"https://github.com/jacquev6/PyGithub\",\"private\":false,\"url\":\"https://api.github.com/repos/jacquev6/PyGithub\",\"clone_url\":\"https://github.com/jacquev6/PyGithub.git\",\"owner\":{\"gravatar_id\":\"b68de5ae38616c296fa345d2b9df2225\",\"avatar_url\":\"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png\",\"url\":\"https://api.github.com/users/jacquev6\",\"login\":\"jacquev6\",\"id\":327146},\"name\":\"PyGithub\",\"has_downloads\":true,\"language\":\"Python\",\"watchers\":15,\"git_url\":\"git://github.com/jacquev6/PyGithub.git\",\"id\":3544490,\"permissions\":{\"admin\":true,\"pull\":true,\"push\":true},\"created_at\":\"2012-02-25T12:53:47Z\"}\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4995'), ('content-length', '1129'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"f1e4eb3993a364b66b68ec9db42405bd\"'), ('date', 'Sun, 27 May 2012 07:32:55 GMT'), ('content-type', 'application/json; charset=utf-8')]\n+{\"clone_url\":\"https://github.com/jacquev6/PyGithub.git\",\"has_downloads\":true,\"watchers\":15,\"updated_at\":\"2012-05-27T07:29:24Z\",\"permissions\":{\"pull\":true,\"admin\":true,\"push\":true},\"homepage\":\"http://vincent-jacques.net/PyGithub\",\"url\":\"https://api.github.com/repos/jacquev6/PyGithub\",\"mirror_url\":null,\"has_wiki\":false,\"has_issues\":true,\"fork\":false,\"forks\":3,\"git_url\":\"git://github.com/jacquev6/PyGithub.git\",\"size\":308,\"private\":false,\"open_issues\":16,\"svn_url\":\"https://github.com/jacquev6/PyGithub\",\"owner\":{\"url\":\"https://api.github.com/users/jacquev6\",\"avatar_url\":\"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png\",\"gravatar_id\":\"b68de5ae38616c296fa345d2b9df2225\",\"login\":\"jacquev6\",\"id\":327146},\"name\":\"PyGithub\",\"language\":\"Python\",\"description\":\"Python library implementing the full Github API v3\",\"ssh_url\":\"git@github.com:jacquev6/PyGithub.git\",\"pushed_at\":\"2012-05-27T07:29:24Z\",\"created_at\":\"2012-02-25T12:53:47Z\",\"id\":3544490,\"html_url\":\"https://github.com/jacquev6/PyGithub\",\"full_name\":\"jacquev6/PyGithub\"}\n \n-GET /repos/jacquev6/PyGithub/issues/events/15819975 {'Authorization': 'Basic login_and_password_removed'} null\n+GET /repos/jacquev6/PyGithub/issues/events/16348656 {'Authorization': 'Basic login_and_password_removed'} null\n 200\n-[('status', '200 OK'), ('x-ratelimit-remaining', '4905'), ('content-length', '2430'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"a3d244842d23f92f69a23e21626fad11\"'), ('date', 'Sun, 27 May 2012 07:19:31 GMT'), ('content-type', 'application/json; charset=utf-8')]\n-{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/issues/events/15819975\",\"issue\":{\"updated_at\":\"2012-05-26T14:59:33Z\",\"body\":\"Body edited by PyGithub\",\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/issues/28\",\"comments\":0,\"milestone\":{\"creator\":{\"url\":\"https://api.github.com/users/jacquev6\",\"avatar_url\":\"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png\",\"gravatar_id\":\"b68de5ae38616c296fa345d2b9df2225\",\"login\":\"jacquev6\",\"id\":327146},\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/milestones/1\",\"number\":1,\"title\":\"Version 0.4\",\"due_on\":\"2012-03-13T07:00:00Z\",\"closed_issues\":3,\"open_issues\":0,\"created_at\":\"2012-03-08T12:22:10Z\",\"state\":\"closed\",\"description\":\"\",\"id\":93546},\"number\":28,\"assignee\":{\"url\":\"https://api.github.com/users/jacquev6\",\"avatar_url\":\"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png\",\"gravatar_id\":\"b68de5ae38616c296fa345d2b9df2225\",\"login\":\"jacquev6\",\"id\":327146},\"closed_at\":\"2012-05-26T14:59:33Z\",\"title\":\"Issue created by PyGithub\",\"labels\":[{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug\",\"name\":\"Bug\",\"color\":\"e10c02\"},{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Project+management\",\"name\":\"Project management\",\"color\":\"444444\"},{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\",\"color\":\"02e10c\"}],\"created_at\":\"2012-05-19T10:38:23Z\",\"state\":\"closed\",\"user\":{\"url\":\"https://api.github.com/users/jacquev6\",\"avatar_url\":\"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png\",\"gravatar_id\":\"b68de5ae38616c296fa345d2b9df2225\",\"login\":\"jacquev6\",\"id\":327146},\"id\":4653757,\"pull_request\":{\"diff_url\":null,\"patch_url\":null,\"html_url\":null},\"html_url\":\"https://github.com/jacquev6/PyGithub/issues/28\"},\"commit_id\":null,\"created_at\":\"2012-05-19T10:38:23Z\",\"event\":\"subscribed\",\"id\":15819975,\"actor\":{\"url\":\"https://api.github.com/users/jacquev6\",\"avatar_url\":\"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png\",\"gravatar_id\":\"b68de5ae38616c296fa345d2b9df2225\",\"login\":\"jacquev6\",\"id\":327146}}\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4994'), ('content-length', '1384'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"fefecab09e7355d4ef9875677c2631da\"'), ('date', 'Sun, 27 May 2012 07:32:56 GMT'), ('content-type', 'application/json; charset=utf-8')]\n+{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/issues/events/16348656\",\"issue\":{\"updated_at\":\"2012-05-27T07:27:51Z\",\"body\":\"Body created by PyGithub\",\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/issues/30\",\"comments\":0,\"milestone\":null,\"number\":30,\"assignee\":null,\"closed_at\":null,\"title\":\"Issue also created by PyGithub\",\"labels\":[{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\",\"color\":\"02e10c\"}],\"created_at\":\"2012-05-27T05:40:15Z\",\"state\":\"open\",\"user\":{\"url\":\"https://api.github.com/users/jacquev6\",\"gravatar_id\":\"b68de5ae38616c296fa345d2b9df2225\",\"login\":\"jacquev6\",\"id\":327146,\"avatar_url\":\"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png\"},\"id\":4769659,\"pull_request\":{\"patch_url\":null,\"diff_url\":null,\"html_url\":null},\"html_url\":\"https://github.com/jacquev6/PyGithub/issues/30\"},\"commit_id\":\"ed866fc43833802ab553e5ff8581c81bb00dd433\",\"created_at\":\"2012-05-27T07:29:25Z\",\"event\":\"referenced\",\"id\":16348656,\"actor\":{\"url\":\"https://api.github.com/users/jacquev6\",\"gravatar_id\":\"b68de5ae38616c296fa345d2b9df2225\",\"login\":\"jacquev6\",\"id\":327146,\"avatar_url\":\"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png\"}}\n ","status":"modified","deletions":7,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/test/ReplayData/IssueEvent.setUp.txt","changes":14,"additions":7,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/test/ReplayData/IssueEvent.setUp.txt","filename":"test/ReplayData/IssueEvent.setUp.txt"}] +[{"patch":"@@ -70,7 +70,7 @@ def __useAttributes( self, attributes ):\n \n # @toto No need to check if attribute is in attributes when attribute is mandatory\n {% for attribute in class.attributes|dictsort:\"name\" %}\n- if \"{{ attribute.name }}\" in attributes and attributes[ \"{{ attribute.name }}\" ] is not None:\n+ if \"{{ attribute.name }}\" in attributes and attributes[ \"{{ attribute.name }}\" ] is not None: # pragma no branch\n \n {% if attribute.type.cardinality == \"scalar\" %}\n {% if attribute.type.simple %}","status":"modified","deletions":1,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/codegen/templates/GithubObject.py","changes":2,"additions":1,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/codegen/templates/GithubObject.py","filename":"codegen/templates/GithubObject.py"},{"patch":"@@ -568,78 +568,78 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"avatar_url\", \"bio\", \"blog\", \"collaborators\", \"company\", \"created_at\", \"disk_usage\", \"email\", \"followers\", \"following\", \"gravatar_id\", \"hireable\", \"html_url\", \"id\", \"location\", \"login\", \"name\", \"owned_private_repos\", \"plan\", \"private_gists\", \"public_gists\", \"public_repos\", \"total_private_repos\", \"type\", \"url\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"avatar_url\" in attributes and attributes[ \"avatar_url\" ] is not None:\n+ if \"avatar_url\" in attributes and attributes[ \"avatar_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"avatar_url\" ], ( str, unicode ) )\n self.__avatar_url = attributes[ \"avatar_url\" ]\n- if \"bio\" in attributes and attributes[ \"bio\" ] is not None:\n+ if \"bio\" in attributes and attributes[ \"bio\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"bio\" ], ( str, unicode ) )\n self.__bio = attributes[ \"bio\" ]\n- if \"blog\" in attributes and attributes[ \"blog\" ] is not None:\n+ if \"blog\" in attributes and attributes[ \"blog\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"blog\" ], ( str, unicode ) )\n self.__blog = attributes[ \"blog\" ]\n- if \"collaborators\" in attributes and attributes[ \"collaborators\" ] is not None:\n+ if \"collaborators\" in attributes and attributes[ \"collaborators\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"collaborators\" ], int )\n self.__collaborators = attributes[ \"collaborators\" ]\n- if \"company\" in attributes and attributes[ \"company\" ] is not None:\n+ if \"company\" in attributes and attributes[ \"company\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"company\" ], ( str, unicode ) )\n self.__company = attributes[ \"company\" ]\n- if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None:\n+ if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"created_at\" ], ( str, unicode ) )\n self.__created_at = attributes[ \"created_at\" ]\n- if \"disk_usage\" in attributes and attributes[ \"disk_usage\" ] is not None:\n+ if \"disk_usage\" in attributes and attributes[ \"disk_usage\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"disk_usage\" ], int )\n self.__disk_usage = attributes[ \"disk_usage\" ]\n- if \"email\" in attributes and attributes[ \"email\" ] is not None:\n+ if \"email\" in attributes and attributes[ \"email\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"email\" ], ( str, unicode ) )\n self.__email = attributes[ \"email\" ]\n- if \"followers\" in attributes and attributes[ \"followers\" ] is not None:\n+ if \"followers\" in attributes and attributes[ \"followers\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"followers\" ], int )\n self.__followers = attributes[ \"followers\" ]\n- if \"following\" in attributes and attributes[ \"following\" ] is not None:\n+ if \"following\" in attributes and attributes[ \"following\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"following\" ], int )\n self.__following = attributes[ \"following\" ]\n- if \"gravatar_id\" in attributes and attributes[ \"gravatar_id\" ] is not None:\n+ if \"gravatar_id\" in attributes and attributes[ \"gravatar_id\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"gravatar_id\" ], ( str, unicode ) )\n self.__gravatar_id = attributes[ \"gravatar_id\" ]\n- if \"hireable\" in attributes and attributes[ \"hireable\" ] is not None:\n+ if \"hireable\" in attributes and attributes[ \"hireable\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"hireable\" ], bool )\n self.__hireable = attributes[ \"hireable\" ]\n- if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None:\n+ if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"html_url\" ], ( str, unicode ) )\n self.__html_url = attributes[ \"html_url\" ]\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"id\" ], int )\n self.__id = attributes[ \"id\" ]\n- if \"location\" in attributes and attributes[ \"location\" ] is not None:\n+ if \"location\" in attributes and attributes[ \"location\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"location\" ], ( str, unicode ) )\n self.__location = attributes[ \"location\" ]\n- if \"login\" in attributes and attributes[ \"login\" ] is not None:\n+ if \"login\" in attributes and attributes[ \"login\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"login\" ], ( str, unicode ) )\n self.__login = attributes[ \"login\" ]\n- if \"name\" in attributes and attributes[ \"name\" ] is not None:\n+ if \"name\" in attributes and attributes[ \"name\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"name\" ], ( str, unicode ) )\n self.__name = attributes[ \"name\" ]\n- if \"owned_private_repos\" in attributes and attributes[ \"owned_private_repos\" ] is not None:\n+ if \"owned_private_repos\" in attributes and attributes[ \"owned_private_repos\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"owned_private_repos\" ], int )\n self.__owned_private_repos = attributes[ \"owned_private_repos\" ]\n- if \"plan\" in attributes and attributes[ \"plan\" ] is not None:\n+ if \"plan\" in attributes and attributes[ \"plan\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"plan\" ], dict )\n self.__plan = Plan.Plan( self.__requester, attributes[ \"plan\" ], completion = LazyCompletion )\n- if \"private_gists\" in attributes and attributes[ \"private_gists\" ] is not None:\n+ if \"private_gists\" in attributes and attributes[ \"private_gists\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"private_gists\" ], int )\n self.__private_gists = attributes[ \"private_gists\" ]\n- if \"public_gists\" in attributes and attributes[ \"public_gists\" ] is not None:\n+ if \"public_gists\" in attributes and attributes[ \"public_gists\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"public_gists\" ], int )\n self.__public_gists = attributes[ \"public_gists\" ]\n- if \"public_repos\" in attributes and attributes[ \"public_repos\" ] is not None:\n+ if \"public_repos\" in attributes and attributes[ \"public_repos\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"public_repos\" ], int )\n self.__public_repos = attributes[ \"public_repos\" ]\n- if \"total_private_repos\" in attributes and attributes[ \"total_private_repos\" ] is not None:\n+ if \"total_private_repos\" in attributes and attributes[ \"total_private_repos\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"total_private_repos\" ], int )\n self.__total_private_repos = attributes[ \"total_private_repos\" ]\n- if \"type\" in attributes and attributes[ \"type\" ] is not None:\n+ if \"type\" in attributes and attributes[ \"type\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"type\" ], ( str, unicode ) )\n self.__type = attributes[ \"type\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"url\" ], ( str, unicode ) )\n self.__url = attributes[ \"url\" ]","status":"modified","deletions":25,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/AuthenticatedUser.py","changes":50,"additions":25,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/AuthenticatedUser.py","filename":"src/github/AuthenticatedUser.py"},{"patch":"@@ -117,21 +117,21 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"app\", \"created_at\", \"id\", \"note\", \"note_url\", \"scopes\", \"token\", \"updated_at\", \"url\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"app\" in attributes and attributes[ \"app\" ] is not None:\n+ if \"app\" in attributes and attributes[ \"app\" ] is not None: # pragma no branch\n self.__app = attributes[ \"app\" ]\n- if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None:\n+ if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None: # pragma no branch\n self.__created_at = attributes[ \"created_at\" ]\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n self.__id = attributes[ \"id\" ]\n- if \"note\" in attributes and attributes[ \"note\" ] is not None:\n+ if \"note\" in attributes and attributes[ \"note\" ] is not None: # pragma no branch\n self.__note = attributes[ \"note\" ]\n- if \"note_url\" in attributes and attributes[ \"note_url\" ] is not None:\n+ if \"note_url\" in attributes and attributes[ \"note_url\" ] is not None: # pragma no branch\n self.__note_url = attributes[ \"note_url\" ]\n- if \"scopes\" in attributes and attributes[ \"scopes\" ] is not None:\n+ if \"scopes\" in attributes and attributes[ \"scopes\" ] is not None: # pragma no branch\n self.__scopes = attributes[ \"scopes\" ]\n- if \"token\" in attributes and attributes[ \"token\" ] is not None:\n+ if \"token\" in attributes and attributes[ \"token\" ] is not None: # pragma no branch\n self.__token = attributes[ \"token\" ]\n- if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None:\n+ if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None: # pragma no branch\n self.__updated_at = attributes[ \"updated_at\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n self.__url = attributes[ \"url\" ]","status":"modified","deletions":9,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Authorization.py","changes":18,"additions":9,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Authorization.py","filename":"src/github/Authorization.py"},{"patch":"@@ -28,9 +28,9 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"commit\", \"name\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"commit\" in attributes and attributes[ \"commit\" ] is not None:\n+ if \"commit\" in attributes and attributes[ \"commit\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"commit\" ], dict )\n self.__commit = Commit.Commit( self.__requester, attributes[ \"commit\" ], completion = LazyCompletion )\n- if \"name\" in attributes and attributes[ \"name\" ] is not None:\n+ if \"name\" in attributes and attributes[ \"name\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"name\" ], ( str, unicode ) )\n self.__name = attributes[ \"name\" ]","status":"modified","deletions":2,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Branch.py","changes":4,"additions":2,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Branch.py","filename":"src/github/Branch.py"},{"patch":"@@ -120,33 +120,33 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"author\", \"commit\", \"committer\", \"files\", \"parents\", \"sha\", \"stats\", \"url\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"author\" in attributes and attributes[ \"author\" ] is not None:\n+ if \"author\" in attributes and attributes[ \"author\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"author\" ], dict )\n self.__author = NamedUser.NamedUser( self.__requester, attributes[ \"author\" ], completion = LazyCompletion )\n- if \"commit\" in attributes and attributes[ \"commit\" ] is not None:\n+ if \"commit\" in attributes and attributes[ \"commit\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"commit\" ], dict )\n self.__commit = GitCommit.GitCommit( self.__requester, attributes[ \"commit\" ], completion = LazyCompletion )\n- if \"committer\" in attributes and attributes[ \"committer\" ] is not None:\n+ if \"committer\" in attributes and attributes[ \"committer\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"committer\" ], dict )\n self.__committer = NamedUser.NamedUser( self.__requester, attributes[ \"committer\" ], completion = LazyCompletion )\n- if \"files\" in attributes and attributes[ \"files\" ] is not None:\n+ if \"files\" in attributes and attributes[ \"files\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"files\" ], list ) and ( len( attributes[ \"files\" ] ) == 0 or isinstance( attributes[ \"files\" ][ 0 ], dict ) )\n self.__files = [\n CommitFile.CommitFile( self.__requester, element, completion = LazyCompletion )\n for element in attributes[ \"files\" ]\n ]\n- if \"parents\" in attributes and attributes[ \"parents\" ] is not None:\n+ if \"parents\" in attributes and attributes[ \"parents\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"parents\" ], list ) and ( len( attributes[ \"parents\" ] ) == 0 or isinstance( attributes[ \"parents\" ][ 0 ], dict ) )\n self.__parents = [\n Commit( self.__requester, element, completion = LazyCompletion )\n for element in attributes[ \"parents\" ]\n ]\n- if \"sha\" in attributes and attributes[ \"sha\" ] is not None:\n+ if \"sha\" in attributes and attributes[ \"sha\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"sha\" ], ( str, unicode ) )\n self.__sha = attributes[ \"sha\" ]\n- if \"stats\" in attributes and attributes[ \"stats\" ] is not None:\n+ if \"stats\" in attributes and attributes[ \"stats\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"stats\" ], dict )\n self.__stats = CommitStats.CommitStats( self.__requester, attributes[ \"stats\" ], completion = LazyCompletion )\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"url\" ], ( str, unicode ) )\n self.__url = attributes[ \"url\" ]","status":"modified","deletions":8,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Commit.py","changes":16,"additions":8,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Commit.py","filename":"src/github/Commit.py"},{"patch":"@@ -121,36 +121,36 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"body\", \"commit_id\", \"created_at\", \"html_url\", \"id\", \"line\", \"path\", \"position\", \"updated_at\", \"url\", \"user\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"body\" in attributes and attributes[ \"body\" ] is not None:\n+ if \"body\" in attributes and attributes[ \"body\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"body\" ], ( str, unicode ) )\n self.__body = attributes[ \"body\" ]\n- if \"commit_id\" in attributes and attributes[ \"commit_id\" ] is not None:\n+ if \"commit_id\" in attributes and attributes[ \"commit_id\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"commit_id\" ], ( str, unicode ) )\n self.__commit_id = attributes[ \"commit_id\" ]\n- if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None:\n+ if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"created_at\" ], ( str, unicode ) )\n self.__created_at = attributes[ \"created_at\" ]\n- if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None:\n+ if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"html_url\" ], ( str, unicode ) )\n self.__html_url = attributes[ \"html_url\" ]\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"id\" ], int )\n self.__id = attributes[ \"id\" ]\n- if \"line\" in attributes and attributes[ \"line\" ] is not None:\n+ if \"line\" in attributes and attributes[ \"line\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"line\" ], int )\n self.__line = attributes[ \"line\" ]\n- if \"path\" in attributes and attributes[ \"path\" ] is not None:\n+ if \"path\" in attributes and attributes[ \"path\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"path\" ], ( str, unicode ) )\n self.__path = attributes[ \"path\" ]\n- if \"position\" in attributes and attributes[ \"position\" ] is not None:\n+ if \"position\" in attributes and attributes[ \"position\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"position\" ], int )\n self.__position = attributes[ \"position\" ]\n- if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None:\n+ if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"updated_at\" ], ( str, unicode ) )\n self.__updated_at = attributes[ \"updated_at\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"url\" ], ( str, unicode ) )\n self.__url = attributes[ \"url\" ]\n- if \"user\" in attributes and attributes[ \"user\" ] is not None:\n+ if \"user\" in attributes and attributes[ \"user\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"user\" ], dict )\n self.__user = NamedUser.NamedUser( self.__requester, attributes[ \"user\" ], completion = LazyCompletion )","status":"modified","deletions":11,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/CommitComment.py","changes":22,"additions":11,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/CommitComment.py","filename":"src/github/CommitComment.py"},{"patch":"@@ -62,21 +62,21 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"additions\", \"blob_url\", \"changes\", \"deletions\", \"filename\", \"patch\", \"raw_url\", \"sha\", \"status\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"additions\" in attributes and attributes[ \"additions\" ] is not None:\n+ if \"additions\" in attributes and attributes[ \"additions\" ] is not None: # pragma no branch\n self.__additions = attributes[ \"additions\" ]\n- if \"blob_url\" in attributes and attributes[ \"blob_url\" ] is not None:\n+ if \"blob_url\" in attributes and attributes[ \"blob_url\" ] is not None: # pragma no branch\n self.__blob_url = attributes[ \"blob_url\" ]\n- if \"changes\" in attributes and attributes[ \"changes\" ] is not None:\n+ if \"changes\" in attributes and attributes[ \"changes\" ] is not None: # pragma no branch\n self.__changes = attributes[ \"changes\" ]\n- if \"deletions\" in attributes and attributes[ \"deletions\" ] is not None:\n+ if \"deletions\" in attributes and attributes[ \"deletions\" ] is not None: # pragma no branch\n self.__deletions = attributes[ \"deletions\" ]\n- if \"filename\" in attributes and attributes[ \"filename\" ] is not None:\n+ if \"filename\" in attributes and attributes[ \"filename\" ] is not None: # pragma no branch\n self.__filename = attributes[ \"filename\" ]\n- if \"patch\" in attributes and attributes[ \"patch\" ] is not None:\n+ if \"patch\" in attributes and attributes[ \"patch\" ] is not None: # pragma no branch\n self.__patch = attributes[ \"patch\" ]\n- if \"raw_url\" in attributes and attributes[ \"raw_url\" ] is not None:\n+ if \"raw_url\" in attributes and attributes[ \"raw_url\" ] is not None: # pragma no branch\n self.__raw_url = attributes[ \"raw_url\" ]\n- if \"sha\" in attributes and attributes[ \"sha\" ] is not None:\n+ if \"sha\" in attributes and attributes[ \"sha\" ] is not None: # pragma no branch\n self.__sha = attributes[ \"sha\" ]\n- if \"status\" in attributes and attributes[ \"status\" ] is not None:\n+ if \"status\" in attributes and attributes[ \"status\" ] is not None: # pragma no branch\n self.__status = attributes[ \"status\" ]","status":"modified","deletions":9,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/CommitFile.py","changes":18,"additions":9,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/CommitFile.py","filename":"src/github/CommitFile.py"},{"patch":"@@ -32,12 +32,12 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"additions\", \"deletions\", \"total\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"additions\" in attributes and attributes[ \"additions\" ] is not None:\n+ if \"additions\" in attributes and attributes[ \"additions\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"additions\" ], int )\n self.__additions = attributes[ \"additions\" ]\n- if \"deletions\" in attributes and attributes[ \"deletions\" ] is not None:\n+ if \"deletions\" in attributes and attributes[ \"deletions\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"deletions\" ], int )\n self.__deletions = attributes[ \"deletions\" ]\n- if \"total\" in attributes and attributes[ \"total\" ] is not None:\n+ if \"total\" in attributes and attributes[ \"total\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"total\" ], int )\n self.__total = attributes[ \"total\" ]","status":"modified","deletions":3,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/CommitStats.py","changes":6,"additions":3,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/CommitStats.py","filename":"src/github/CommitStats.py"},{"patch":"@@ -162,43 +162,43 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"accesskeyid\", \"acl\", \"bucket\", \"content_type\", \"created_at\", \"description\", \"download_count\", \"expirationdate\", \"html_url\", \"id\", \"mime_type\", \"name\", \"path\", \"policy\", \"prefix\", \"redirect\", \"s3_url\", \"signature\", \"size\", \"url\", \"x-amz-meta-content-disposition\" ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"accesskeyid\" in attributes and attributes[ \"accesskeyid\" ] is not None:\n+ if \"accesskeyid\" in attributes and attributes[ \"accesskeyid\" ] is not None: # pragma no branch\n self.__accesskeyid = attributes[ \"accesskeyid\" ]\n- if \"acl\" in attributes and attributes[ \"acl\" ] is not None:\n+ if \"acl\" in attributes and attributes[ \"acl\" ] is not None: # pragma no branch\n self.__acl = attributes[ \"acl\" ]\n- if \"bucket\" in attributes and attributes[ \"bucket\" ] is not None:\n+ if \"bucket\" in attributes and attributes[ \"bucket\" ] is not None: # pragma no branch\n self.__bucket = attributes[ \"bucket\" ]\n- if \"content_type\" in attributes and attributes[ \"content_type\" ] is not None:\n+ if \"content_type\" in attributes and attributes[ \"content_type\" ] is not None: # pragma no branch\n self.__content_type = attributes[ \"content_type\" ]\n- if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None:\n+ if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None: # pragma no branch\n self.__created_at = attributes[ \"created_at\" ]\n- if \"description\" in attributes and attributes[ \"description\" ] is not None:\n+ if \"description\" in attributes and attributes[ \"description\" ] is not None: # pragma no branch\n self.__description = attributes[ \"description\" ]\n- if \"download_count\" in attributes and attributes[ \"download_count\" ] is not None:\n+ if \"download_count\" in attributes and attributes[ \"download_count\" ] is not None: # pragma no branch\n self.__download_count = attributes[ \"download_count\" ]\n- if \"expirationdate\" in attributes and attributes[ \"expirationdate\" ] is not None:\n+ if \"expirationdate\" in attributes and attributes[ \"expirationdate\" ] is not None: # pragma no branch\n self.__expirationdate = attributes[ \"expirationdate\" ]\n- if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None:\n+ if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None: # pragma no branch\n self.__html_url = attributes[ \"html_url\" ]\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n self.__id = attributes[ \"id\" ]\n- if \"mime_type\" in attributes and attributes[ \"mime_type\" ] is not None:\n+ if \"mime_type\" in attributes and attributes[ \"mime_type\" ] is not None: # pragma no branch\n self.__mime_type = attributes[ \"mime_type\" ]\n- if \"name\" in attributes and attributes[ \"name\" ] is not None:\n+ if \"name\" in attributes and attributes[ \"name\" ] is not None: # pragma no branch\n self.__name = attributes[ \"name\" ]\n- if \"path\" in attributes and attributes[ \"path\" ] is not None:\n+ if \"path\" in attributes and attributes[ \"path\" ] is not None: # pragma no branch\n self.__path = attributes[ \"path\" ]\n- if \"policy\" in attributes and attributes[ \"policy\" ] is not None:\n+ if \"policy\" in attributes and attributes[ \"policy\" ] is not None: # pragma no branch\n self.__policy = attributes[ \"policy\" ]\n- if \"prefix\" in attributes and attributes[ \"prefix\" ] is not None:\n+ if \"prefix\" in attributes and attributes[ \"prefix\" ] is not None: # pragma no branch\n self.__prefix = attributes[ \"prefix\" ]\n- if \"redirect\" in attributes and attributes[ \"redirect\" ] is not None:\n+ if \"redirect\" in attributes and attributes[ \"redirect\" ] is not None: # pragma no branch\n self.__redirect = attributes[ \"redirect\" ]\n- if \"s3_url\" in attributes and attributes[ \"s3_url\" ] is not None:\n+ if \"s3_url\" in attributes and attributes[ \"s3_url\" ] is not None: # pragma no branch\n self.__s3_url = attributes[ \"s3_url\" ]\n- if \"signature\" in attributes and attributes[ \"signature\" ] is not None:\n+ if \"signature\" in attributes and attributes[ \"signature\" ] is not None: # pragma no branch\n self.__signature = attributes[ \"signature\" ]\n- if \"size\" in attributes and attributes[ \"size\" ] is not None:\n+ if \"size\" in attributes and attributes[ \"size\" ] is not None: # pragma no branch\n self.__size = attributes[ \"size\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n self.__url = attributes[ \"url\" ]","status":"modified","deletions":20,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Download.py","changes":40,"additions":20,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Download.py","filename":"src/github/Download.py"},{"patch":"@@ -60,22 +60,22 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"actor\", \"created_at\", \"id\", \"org\", \"payload\", \"public\", \"repo\", \"type\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"actor\" in attributes and attributes[ \"actor\" ] is not None:\n+ if \"actor\" in attributes and attributes[ \"actor\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"actor\" ], dict )\n self.__actor = NamedUser.NamedUser( self.__requester, attributes[ \"actor\" ], completion = LazyCompletion )\n- if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None:\n+ if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None: # pragma no branch\n self.__created_at = attributes[ \"created_at\" ]\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n self.__id = attributes[ \"id\" ]\n- if \"org\" in attributes and attributes[ \"org\" ] is not None:\n+ if \"org\" in attributes and attributes[ \"org\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"org\" ], dict )\n self.__org = Organization.Organization( self.__requester, attributes[ \"org\" ], completion = LazyCompletion )\n- if \"payload\" in attributes and attributes[ \"payload\" ] is not None:\n+ if \"payload\" in attributes and attributes[ \"payload\" ] is not None: # pragma no branch\n self.__payload = attributes[ \"payload\" ]\n- if \"public\" in attributes and attributes[ \"public\" ] is not None:\n+ if \"public\" in attributes and attributes[ \"public\" ] is not None: # pragma no branch\n self.__public = attributes[ \"public\" ]\n- if \"repo\" in attributes and attributes[ \"repo\" ] is not None:\n+ if \"repo\" in attributes and attributes[ \"repo\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"repo\" ], dict )\n self.__repo = Repository.Repository( self.__requester, attributes[ \"repo\" ], completion = LazyCompletion )\n- if \"type\" in attributes and attributes[ \"type\" ] is not None:\n+ if \"type\" in attributes and attributes[ \"type\" ] is not None: # pragma no branch\n self.__type = attributes[ \"type\" ]","status":"modified","deletions":8,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Event.py","changes":16,"additions":8,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Event.py","filename":"src/github/Event.py"},{"patch":"@@ -220,53 +220,53 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"comments\", \"created_at\", \"description\", \"files\", \"fork_of\", \"forks\", \"git_pull_url\", \"git_push_url\", \"history\", \"html_url\", \"id\", \"public\", \"updated_at\", \"url\", \"user\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"comments\" in attributes and attributes[ \"comments\" ] is not None:\n+ if \"comments\" in attributes and attributes[ \"comments\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"comments\" ], int )\n self.__comments = attributes[ \"comments\" ]\n- if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None:\n+ if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"created_at\" ], ( str, unicode ) )\n self.__created_at = attributes[ \"created_at\" ]\n- if \"description\" in attributes and attributes[ \"description\" ] is not None:\n+ if \"description\" in attributes and attributes[ \"description\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"description\" ], ( str, unicode ) )\n self.__description = attributes[ \"description\" ]\n- if \"files\" in attributes and attributes[ \"files\" ] is not None:\n+ if \"files\" in attributes and attributes[ \"files\" ] is not None: # pragma no branch\n self.__files = attributes[ \"files\" ]\n- if \"fork_of\" in attributes and attributes[ \"fork_of\" ] is not None:\n+ if \"fork_of\" in attributes and attributes[ \"fork_of\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"fork_of\" ], dict )\n self.__fork_of = Gist( self.__requester, attributes[ \"fork_of\" ], completion = LazyCompletion )\n- if \"forks\" in attributes and attributes[ \"forks\" ] is not None:\n+ if \"forks\" in attributes and attributes[ \"forks\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"forks\" ], list ) and ( len( attributes[ \"forks\" ] ) == 0 or isinstance( attributes[ \"forks\" ][ 0 ], dict ) )\n self.__forks = [\n Gist( self.__requester, element, completion = LazyCompletion )\n for element in attributes[ \"forks\" ]\n ]\n- if \"git_pull_url\" in attributes and attributes[ \"git_pull_url\" ] is not None:\n+ if \"git_pull_url\" in attributes and attributes[ \"git_pull_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"git_pull_url\" ], ( str, unicode ) )\n self.__git_pull_url = attributes[ \"git_pull_url\" ]\n- if \"git_push_url\" in attributes and attributes[ \"git_push_url\" ] is not None:\n+ if \"git_push_url\" in attributes and attributes[ \"git_push_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"git_push_url\" ], ( str, unicode ) )\n self.__git_push_url = attributes[ \"git_push_url\" ]\n- if \"history\" in attributes and attributes[ \"history\" ] is not None:\n+ if \"history\" in attributes and attributes[ \"history\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"history\" ], list ) and ( len( attributes[ \"history\" ] ) == 0 or isinstance( attributes[ \"history\" ][ 0 ], dict ) )\n self.__history = [\n GistHistoryState.GistHistoryState( self.__requester, element, completion = LazyCompletion )\n for element in attributes[ \"history\" ]\n ]\n- if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None:\n+ if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"html_url\" ], ( str, unicode ) )\n self.__html_url = attributes[ \"html_url\" ]\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"id\" ], ( str, unicode ) )\n self.__id = attributes[ \"id\" ]\n- if \"public\" in attributes and attributes[ \"public\" ] is not None:\n+ if \"public\" in attributes and attributes[ \"public\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"public\" ], bool )\n self.__public = attributes[ \"public\" ]\n- if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None:\n+ if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"updated_at\" ], ( str, unicode ) )\n self.__updated_at = attributes[ \"updated_at\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"url\" ], ( str, unicode ) )\n self.__url = attributes[ \"url\" ]\n- if \"user\" in attributes and attributes[ \"user\" ] is not None:\n+ if \"user\" in attributes and attributes[ \"user\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"user\" ], dict )\n self.__user = NamedUser.NamedUser( self.__requester, attributes[ \"user\" ], completion = LazyCompletion )","status":"modified","deletions":15,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Gist.py","changes":30,"additions":15,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Gist.py","filename":"src/github/Gist.py"},{"patch":"@@ -68,16 +68,16 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"body\", \"created_at\", \"id\", \"updated_at\", \"url\", \"user\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"body\" in attributes and attributes[ \"body\" ] is not None:\n+ if \"body\" in attributes and attributes[ \"body\" ] is not None: # pragma no branch\n self.__body = attributes[ \"body\" ]\n- if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None:\n+ if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None: # pragma no branch\n self.__created_at = attributes[ \"created_at\" ]\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n self.__id = attributes[ \"id\" ]\n- if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None:\n+ if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None: # pragma no branch\n self.__updated_at = attributes[ \"updated_at\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n self.__url = attributes[ \"url\" ]\n- if \"user\" in attributes and attributes[ \"user\" ] is not None:\n+ if \"user\" in attributes and attributes[ \"user\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"user\" ], dict )\n self.__user = NamedUser.NamedUser( self.__requester, attributes[ \"user\" ], completion = LazyCompletion )","status":"modified","deletions":6,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GistComment.py","changes":12,"additions":6,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GistComment.py","filename":"src/github/GistComment.py"},{"patch":"@@ -44,18 +44,18 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"change_status\", \"committed_at\", \"url\", \"user\", \"version\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"change_status\" in attributes and attributes[ \"change_status\" ] is not None:\n+ if \"change_status\" in attributes and attributes[ \"change_status\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"change_status\" ], dict )\n self.__change_status = CommitStats.CommitStats( self.__requester, attributes[ \"change_status\" ], completion = LazyCompletion )\n- if \"committed_at\" in attributes and attributes[ \"committed_at\" ] is not None:\n+ if \"committed_at\" in attributes and attributes[ \"committed_at\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"committed_at\" ], ( str, unicode ) )\n self.__committed_at = attributes[ \"committed_at\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"url\" ], ( str, unicode ) )\n self.__url = attributes[ \"url\" ]\n- if \"user\" in attributes and attributes[ \"user\" ] is not None:\n+ if \"user\" in attributes and attributes[ \"user\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"user\" ], dict )\n self.__user = NamedUser.NamedUser( self.__requester, attributes[ \"user\" ], completion = LazyCompletion )\n- if \"version\" in attributes and attributes[ \"version\" ] is not None:\n+ if \"version\" in attributes and attributes[ \"version\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"version\" ], ( str, unicode ) )\n self.__version = attributes[ \"version\" ]","status":"modified","deletions":5,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GistHistoryState.py","changes":10,"additions":5,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GistHistoryState.py","filename":"src/github/GistHistoryState.py"},{"patch":"@@ -32,12 +32,12 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"date\", \"email\", \"name\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"date\" in attributes and attributes[ \"date\" ] is not None:\n+ if \"date\" in attributes and attributes[ \"date\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"date\" ], ( str, unicode ) )\n self.__date = attributes[ \"date\" ]\n- if \"email\" in attributes and attributes[ \"email\" ] is not None:\n+ if \"email\" in attributes and attributes[ \"email\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"email\" ], ( str, unicode ) )\n self.__email = attributes[ \"email\" ]\n- if \"name\" in attributes and attributes[ \"name\" ] is not None:\n+ if \"name\" in attributes and attributes[ \"name\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"name\" ], ( str, unicode ) )\n self.__name = attributes[ \"name\" ]","status":"modified","deletions":3,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GitAuthor.py","changes":6,"additions":3,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GitAuthor.py","filename":"src/github/GitAuthor.py"},{"patch":"@@ -42,18 +42,18 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"content\", \"encoding\", \"sha\", \"size\", \"url\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"content\" in attributes and attributes[ \"content\" ] is not None:\n+ if \"content\" in attributes and attributes[ \"content\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"content\" ], ( str, unicode ) )\n self.__content = attributes[ \"content\" ]\n- if \"encoding\" in attributes and attributes[ \"encoding\" ] is not None:\n+ if \"encoding\" in attributes and attributes[ \"encoding\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"encoding\" ], ( str, unicode ) )\n self.__encoding = attributes[ \"encoding\" ]\n- if \"sha\" in attributes and attributes[ \"sha\" ] is not None:\n+ if \"sha\" in attributes and attributes[ \"sha\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"sha\" ], ( str, unicode ) )\n self.__sha = attributes[ \"sha\" ]\n- if \"size\" in attributes and attributes[ \"size\" ] is not None:\n+ if \"size\" in attributes and attributes[ \"size\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"size\" ], int )\n self.__size = attributes[ \"size\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"url\" ], ( str, unicode ) )\n self.__url = attributes[ \"url\" ]","status":"modified","deletions":5,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GitBlob.py","changes":10,"additions":5,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GitBlob.py","filename":"src/github/GitBlob.py"},{"patch":"@@ -55,27 +55,27 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"author\", \"committer\", \"message\", \"parents\", \"sha\", \"tree\", \"url\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"author\" in attributes and attributes[ \"author\" ] is not None:\n+ if \"author\" in attributes and attributes[ \"author\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"author\" ], dict )\n self.__author = GitAuthor.GitAuthor( self.__requester, attributes[ \"author\" ], completion = LazyCompletion )\n- if \"committer\" in attributes and attributes[ \"committer\" ] is not None:\n+ if \"committer\" in attributes and attributes[ \"committer\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"committer\" ], dict )\n self.__committer = GitAuthor.GitAuthor( self.__requester, attributes[ \"committer\" ], completion = LazyCompletion )\n- if \"message\" in attributes and attributes[ \"message\" ] is not None:\n+ if \"message\" in attributes and attributes[ \"message\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"message\" ], ( str, unicode ) )\n self.__message = attributes[ \"message\" ]\n- if \"parents\" in attributes and attributes[ \"parents\" ] is not None:\n+ if \"parents\" in attributes and attributes[ \"parents\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"parents\" ], list ) and ( len( attributes[ \"parents\" ] ) == 0 or isinstance( attributes[ \"parents\" ][ 0 ], dict ) )\n self.__parents = [\n GitCommit( self.__requester, element, completion = LazyCompletion )\n for element in attributes[ \"parents\" ]\n ]\n- if \"sha\" in attributes and attributes[ \"sha\" ] is not None:\n+ if \"sha\" in attributes and attributes[ \"sha\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"sha\" ], ( str, unicode ) )\n self.__sha = attributes[ \"sha\" ]\n- if \"tree\" in attributes and attributes[ \"tree\" ] is not None:\n+ if \"tree\" in attributes and attributes[ \"tree\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"tree\" ], dict )\n self.__tree = GitTree.GitTree( self.__requester, attributes[ \"tree\" ], completion = LazyCompletion )\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"url\" ], ( str, unicode ) )\n self.__url = attributes[ \"url\" ]","status":"modified","deletions":7,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GitCommit.py","changes":14,"additions":7,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GitCommit.py","filename":"src/github/GitCommit.py"},{"patch":"@@ -32,12 +32,12 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"sha\", \"type\", \"url\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"sha\" in attributes and attributes[ \"sha\" ] is not None:\n+ if \"sha\" in attributes and attributes[ \"sha\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"sha\" ], ( str, unicode ) )\n self.__sha = attributes[ \"sha\" ]\n- if \"type\" in attributes and attributes[ \"type\" ] is not None:\n+ if \"type\" in attributes and attributes[ \"type\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"type\" ], ( str, unicode ) )\n self.__type = attributes[ \"type\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"url\" ], ( str, unicode ) )\n self.__url = attributes[ \"url\" ]","status":"modified","deletions":3,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GitObject.py","changes":6,"additions":3,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GitObject.py","filename":"src/github/GitObject.py"},{"patch":"@@ -55,12 +55,12 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"object\", \"ref\", \"url\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"object\" in attributes and attributes[ \"object\" ] is not None:\n+ if \"object\" in attributes and attributes[ \"object\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"object\" ], dict )\n self.__object = GitObject.GitObject( self.__requester, attributes[ \"object\" ], completion = LazyCompletion )\n- if \"ref\" in attributes and attributes[ \"ref\" ] is not None:\n+ if \"ref\" in attributes and attributes[ \"ref\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"ref\" ], ( str, unicode ) )\n self.__ref = attributes[ \"ref\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"url\" ], ( str, unicode ) )\n self.__url = attributes[ \"url\" ]","status":"modified","deletions":3,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GitRef.py","changes":6,"additions":3,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GitRef.py","filename":"src/github/GitRef.py"},{"patch":"@@ -49,21 +49,21 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"message\", \"object\", \"sha\", \"tag\", \"tagger\", \"url\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"message\" in attributes and attributes[ \"message\" ] is not None:\n+ if \"message\" in attributes and attributes[ \"message\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"message\" ], ( str, unicode ) )\n self.__message = attributes[ \"message\" ]\n- if \"object\" in attributes and attributes[ \"object\" ] is not None:\n+ if \"object\" in attributes and attributes[ \"object\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"object\" ], dict )\n self.__object = GitObject.GitObject( self.__requester, attributes[ \"object\" ], completion = LazyCompletion )\n- if \"sha\" in attributes and attributes[ \"sha\" ] is not None:\n+ if \"sha\" in attributes and attributes[ \"sha\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"sha\" ], ( str, unicode ) )\n self.__sha = attributes[ \"sha\" ]\n- if \"tag\" in attributes and attributes[ \"tag\" ] is not None:\n+ if \"tag\" in attributes and attributes[ \"tag\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"tag\" ], ( str, unicode ) )\n self.__tag = attributes[ \"tag\" ]\n- if \"tagger\" in attributes and attributes[ \"tagger\" ] is not None:\n+ if \"tagger\" in attributes and attributes[ \"tagger\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"tagger\" ], dict )\n self.__tagger = GitAuthor.GitAuthor( self.__requester, attributes[ \"tagger\" ], completion = LazyCompletion )\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"url\" ], ( str, unicode ) )\n self.__url = attributes[ \"url\" ]","status":"modified","deletions":6,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GitTag.py","changes":12,"additions":6,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GitTag.py","filename":"src/github/GitTag.py"},{"patch":"@@ -33,15 +33,15 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"sha\", \"tree\", \"url\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"sha\" in attributes and attributes[ \"sha\" ] is not None:\n+ if \"sha\" in attributes and attributes[ \"sha\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"sha\" ], ( str, unicode ) )\n self.__sha = attributes[ \"sha\" ]\n- if \"tree\" in attributes and attributes[ \"tree\" ] is not None:\n+ if \"tree\" in attributes and attributes[ \"tree\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"tree\" ], list ) and ( len( attributes[ \"tree\" ] ) == 0 or isinstance( attributes[ \"tree\" ][ 0 ], dict ) )\n self.__tree = [\n GitTreeElement.GitTreeElement( self.__requester, element, completion = LazyCompletion )\n for element in attributes[ \"tree\" ]\n ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"url\" ], ( str, unicode ) )\n self.__url = attributes[ \"url\" ]","status":"modified","deletions":3,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GitTree.py","changes":6,"additions":3,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GitTree.py","filename":"src/github/GitTree.py"},{"patch":"@@ -47,21 +47,21 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"mode\", \"path\", \"sha\", \"size\", \"type\", \"url\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"mode\" in attributes and attributes[ \"mode\" ] is not None:\n+ if \"mode\" in attributes and attributes[ \"mode\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"mode\" ], ( str, unicode ) )\n self.__mode = attributes[ \"mode\" ]\n- if \"path\" in attributes and attributes[ \"path\" ] is not None:\n+ if \"path\" in attributes and attributes[ \"path\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"path\" ], ( str, unicode ) )\n self.__path = attributes[ \"path\" ]\n- if \"sha\" in attributes and attributes[ \"sha\" ] is not None:\n+ if \"sha\" in attributes and attributes[ \"sha\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"sha\" ], ( str, unicode ) )\n self.__sha = attributes[ \"sha\" ]\n- if \"size\" in attributes and attributes[ \"size\" ] is not None:\n+ if \"size\" in attributes and attributes[ \"size\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"size\" ], int )\n self.__size = attributes[ \"size\" ]\n- if \"type\" in attributes and attributes[ \"type\" ] is not None:\n+ if \"type\" in attributes and attributes[ \"type\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"type\" ], ( str, unicode ) )\n self.__type = attributes[ \"type\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"url\" ], ( str, unicode ) )\n self.__url = attributes[ \"url\" ]","status":"modified","deletions":6,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GitTreeElement.py","changes":12,"additions":6,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GitTreeElement.py","filename":"src/github/GitTreeElement.py"},{"patch":"@@ -99,21 +99,21 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"active\", \"config\", \"created_at\", \"events\", \"id\", \"last_response\", \"name\", \"updated_at\", \"url\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"active\" in attributes and attributes[ \"active\" ] is not None:\n+ if \"active\" in attributes and attributes[ \"active\" ] is not None: # pragma no branch\n self.__active = attributes[ \"active\" ]\n- if \"config\" in attributes and attributes[ \"config\" ] is not None:\n+ if \"config\" in attributes and attributes[ \"config\" ] is not None: # pragma no branch\n self.__config = attributes[ \"config\" ]\n- if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None:\n+ if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None: # pragma no branch\n self.__created_at = attributes[ \"created_at\" ]\n- if \"events\" in attributes and attributes[ \"events\" ] is not None:\n+ if \"events\" in attributes and attributes[ \"events\" ] is not None: # pragma no branch\n self.__events = attributes[ \"events\" ]\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n self.__id = attributes[ \"id\" ]\n- if \"last_response\" in attributes and attributes[ \"last_response\" ] is not None:\n+ if \"last_response\" in attributes and attributes[ \"last_response\" ] is not None: # pragma no branch\n self.__last_response = attributes[ \"last_response\" ]\n- if \"name\" in attributes and attributes[ \"name\" ] is not None:\n+ if \"name\" in attributes and attributes[ \"name\" ] is not None: # pragma no branch\n self.__name = attributes[ \"name\" ]\n- if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None:\n+ if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None: # pragma no branch\n self.__updated_at = attributes[ \"updated_at\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n self.__url = attributes[ \"url\" ]","status":"modified","deletions":9,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Hook.py","changes":18,"additions":9,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Hook.py","filename":"src/github/Hook.py"},{"patch":"@@ -110,7 +110,7 @@ def user( self ):\n return self.__user\n \n def add_to_labels( self, *labels ):\n- post_parameters = labels\n+ post_parameters = [ label.name for label in labels ]\n status, headers, data = self.__requester.request(\n \"POST\",\n str( self.url ) + \"/labels\",\n@@ -131,7 +131,12 @@ def create_comment( self, body ):\n return IssueComment.IssueComment( self.__requester, data, completion = NoCompletion )\n \n def delete_labels( self ):\n- pass\n+ status, headers, data = self.__requester.request(\n+ \"DELETE\",\n+ str( self.url ) + \"/labels\",\n+ None,\n+ None\n+ )\n \n def edit( self, title = DefaultValueForOptionalParameters, body = DefaultValueForOptionalParameters, assignee = DefaultValueForOptionalParameters, state = DefaultValueForOptionalParameters, milestone = DefaultValueForOptionalParameters, labels = DefaultValueForOptionalParameters ):\n post_parameters = {\n@@ -216,7 +221,13 @@ def remove_from_labels( self, label ):\n )\n \n def set_labels( self, *labels ):\n- pass\n+ post_parameters = [ label.name for label in labels ]\n+ status, headers, data = self.__requester.request(\n+ \"PUT\",\n+ str( self.url ) + \"/labels\",\n+ None,\n+ post_parameters\n+ )\n \n def __initAttributes( self ):\n self.__assignee = None\n@@ -257,59 +268,59 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"assignee\", \"body\", \"closed_at\", \"closed_by\", \"comments\", \"created_at\", \"html_url\", \"id\", \"labels\", \"milestone\", \"number\", \"pull_request\", \"repository\", \"state\", \"title\", \"updated_at\", \"url\", \"user\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"assignee\" in attributes and attributes[ \"assignee\" ] is not None:\n+ if \"assignee\" in attributes and attributes[ \"assignee\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"assignee\" ], dict )\n self.__assignee = NamedUser.NamedUser( self.__requester, attributes[ \"assignee\" ], completion = LazyCompletion )\n- if \"body\" in attributes and attributes[ \"body\" ] is not None:\n+ if \"body\" in attributes and attributes[ \"body\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"body\" ], ( str, unicode ) )\n self.__body = attributes[ \"body\" ]\n- if \"closed_at\" in attributes and attributes[ \"closed_at\" ] is not None:\n+ if \"closed_at\" in attributes and attributes[ \"closed_at\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"closed_at\" ], ( str, unicode ) )\n self.__closed_at = attributes[ \"closed_at\" ]\n- if \"closed_by\" in attributes and attributes[ \"closed_by\" ] is not None:\n+ if \"closed_by\" in attributes and attributes[ \"closed_by\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"closed_by\" ], dict )\n self.__closed_by = NamedUser.NamedUser( self.__requester, attributes[ \"closed_by\" ], completion = LazyCompletion )\n- if \"comments\" in attributes and attributes[ \"comments\" ] is not None:\n+ if \"comments\" in attributes and attributes[ \"comments\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"comments\" ], int )\n self.__comments = attributes[ \"comments\" ]\n- if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None:\n+ if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"created_at\" ], ( str, unicode ) )\n self.__created_at = attributes[ \"created_at\" ]\n- if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None:\n+ if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"html_url\" ], ( str, unicode ) )\n self.__html_url = attributes[ \"html_url\" ]\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"id\" ], int )\n self.__id = attributes[ \"id\" ]\n- if \"labels\" in attributes and attributes[ \"labels\" ] is not None:\n+ if \"labels\" in attributes and attributes[ \"labels\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"labels\" ], list ) and ( len( attributes[ \"labels\" ] ) == 0 or isinstance( attributes[ \"labels\" ][ 0 ], dict ) )\n self.__labels = [\n Label.Label( self.__requester, element, completion = LazyCompletion )\n for element in attributes[ \"labels\" ]\n ]\n- if \"milestone\" in attributes and attributes[ \"milestone\" ] is not None:\n+ if \"milestone\" in attributes and attributes[ \"milestone\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"milestone\" ], dict )\n self.__milestone = Milestone.Milestone( self.__requester, attributes[ \"milestone\" ], completion = LazyCompletion )\n- if \"number\" in attributes and attributes[ \"number\" ] is not None:\n+ if \"number\" in attributes and attributes[ \"number\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"number\" ], int )\n self.__number = attributes[ \"number\" ]\n- if \"pull_request\" in attributes and attributes[ \"pull_request\" ] is not None:\n+ if \"pull_request\" in attributes and attributes[ \"pull_request\" ] is not None: # pragma no branch\n self.__pull_request = attributes[ \"pull_request\" ]\n- if \"repository\" in attributes and attributes[ \"repository\" ] is not None:\n+ if \"repository\" in attributes and attributes[ \"repository\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"repository\" ], dict )\n self.__repository = Repository.Repository( self.__requester, attributes[ \"repository\" ], completion = LazyCompletion )\n- if \"state\" in attributes and attributes[ \"state\" ] is not None:\n+ if \"state\" in attributes and attributes[ \"state\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"state\" ], ( str, unicode ) )\n self.__state = attributes[ \"state\" ]\n- if \"title\" in attributes and attributes[ \"title\" ] is not None:\n+ if \"title\" in attributes and attributes[ \"title\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"title\" ], ( str, unicode ) )\n self.__title = attributes[ \"title\" ]\n- if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None:\n+ if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"updated_at\" ], ( str, unicode ) )\n self.__updated_at = attributes[ \"updated_at\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"url\" ], ( str, unicode ) )\n self.__url = attributes[ \"url\" ]\n- if \"user\" in attributes and attributes[ \"user\" ] is not None:\n+ if \"user\" in attributes and attributes[ \"user\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"user\" ], dict )\n self.__user = NamedUser.NamedUser( self.__requester, attributes[ \"user\" ], completion = LazyCompletion )","status":"modified","deletions":21,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Issue.py","changes":53,"additions":32,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Issue.py","filename":"src/github/Issue.py"},{"patch":"@@ -68,16 +68,16 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"body\", \"created_at\", \"id\", \"updated_at\", \"url\", \"user\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"body\" in attributes and attributes[ \"body\" ] is not None:\n+ if \"body\" in attributes and attributes[ \"body\" ] is not None: # pragma no branch\n self.__body = attributes[ \"body\" ]\n- if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None:\n+ if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None: # pragma no branch\n self.__created_at = attributes[ \"created_at\" ]\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n self.__id = attributes[ \"id\" ]\n- if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None:\n+ if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None: # pragma no branch\n self.__updated_at = attributes[ \"updated_at\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n self.__url = attributes[ \"url\" ]\n- if \"user\" in attributes and attributes[ \"user\" ] is not None:\n+ if \"user\" in attributes and attributes[ \"user\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"user\" ], dict )\n self.__user = NamedUser.NamedUser( self.__requester, attributes[ \"user\" ], completion = LazyCompletion )","status":"modified","deletions":6,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/IssueComment.py","changes":12,"additions":6,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/IssueComment.py","filename":"src/github/IssueComment.py"},{"patch":"@@ -78,24 +78,24 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"actor\", \"commit_id\", \"created_at\", \"event\", \"id\", \"issue\", \"url\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"actor\" in attributes and attributes[ \"actor\" ] is not None:\n+ if \"actor\" in attributes and attributes[ \"actor\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"actor\" ], dict )\n self.__actor = NamedUser.NamedUser( self.__requester, attributes[ \"actor\" ], completion = LazyCompletion )\n- if \"commit_id\" in attributes and attributes[ \"commit_id\" ] is not None:\n+ if \"commit_id\" in attributes and attributes[ \"commit_id\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"commit_id\" ], ( str, unicode ) )\n self.__commit_id = attributes[ \"commit_id\" ]\n- if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None:\n+ if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"created_at\" ], ( str, unicode ) )\n self.__created_at = attributes[ \"created_at\" ]\n- if \"event\" in attributes and attributes[ \"event\" ] is not None:\n+ if \"event\" in attributes and attributes[ \"event\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"event\" ], ( str, unicode ) )\n self.__event = attributes[ \"event\" ]\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"id\" ], int )\n self.__id = attributes[ \"id\" ]\n- if \"issue\" in attributes and attributes[ \"issue\" ] is not None:\n+ if \"issue\" in attributes and attributes[ \"issue\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"issue\" ], dict )\n self.__issue = Issue.Issue( self.__requester, attributes[ \"issue\" ], completion = LazyCompletion )\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"url\" ], ( str, unicode ) )\n self.__url = attributes[ \"url\" ]","status":"modified","deletions":7,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/IssueEvent.py","changes":14,"additions":7,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/IssueEvent.py","filename":"src/github/IssueEvent.py"},{"patch":"@@ -1,6 +1,8 @@\n # WARNING: this file is generated automaticaly.\n # Do not modify it manually, your work would be lost.\n \n+import urllib\n+\n import PaginatedList\n from GithubObject import *\n \n@@ -43,6 +45,11 @@ def edit( self, name, color ):\n )\n self.__useAttributes( data )\n \n+ # @toto Remove '_identity' from the normalized json description\n+ @property\n+ def _identity( self ):\n+ return urllib.quote( self.name )\n+\n def __initAttributes( self ):\n self.__color = None\n self.__name = None\n@@ -53,9 +60,9 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"color\", \"name\", \"url\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"color\" in attributes and attributes[ \"color\" ] is not None:\n+ if \"color\" in attributes and attributes[ \"color\" ] is not None: # pragma no branch\n self.__color = attributes[ \"color\" ]\n- if \"name\" in attributes and attributes[ \"name\" ] is not None:\n+ if \"name\" in attributes and attributes[ \"name\" ] is not None: # pragma no branch\n self.__name = attributes[ \"name\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n self.__url = attributes[ \"url\" ]","status":"modified","deletions":3,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Label.py","changes":13,"additions":10,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Label.py","filename":"src/github/Label.py"},{"patch":"@@ -114,36 +114,36 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"closed_issues\", \"created_at\", \"creator\", \"description\", \"due_on\", \"id\", \"number\", \"open_issues\", \"state\", \"title\", \"url\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"closed_issues\" in attributes and attributes[ \"closed_issues\" ] is not None:\n+ if \"closed_issues\" in attributes and attributes[ \"closed_issues\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"closed_issues\" ], int )\n self.__closed_issues = attributes[ \"closed_issues\" ]\n- if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None:\n+ if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"created_at\" ], ( str, unicode ) )\n self.__created_at = attributes[ \"created_at\" ]\n- if \"creator\" in attributes and attributes[ \"creator\" ] is not None:\n+ if \"creator\" in attributes and attributes[ \"creator\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"creator\" ], dict )\n self.__creator = NamedUser.NamedUser( self.__requester, attributes[ \"creator\" ], completion = LazyCompletion )\n- if \"description\" in attributes and attributes[ \"description\" ] is not None:\n+ if \"description\" in attributes and attributes[ \"description\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"description\" ], ( str, unicode ) )\n self.__description = attributes[ \"description\" ]\n- if \"due_on\" in attributes and attributes[ \"due_on\" ] is not None:\n+ if \"due_on\" in attributes and attributes[ \"due_on\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"due_on\" ], ( str, unicode ) )\n self.__due_on = attributes[ \"due_on\" ]\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"id\" ], int )\n self.__id = attributes[ \"id\" ]\n- if \"number\" in attributes and attributes[ \"number\" ] is not None:\n+ if \"number\" in attributes and attributes[ \"number\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"number\" ], int )\n self.__number = attributes[ \"number\" ]\n- if \"open_issues\" in attributes and attributes[ \"open_issues\" ] is not None:\n+ if \"open_issues\" in attributes and attributes[ \"open_issues\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"open_issues\" ], int )\n self.__open_issues = attributes[ \"open_issues\" ]\n- if \"state\" in attributes and attributes[ \"state\" ] is not None:\n+ if \"state\" in attributes and attributes[ \"state\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"state\" ], ( str, unicode ) )\n self.__state = attributes[ \"state\" ]\n- if \"title\" in attributes and attributes[ \"title\" ] is not None:\n+ if \"title\" in attributes and attributes[ \"title\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"title\" ], ( str, unicode ) )\n self.__title = attributes[ \"title\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"url\" ], ( str, unicode ) )\n self.__url = attributes[ \"url\" ]","status":"modified","deletions":11,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Milestone.py","changes":22,"additions":11,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Milestone.py","filename":"src/github/Milestone.py"},{"patch":"@@ -365,81 +365,81 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"avatar_url\", \"bio\", \"blog\", \"collaborators\", \"company\", \"contributions\", \"created_at\", \"disk_usage\", \"email\", \"followers\", \"following\", \"gravatar_id\", \"hireable\", \"html_url\", \"id\", \"location\", \"login\", \"name\", \"owned_private_repos\", \"plan\", \"private_gists\", \"public_gists\", \"public_repos\", \"total_private_repos\", \"type\", \"url\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"avatar_url\" in attributes and attributes[ \"avatar_url\" ] is not None:\n+ if \"avatar_url\" in attributes and attributes[ \"avatar_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"avatar_url\" ], ( str, unicode ) )\n self.__avatar_url = attributes[ \"avatar_url\" ]\n- if \"bio\" in attributes and attributes[ \"bio\" ] is not None:\n+ if \"bio\" in attributes and attributes[ \"bio\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"bio\" ], ( str, unicode ) )\n self.__bio = attributes[ \"bio\" ]\n- if \"blog\" in attributes and attributes[ \"blog\" ] is not None:\n+ if \"blog\" in attributes and attributes[ \"blog\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"blog\" ], ( str, unicode ) )\n self.__blog = attributes[ \"blog\" ]\n- if \"collaborators\" in attributes and attributes[ \"collaborators\" ] is not None:\n+ if \"collaborators\" in attributes and attributes[ \"collaborators\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"collaborators\" ], int )\n self.__collaborators = attributes[ \"collaborators\" ]\n- if \"company\" in attributes and attributes[ \"company\" ] is not None:\n+ if \"company\" in attributes and attributes[ \"company\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"company\" ], ( str, unicode ) )\n self.__company = attributes[ \"company\" ]\n- if \"contributions\" in attributes and attributes[ \"contributions\" ] is not None:\n+ if \"contributions\" in attributes and attributes[ \"contributions\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"contributions\" ], int )\n self.__contributions = attributes[ \"contributions\" ]\n- if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None:\n+ if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"created_at\" ], ( str, unicode ) )\n self.__created_at = attributes[ \"created_at\" ]\n- if \"disk_usage\" in attributes and attributes[ \"disk_usage\" ] is not None:\n+ if \"disk_usage\" in attributes and attributes[ \"disk_usage\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"disk_usage\" ], int )\n self.__disk_usage = attributes[ \"disk_usage\" ]\n- if \"email\" in attributes and attributes[ \"email\" ] is not None:\n+ if \"email\" in attributes and attributes[ \"email\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"email\" ], ( str, unicode ) )\n self.__email = attributes[ \"email\" ]\n- if \"followers\" in attributes and attributes[ \"followers\" ] is not None:\n+ if \"followers\" in attributes and attributes[ \"followers\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"followers\" ], int )\n self.__followers = attributes[ \"followers\" ]\n- if \"following\" in attributes and attributes[ \"following\" ] is not None:\n+ if \"following\" in attributes and attributes[ \"following\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"following\" ], int )\n self.__following = attributes[ \"following\" ]\n- if \"gravatar_id\" in attributes and attributes[ \"gravatar_id\" ] is not None:\n+ if \"gravatar_id\" in attributes and attributes[ \"gravatar_id\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"gravatar_id\" ], ( str, unicode ) )\n self.__gravatar_id = attributes[ \"gravatar_id\" ]\n- if \"hireable\" in attributes and attributes[ \"hireable\" ] is not None:\n+ if \"hireable\" in attributes and attributes[ \"hireable\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"hireable\" ], bool )\n self.__hireable = attributes[ \"hireable\" ]\n- if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None:\n+ if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"html_url\" ], ( str, unicode ) )\n self.__html_url = attributes[ \"html_url\" ]\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"id\" ], int )\n self.__id = attributes[ \"id\" ]\n- if \"location\" in attributes and attributes[ \"location\" ] is not None:\n+ if \"location\" in attributes and attributes[ \"location\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"location\" ], ( str, unicode ) )\n self.__location = attributes[ \"location\" ]\n- if \"login\" in attributes and attributes[ \"login\" ] is not None:\n+ if \"login\" in attributes and attributes[ \"login\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"login\" ], ( str, unicode ) )\n self.__login = attributes[ \"login\" ]\n- if \"name\" in attributes and attributes[ \"name\" ] is not None:\n+ if \"name\" in attributes and attributes[ \"name\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"name\" ], ( str, unicode ) )\n self.__name = attributes[ \"name\" ]\n- if \"owned_private_repos\" in attributes and attributes[ \"owned_private_repos\" ] is not None:\n+ if \"owned_private_repos\" in attributes and attributes[ \"owned_private_repos\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"owned_private_repos\" ], int )\n self.__owned_private_repos = attributes[ \"owned_private_repos\" ]\n- if \"plan\" in attributes and attributes[ \"plan\" ] is not None:\n+ if \"plan\" in attributes and attributes[ \"plan\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"plan\" ], dict )\n self.__plan = Plan.Plan( self.__requester, attributes[ \"plan\" ], completion = LazyCompletion )\n- if \"private_gists\" in attributes and attributes[ \"private_gists\" ] is not None:\n+ if \"private_gists\" in attributes and attributes[ \"private_gists\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"private_gists\" ], int )\n self.__private_gists = attributes[ \"private_gists\" ]\n- if \"public_gists\" in attributes and attributes[ \"public_gists\" ] is not None:\n+ if \"public_gists\" in attributes and attributes[ \"public_gists\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"public_gists\" ], int )\n self.__public_gists = attributes[ \"public_gists\" ]\n- if \"public_repos\" in attributes and attributes[ \"public_repos\" ] is not None:\n+ if \"public_repos\" in attributes and attributes[ \"public_repos\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"public_repos\" ], int )\n self.__public_repos = attributes[ \"public_repos\" ]\n- if \"total_private_repos\" in attributes and attributes[ \"total_private_repos\" ] is not None:\n+ if \"total_private_repos\" in attributes and attributes[ \"total_private_repos\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"total_private_repos\" ], int )\n self.__total_private_repos = attributes[ \"total_private_repos\" ]\n- if \"type\" in attributes and attributes[ \"type\" ] is not None:\n+ if \"type\" in attributes and attributes[ \"type\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"type\" ], ( str, unicode ) )\n self.__type = attributes[ \"type\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"url\" ], ( str, unicode ) )\n self.__url = attributes[ \"url\" ]","status":"modified","deletions":26,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/NamedUser.py","changes":52,"additions":26,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/NamedUser.py","filename":"src/github/NamedUser.py"},{"patch":"@@ -390,75 +390,75 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"avatar_url\", \"billing_email\", \"blog\", \"collaborators\", \"company\", \"created_at\", \"disk_usage\", \"email\", \"followers\", \"following\", \"gravatar_id\", \"html_url\", \"id\", \"location\", \"login\", \"name\", \"owned_private_repos\", \"plan\", \"private_gists\", \"public_gists\", \"public_repos\", \"total_private_repos\", \"type\", \"url\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"avatar_url\" in attributes and attributes[ \"avatar_url\" ] is not None:\n+ if \"avatar_url\" in attributes and attributes[ \"avatar_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"avatar_url\" ], ( str, unicode ) )\n self.__avatar_url = attributes[ \"avatar_url\" ]\n- if \"billing_email\" in attributes and attributes[ \"billing_email\" ] is not None:\n+ if \"billing_email\" in attributes and attributes[ \"billing_email\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"billing_email\" ], ( str, unicode ) )\n self.__billing_email = attributes[ \"billing_email\" ]\n- if \"blog\" in attributes and attributes[ \"blog\" ] is not None:\n+ if \"blog\" in attributes and attributes[ \"blog\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"blog\" ], ( str, unicode ) )\n self.__blog = attributes[ \"blog\" ]\n- if \"collaborators\" in attributes and attributes[ \"collaborators\" ] is not None:\n+ if \"collaborators\" in attributes and attributes[ \"collaborators\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"collaborators\" ], int )\n self.__collaborators = attributes[ \"collaborators\" ]\n- if \"company\" in attributes and attributes[ \"company\" ] is not None:\n+ if \"company\" in attributes and attributes[ \"company\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"company\" ], ( str, unicode ) )\n self.__company = attributes[ \"company\" ]\n- if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None:\n+ if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"created_at\" ], ( str, unicode ) )\n self.__created_at = attributes[ \"created_at\" ]\n- if \"disk_usage\" in attributes and attributes[ \"disk_usage\" ] is not None:\n+ if \"disk_usage\" in attributes and attributes[ \"disk_usage\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"disk_usage\" ], int )\n self.__disk_usage = attributes[ \"disk_usage\" ]\n- if \"email\" in attributes and attributes[ \"email\" ] is not None:\n+ if \"email\" in attributes and attributes[ \"email\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"email\" ], ( str, unicode ) )\n self.__email = attributes[ \"email\" ]\n- if \"followers\" in attributes and attributes[ \"followers\" ] is not None:\n+ if \"followers\" in attributes and attributes[ \"followers\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"followers\" ], int )\n self.__followers = attributes[ \"followers\" ]\n- if \"following\" in attributes and attributes[ \"following\" ] is not None:\n+ if \"following\" in attributes and attributes[ \"following\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"following\" ], int )\n self.__following = attributes[ \"following\" ]\n- if \"gravatar_id\" in attributes and attributes[ \"gravatar_id\" ] is not None:\n+ if \"gravatar_id\" in attributes and attributes[ \"gravatar_id\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"gravatar_id\" ], ( str, unicode ) )\n self.__gravatar_id = attributes[ \"gravatar_id\" ]\n- if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None:\n+ if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"html_url\" ], ( str, unicode ) )\n self.__html_url = attributes[ \"html_url\" ]\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"id\" ], int )\n self.__id = attributes[ \"id\" ]\n- if \"location\" in attributes and attributes[ \"location\" ] is not None:\n+ if \"location\" in attributes and attributes[ \"location\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"location\" ], ( str, unicode ) )\n self.__location = attributes[ \"location\" ]\n- if \"login\" in attributes and attributes[ \"login\" ] is not None:\n+ if \"login\" in attributes and attributes[ \"login\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"login\" ], ( str, unicode ) )\n self.__login = attributes[ \"login\" ]\n- if \"name\" in attributes and attributes[ \"name\" ] is not None:\n+ if \"name\" in attributes and attributes[ \"name\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"name\" ], ( str, unicode ) )\n self.__name = attributes[ \"name\" ]\n- if \"owned_private_repos\" in attributes and attributes[ \"owned_private_repos\" ] is not None:\n+ if \"owned_private_repos\" in attributes and attributes[ \"owned_private_repos\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"owned_private_repos\" ], int )\n self.__owned_private_repos = attributes[ \"owned_private_repos\" ]\n- if \"plan\" in attributes and attributes[ \"plan\" ] is not None:\n+ if \"plan\" in attributes and attributes[ \"plan\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"plan\" ], dict )\n self.__plan = Plan.Plan( self.__requester, attributes[ \"plan\" ], completion = LazyCompletion )\n- if \"private_gists\" in attributes and attributes[ \"private_gists\" ] is not None:\n+ if \"private_gists\" in attributes and attributes[ \"private_gists\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"private_gists\" ], int )\n self.__private_gists = attributes[ \"private_gists\" ]\n- if \"public_gists\" in attributes and attributes[ \"public_gists\" ] is not None:\n+ if \"public_gists\" in attributes and attributes[ \"public_gists\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"public_gists\" ], int )\n self.__public_gists = attributes[ \"public_gists\" ]\n- if \"public_repos\" in attributes and attributes[ \"public_repos\" ] is not None:\n+ if \"public_repos\" in attributes and attributes[ \"public_repos\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"public_repos\" ], int )\n self.__public_repos = attributes[ \"public_repos\" ]\n- if \"total_private_repos\" in attributes and attributes[ \"total_private_repos\" ] is not None:\n+ if \"total_private_repos\" in attributes and attributes[ \"total_private_repos\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"total_private_repos\" ], int )\n self.__total_private_repos = attributes[ \"total_private_repos\" ]\n- if \"type\" in attributes and attributes[ \"type\" ] is not None:\n+ if \"type\" in attributes and attributes[ \"type\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"type\" ], ( str, unicode ) )\n self.__type = attributes[ \"type\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"url\" ], ( str, unicode ) )\n self.__url = attributes[ \"url\" ]","status":"modified","deletions":24,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Organization.py","changes":48,"additions":24,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Organization.py","filename":"src/github/Organization.py"},{"patch":"@@ -32,12 +32,12 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"admin\", \"pull\", \"push\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"admin\" in attributes and attributes[ \"admin\" ] is not None:\n+ if \"admin\" in attributes and attributes[ \"admin\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"admin\" ], bool )\n self.__admin = attributes[ \"admin\" ]\n- if \"pull\" in attributes and attributes[ \"pull\" ] is not None:\n+ if \"pull\" in attributes and attributes[ \"pull\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"pull\" ], bool )\n self.__pull = attributes[ \"pull\" ]\n- if \"push\" in attributes and attributes[ \"push\" ] is not None:\n+ if \"push\" in attributes and attributes[ \"push\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"push\" ], bool )\n self.__push = attributes[ \"push\" ]","status":"modified","deletions":3,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Permissions.py","changes":6,"additions":3,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Permissions.py","filename":"src/github/Permissions.py"},{"patch":"@@ -37,15 +37,15 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"collaborators\", \"name\", \"private_repos\", \"space\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"collaborators\" in attributes and attributes[ \"collaborators\" ] is not None:\n+ if \"collaborators\" in attributes and attributes[ \"collaborators\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"collaborators\" ], int )\n self.__collaborators = attributes[ \"collaborators\" ]\n- if \"name\" in attributes and attributes[ \"name\" ] is not None:\n+ if \"name\" in attributes and attributes[ \"name\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"name\" ], ( str, unicode ) )\n self.__name = attributes[ \"name\" ]\n- if \"private_repos\" in attributes and attributes[ \"private_repos\" ] is not None:\n+ if \"private_repos\" in attributes and attributes[ \"private_repos\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"private_repos\" ], int )\n self.__private_repos = attributes[ \"private_repos\" ]\n- if \"space\" in attributes and attributes[ \"space\" ] is not None:\n+ if \"space\" in attributes and attributes[ \"space\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"space\" ], int )\n self.__space = attributes[ \"space\" ]","status":"modified","deletions":4,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Plan.py","changes":8,"additions":4,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Plan.py","filename":"src/github/Plan.py"},{"patch":"@@ -279,56 +279,56 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"additions\", \"base\", \"body\", \"changed_files\", \"closed_at\", \"comments\", \"commits\", \"created_at\", \"deletions\", \"diff_url\", \"head\", \"html_url\", \"id\", \"issue_url\", \"mergeable\", \"merged\", \"merged_at\", \"merged_by\", \"number\", \"patch_url\", \"review_comments\", \"state\", \"title\", \"updated_at\", \"url\", \"user\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"additions\" in attributes and attributes[ \"additions\" ] is not None:\n+ if \"additions\" in attributes and attributes[ \"additions\" ] is not None: # pragma no branch\n self.__additions = attributes[ \"additions\" ]\n- if \"base\" in attributes and attributes[ \"base\" ] is not None:\n+ if \"base\" in attributes and attributes[ \"base\" ] is not None: # pragma no branch\n self.__base = attributes[ \"base\" ]\n- if \"body\" in attributes and attributes[ \"body\" ] is not None:\n+ if \"body\" in attributes and attributes[ \"body\" ] is not None: # pragma no branch\n self.__body = attributes[ \"body\" ]\n- if \"changed_files\" in attributes and attributes[ \"changed_files\" ] is not None:\n+ if \"changed_files\" in attributes and attributes[ \"changed_files\" ] is not None: # pragma no branch\n self.__changed_files = attributes[ \"changed_files\" ]\n- if \"closed_at\" in attributes and attributes[ \"closed_at\" ] is not None:\n+ if \"closed_at\" in attributes and attributes[ \"closed_at\" ] is not None: # pragma no branch\n self.__closed_at = attributes[ \"closed_at\" ]\n- if \"comments\" in attributes and attributes[ \"comments\" ] is not None:\n+ if \"comments\" in attributes and attributes[ \"comments\" ] is not None: # pragma no branch\n self.__comments = attributes[ \"comments\" ]\n- if \"commits\" in attributes and attributes[ \"commits\" ] is not None:\n+ if \"commits\" in attributes and attributes[ \"commits\" ] is not None: # pragma no branch\n self.__commits = attributes[ \"commits\" ]\n- if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None:\n+ if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None: # pragma no branch\n self.__created_at = attributes[ \"created_at\" ]\n- if \"deletions\" in attributes and attributes[ \"deletions\" ] is not None:\n+ if \"deletions\" in attributes and attributes[ \"deletions\" ] is not None: # pragma no branch\n self.__deletions = attributes[ \"deletions\" ]\n- if \"diff_url\" in attributes and attributes[ \"diff_url\" ] is not None:\n+ if \"diff_url\" in attributes and attributes[ \"diff_url\" ] is not None: # pragma no branch\n self.__diff_url = attributes[ \"diff_url\" ]\n- if \"head\" in attributes and attributes[ \"head\" ] is not None:\n+ if \"head\" in attributes and attributes[ \"head\" ] is not None: # pragma no branch\n self.__head = attributes[ \"head\" ]\n- if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None:\n+ if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None: # pragma no branch\n self.__html_url = attributes[ \"html_url\" ]\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n self.__id = attributes[ \"id\" ]\n- if \"issue_url\" in attributes and attributes[ \"issue_url\" ] is not None:\n+ if \"issue_url\" in attributes and attributes[ \"issue_url\" ] is not None: # pragma no branch\n self.__issue_url = attributes[ \"issue_url\" ]\n- if \"mergeable\" in attributes and attributes[ \"mergeable\" ] is not None:\n+ if \"mergeable\" in attributes and attributes[ \"mergeable\" ] is not None: # pragma no branch\n self.__mergeable = attributes[ \"mergeable\" ]\n- if \"merged\" in attributes and attributes[ \"merged\" ] is not None:\n+ if \"merged\" in attributes and attributes[ \"merged\" ] is not None: # pragma no branch\n self.__merged = attributes[ \"merged\" ]\n- if \"merged_at\" in attributes and attributes[ \"merged_at\" ] is not None:\n+ if \"merged_at\" in attributes and attributes[ \"merged_at\" ] is not None: # pragma no branch\n self.__merged_at = attributes[ \"merged_at\" ]\n- if \"merged_by\" in attributes and attributes[ \"merged_by\" ] is not None:\n+ if \"merged_by\" in attributes and attributes[ \"merged_by\" ] is not None: # pragma no branch\n self.__merged_by = attributes[ \"merged_by\" ]\n- if \"number\" in attributes and attributes[ \"number\" ] is not None:\n+ if \"number\" in attributes and attributes[ \"number\" ] is not None: # pragma no branch\n self.__number = attributes[ \"number\" ]\n- if \"patch_url\" in attributes and attributes[ \"patch_url\" ] is not None:\n+ if \"patch_url\" in attributes and attributes[ \"patch_url\" ] is not None: # pragma no branch\n self.__patch_url = attributes[ \"patch_url\" ]\n- if \"review_comments\" in attributes and attributes[ \"review_comments\" ] is not None:\n+ if \"review_comments\" in attributes and attributes[ \"review_comments\" ] is not None: # pragma no branch\n self.__review_comments = attributes[ \"review_comments\" ]\n- if \"state\" in attributes and attributes[ \"state\" ] is not None:\n+ if \"state\" in attributes and attributes[ \"state\" ] is not None: # pragma no branch\n self.__state = attributes[ \"state\" ]\n- if \"title\" in attributes and attributes[ \"title\" ] is not None:\n+ if \"title\" in attributes and attributes[ \"title\" ] is not None: # pragma no branch\n self.__title = attributes[ \"title\" ]\n- if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None:\n+ if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None: # pragma no branch\n self.__updated_at = attributes[ \"updated_at\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n self.__url = attributes[ \"url\" ]\n- if \"user\" in attributes and attributes[ \"user\" ] is not None:\n+ if \"user\" in attributes and attributes[ \"user\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"user\" ], dict )\n self.__user = NamedUser.NamedUser( self.__requester, attributes[ \"user\" ], completion = LazyCompletion )","status":"modified","deletions":26,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/PullRequest.py","changes":52,"additions":26,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/PullRequest.py","filename":"src/github/PullRequest.py"},{"patch":"@@ -121,26 +121,26 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"body\", \"commit_id\", \"created_at\", \"html_url\", \"id\", \"line\", \"path\", \"position\", \"updated_at\", \"url\", \"user\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"body\" in attributes and attributes[ \"body\" ] is not None:\n+ if \"body\" in attributes and attributes[ \"body\" ] is not None: # pragma no branch\n self.__body = attributes[ \"body\" ]\n- if \"commit_id\" in attributes and attributes[ \"commit_id\" ] is not None:\n+ if \"commit_id\" in attributes and attributes[ \"commit_id\" ] is not None: # pragma no branch\n self.__commit_id = attributes[ \"commit_id\" ]\n- if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None:\n+ if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None: # pragma no branch\n self.__created_at = attributes[ \"created_at\" ]\n- if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None:\n+ if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None: # pragma no branch\n self.__html_url = attributes[ \"html_url\" ]\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n self.__id = attributes[ \"id\" ]\n- if \"line\" in attributes and attributes[ \"line\" ] is not None:\n+ if \"line\" in attributes and attributes[ \"line\" ] is not None: # pragma no branch\n self.__line = attributes[ \"line\" ]\n- if \"path\" in attributes and attributes[ \"path\" ] is not None:\n+ if \"path\" in attributes and attributes[ \"path\" ] is not None: # pragma no branch\n self.__path = attributes[ \"path\" ]\n- if \"position\" in attributes and attributes[ \"position\" ] is not None:\n+ if \"position\" in attributes and attributes[ \"position\" ] is not None: # pragma no branch\n self.__position = attributes[ \"position\" ]\n- if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None:\n+ if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None: # pragma no branch\n self.__updated_at = attributes[ \"updated_at\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n self.__url = attributes[ \"url\" ]\n- if \"user\" in attributes and attributes[ \"user\" ] is not None:\n+ if \"user\" in attributes and attributes[ \"user\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"user\" ], dict )\n self.__user = NamedUser.NamedUser( self.__requester, attributes[ \"user\" ], completion = LazyCompletion )","status":"modified","deletions":11,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/PullRequestComment.py","changes":22,"additions":11,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/PullRequestComment.py","filename":"src/github/PullRequestComment.py"},{"patch":"@@ -62,21 +62,21 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"additions\", \"blob_url\", \"changes\", \"deletions\", \"filename\", \"patch\", \"raw_url\", \"sha\", \"status\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"additions\" in attributes and attributes[ \"additions\" ] is not None:\n+ if \"additions\" in attributes and attributes[ \"additions\" ] is not None: # pragma no branch\n self.__additions = attributes[ \"additions\" ]\n- if \"blob_url\" in attributes and attributes[ \"blob_url\" ] is not None:\n+ if \"blob_url\" in attributes and attributes[ \"blob_url\" ] is not None: # pragma no branch\n self.__blob_url = attributes[ \"blob_url\" ]\n- if \"changes\" in attributes and attributes[ \"changes\" ] is not None:\n+ if \"changes\" in attributes and attributes[ \"changes\" ] is not None: # pragma no branch\n self.__changes = attributes[ \"changes\" ]\n- if \"deletions\" in attributes and attributes[ \"deletions\" ] is not None:\n+ if \"deletions\" in attributes and attributes[ \"deletions\" ] is not None: # pragma no branch\n self.__deletions = attributes[ \"deletions\" ]\n- if \"filename\" in attributes and attributes[ \"filename\" ] is not None:\n+ if \"filename\" in attributes and attributes[ \"filename\" ] is not None: # pragma no branch\n self.__filename = attributes[ \"filename\" ]\n- if \"patch\" in attributes and attributes[ \"patch\" ] is not None:\n+ if \"patch\" in attributes and attributes[ \"patch\" ] is not None: # pragma no branch\n self.__patch = attributes[ \"patch\" ]\n- if \"raw_url\" in attributes and attributes[ \"raw_url\" ] is not None:\n+ if \"raw_url\" in attributes and attributes[ \"raw_url\" ] is not None: # pragma no branch\n self.__raw_url = attributes[ \"raw_url\" ]\n- if \"sha\" in attributes and attributes[ \"sha\" ] is not None:\n+ if \"sha\" in attributes and attributes[ \"sha\" ] is not None: # pragma no branch\n self.__sha = attributes[ \"sha\" ]\n- if \"status\" in attributes and attributes[ \"status\" ] is not None:\n+ if \"status\" in attributes and attributes[ \"status\" ] is not None: # pragma no branch\n self.__status = attributes[ \"status\" ]","status":"modified","deletions":9,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/PullRequestFile.py","changes":18,"additions":9,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/PullRequestFile.py","filename":"src/github/PullRequestFile.py"},{"patch":"@@ -905,96 +905,96 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"clone_url\", \"created_at\", \"description\", \"fork\", \"forks\", \"full_name\", \"git_url\", \"has_downloads\", \"has_issues\", \"has_wiki\", \"homepage\", \"html_url\", \"id\", \"language\", \"master_branch\", \"mirror_url\", \"name\", \"open_issues\", \"organization\", \"owner\", \"parent\", \"permissions\", \"private\", \"pushed_at\", \"size\", \"source\", \"ssh_url\", \"svn_url\", \"updated_at\", \"url\", \"watchers\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"clone_url\" in attributes and attributes[ \"clone_url\" ] is not None:\n+ if \"clone_url\" in attributes and attributes[ \"clone_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"clone_url\" ], ( str, unicode ) )\n self.__clone_url = attributes[ \"clone_url\" ]\n- if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None:\n+ if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"created_at\" ], ( str, unicode ) )\n self.__created_at = attributes[ \"created_at\" ]\n- if \"description\" in attributes and attributes[ \"description\" ] is not None:\n+ if \"description\" in attributes and attributes[ \"description\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"description\" ], ( str, unicode ) )\n self.__description = attributes[ \"description\" ]\n- if \"fork\" in attributes and attributes[ \"fork\" ] is not None:\n+ if \"fork\" in attributes and attributes[ \"fork\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"fork\" ], bool )\n self.__fork = attributes[ \"fork\" ]\n- if \"forks\" in attributes and attributes[ \"forks\" ] is not None:\n+ if \"forks\" in attributes and attributes[ \"forks\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"forks\" ], int )\n self.__forks = attributes[ \"forks\" ]\n- if \"full_name\" in attributes and attributes[ \"full_name\" ] is not None:\n+ if \"full_name\" in attributes and attributes[ \"full_name\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"full_name\" ], ( str, unicode ) )\n self.__full_name = attributes[ \"full_name\" ]\n- if \"git_url\" in attributes and attributes[ \"git_url\" ] is not None:\n+ if \"git_url\" in attributes and attributes[ \"git_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"git_url\" ], ( str, unicode ) )\n self.__git_url = attributes[ \"git_url\" ]\n- if \"has_downloads\" in attributes and attributes[ \"has_downloads\" ] is not None:\n+ if \"has_downloads\" in attributes and attributes[ \"has_downloads\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"has_downloads\" ], bool )\n self.__has_downloads = attributes[ \"has_downloads\" ]\n- if \"has_issues\" in attributes and attributes[ \"has_issues\" ] is not None:\n+ if \"has_issues\" in attributes and attributes[ \"has_issues\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"has_issues\" ], bool )\n self.__has_issues = attributes[ \"has_issues\" ]\n- if \"has_wiki\" in attributes and attributes[ \"has_wiki\" ] is not None:\n+ if \"has_wiki\" in attributes and attributes[ \"has_wiki\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"has_wiki\" ], bool )\n self.__has_wiki = attributes[ \"has_wiki\" ]\n- if \"homepage\" in attributes and attributes[ \"homepage\" ] is not None:\n+ if \"homepage\" in attributes and attributes[ \"homepage\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"homepage\" ], ( str, unicode ) )\n self.__homepage = attributes[ \"homepage\" ]\n- if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None:\n+ if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"html_url\" ], ( str, unicode ) )\n self.__html_url = attributes[ \"html_url\" ]\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"id\" ], int )\n self.__id = attributes[ \"id\" ]\n- if \"language\" in attributes and attributes[ \"language\" ] is not None:\n+ if \"language\" in attributes and attributes[ \"language\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"language\" ], ( str, unicode ) )\n self.__language = attributes[ \"language\" ]\n- if \"master_branch\" in attributes and attributes[ \"master_branch\" ] is not None:\n+ if \"master_branch\" in attributes and attributes[ \"master_branch\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"master_branch\" ], ( str, unicode ) )\n self.__master_branch = attributes[ \"master_branch\" ]\n- if \"mirror_url\" in attributes and attributes[ \"mirror_url\" ] is not None:\n+ if \"mirror_url\" in attributes and attributes[ \"mirror_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"mirror_url\" ], ( str, unicode ) )\n self.__mirror_url = attributes[ \"mirror_url\" ]\n- if \"name\" in attributes and attributes[ \"name\" ] is not None:\n+ if \"name\" in attributes and attributes[ \"name\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"name\" ], ( str, unicode ) )\n self.__name = attributes[ \"name\" ]\n- if \"open_issues\" in attributes and attributes[ \"open_issues\" ] is not None:\n+ if \"open_issues\" in attributes and attributes[ \"open_issues\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"open_issues\" ], int )\n self.__open_issues = attributes[ \"open_issues\" ]\n- if \"organization\" in attributes and attributes[ \"organization\" ] is not None:\n+ if \"organization\" in attributes and attributes[ \"organization\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"organization\" ], dict )\n self.__organization = Organization.Organization( self.__requester, attributes[ \"organization\" ], completion = LazyCompletion )\n- if \"owner\" in attributes and attributes[ \"owner\" ] is not None:\n+ if \"owner\" in attributes and attributes[ \"owner\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"owner\" ], dict )\n self.__owner = NamedUser.NamedUser( self.__requester, attributes[ \"owner\" ], completion = LazyCompletion )\n- if \"parent\" in attributes and attributes[ \"parent\" ] is not None:\n+ if \"parent\" in attributes and attributes[ \"parent\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"parent\" ], dict )\n self.__parent = Repository( self.__requester, attributes[ \"parent\" ], completion = LazyCompletion )\n- if \"permissions\" in attributes and attributes[ \"permissions\" ] is not None:\n+ if \"permissions\" in attributes and attributes[ \"permissions\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"permissions\" ], dict )\n self.__permissions = Permissions.Permissions( self.__requester, attributes[ \"permissions\" ], completion = LazyCompletion )\n- if \"private\" in attributes and attributes[ \"private\" ] is not None:\n+ if \"private\" in attributes and attributes[ \"private\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"private\" ], bool )\n self.__private = attributes[ \"private\" ]\n- if \"pushed_at\" in attributes and attributes[ \"pushed_at\" ] is not None:\n+ if \"pushed_at\" in attributes and attributes[ \"pushed_at\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"pushed_at\" ], ( str, unicode ) )\n self.__pushed_at = attributes[ \"pushed_at\" ]\n- if \"size\" in attributes and attributes[ \"size\" ] is not None:\n+ if \"size\" in attributes and attributes[ \"size\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"size\" ], int )\n self.__size = attributes[ \"size\" ]\n- if \"source\" in attributes and attributes[ \"source\" ] is not None:\n+ if \"source\" in attributes and attributes[ \"source\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"source\" ], dict )\n self.__source = Repository( self.__requester, attributes[ \"source\" ], completion = LazyCompletion )\n- if \"ssh_url\" in attributes and attributes[ \"ssh_url\" ] is not None:\n+ if \"ssh_url\" in attributes and attributes[ \"ssh_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"ssh_url\" ], ( str, unicode ) )\n self.__ssh_url = attributes[ \"ssh_url\" ]\n- if \"svn_url\" in attributes and attributes[ \"svn_url\" ] is not None:\n+ if \"svn_url\" in attributes and attributes[ \"svn_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"svn_url\" ], ( str, unicode ) )\n self.__svn_url = attributes[ \"svn_url\" ]\n- if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None:\n+ if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"updated_at\" ], ( str, unicode ) )\n self.__updated_at = attributes[ \"updated_at\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"url\" ], ( str, unicode ) )\n self.__url = attributes[ \"url\" ]\n- if \"watchers\" in attributes and attributes[ \"watchers\" ] is not None:\n+ if \"watchers\" in attributes and attributes[ \"watchers\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"watchers\" ], int )\n self.__watchers = attributes[ \"watchers\" ]","status":"modified","deletions":31,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Repository.py","changes":62,"additions":31,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Repository.py","filename":"src/github/Repository.py"},{"patch":"@@ -87,14 +87,14 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"id\", \"key\", \"title\", \"url\", \"verified\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n self.__id = attributes[ \"id\" ]\n- if \"key\" in attributes and attributes[ \"key\" ] is not None:\n+ if \"key\" in attributes and attributes[ \"key\" ] is not None: # pragma no branch\n self.__key = attributes[ \"key\" ]\n- if \"title\" in attributes and attributes[ \"title\" ] is not None:\n+ if \"title\" in attributes and attributes[ \"title\" ] is not None: # pragma no branch\n self.__title = attributes[ \"title\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n self.__url = attributes[ \"url\" ]\n- if \"verified\" in attributes and attributes[ \"verified\" ] is not None:\n+ if \"verified\" in attributes and attributes[ \"verified\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"verified\" ], bool )\n self.__verified = attributes[ \"verified\" ]","status":"modified","deletions":5,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/RepositoryKey.py","changes":10,"additions":5,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/RepositoryKey.py","filename":"src/github/RepositoryKey.py"},{"patch":"@@ -38,15 +38,15 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"commit\", \"name\", \"tarball_url\", \"zipball_url\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"commit\" in attributes and attributes[ \"commit\" ] is not None:\n+ if \"commit\" in attributes and attributes[ \"commit\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"commit\" ], dict )\n self.__commit = Commit.Commit( self.__requester, attributes[ \"commit\" ], completion = LazyCompletion )\n- if \"name\" in attributes and attributes[ \"name\" ] is not None:\n+ if \"name\" in attributes and attributes[ \"name\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"name\" ], ( str, unicode ) )\n self.__name = attributes[ \"name\" ]\n- if \"tarball_url\" in attributes and attributes[ \"tarball_url\" ] is not None:\n+ if \"tarball_url\" in attributes and attributes[ \"tarball_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"tarball_url\" ], ( str, unicode ) )\n self.__tarball_url = attributes[ \"tarball_url\" ]\n- if \"zipball_url\" in attributes and attributes[ \"zipball_url\" ] is not None:\n+ if \"zipball_url\" in attributes and attributes[ \"zipball_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"zipball_url\" ], ( str, unicode ) )\n self.__zipball_url = attributes[ \"zipball_url\" ]","status":"modified","deletions":4,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Tag.py","changes":8,"additions":4,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Tag.py","filename":"src/github/Tag.py"},{"patch":"@@ -172,15 +172,15 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"id\", \"members_count\", \"name\", \"permission\", \"repos_count\", \"url\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n self.__id = attributes[ \"id\" ]\n- if \"members_count\" in attributes and attributes[ \"members_count\" ] is not None:\n+ if \"members_count\" in attributes and attributes[ \"members_count\" ] is not None: # pragma no branch\n self.__members_count = attributes[ \"members_count\" ]\n- if \"name\" in attributes and attributes[ \"name\" ] is not None:\n+ if \"name\" in attributes and attributes[ \"name\" ] is not None: # pragma no branch\n self.__name = attributes[ \"name\" ]\n- if \"permission\" in attributes and attributes[ \"permission\" ] is not None:\n+ if \"permission\" in attributes and attributes[ \"permission\" ] is not None: # pragma no branch\n self.__permission = attributes[ \"permission\" ]\n- if \"repos_count\" in attributes and attributes[ \"repos_count\" ] is not None:\n+ if \"repos_count\" in attributes and attributes[ \"repos_count\" ] is not None: # pragma no branch\n self.__repos_count = attributes[ \"repos_count\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n self.__url = attributes[ \"url\" ]","status":"modified","deletions":6,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Team.py","changes":12,"additions":6,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Team.py","filename":"src/github/Team.py"},{"patch":"@@ -87,14 +87,14 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"id\", \"key\", \"title\", \"url\", \"verified\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n self.__id = attributes[ \"id\" ]\n- if \"key\" in attributes and attributes[ \"key\" ] is not None:\n+ if \"key\" in attributes and attributes[ \"key\" ] is not None: # pragma no branch\n self.__key = attributes[ \"key\" ]\n- if \"title\" in attributes and attributes[ \"title\" ] is not None:\n+ if \"title\" in attributes and attributes[ \"title\" ] is not None: # pragma no branch\n self.__title = attributes[ \"title\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n self.__url = attributes[ \"url\" ]\n- if \"verified\" in attributes and attributes[ \"verified\" ] is not None:\n+ if \"verified\" in attributes and attributes[ \"verified\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"verified\" ], bool )\n self.__verified = attributes[ \"verified\" ]","status":"modified","deletions":5,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/UserKey.py","changes":10,"additions":5,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/UserKey.py","filename":"src/github/UserKey.py"},{"patch":"@@ -3,7 +3,8 @@\n class Issue( Framework.TestCase ):\r\n def setUp( self ):\r\n Framework.TestCase.setUp( self )\r\n- self.issue = self.g.get_user().get_repo( \"PyGithub\" ).get_issue( 28 )\r\n+ self.repo = self.g.get_user().get_repo( \"PyGithub\" )\r\n+ self.issue = self.repo.get_issue( 28 )\r\n \r\n def testAttributes( self ):\r\n self.assertEqual( self.issue.assignee.login, \"jacquev6\" )\r\n@@ -47,3 +48,26 @@ def testGetComments( self ):\n \r\n def testGetEvents( self ):\r\n self.assertListKeyEqual( self.issue.get_events(), lambda e: e.id, [ 15819975, 15820048 ] )\r\n+\r\n+ def testGetLabels( self ):\r\n+ self.assertListKeyEqual( self.issue.get_labels(), lambda l: l.name, [ \"Bug\", \"Project management\", \"Question\" ] )\r\n+\r\n+ def testAddAndRemoveLabels( self ):\r\n+ bug = self.repo.get_label( \"Bug\" )\r\n+ question = self.repo.get_label( \"Question\" )\r\n+ self.assertListKeyEqual( self.issue.get_labels(), lambda l: l.name, [ \"Bug\", \"Project management\", \"Question\" ] )\r\n+ self.issue.remove_from_labels( bug )\r\n+ self.assertListKeyEqual( self.issue.get_labels(), lambda l: l.name, [ \"Project management\", \"Question\" ] )\r\n+ self.issue.remove_from_labels( question )\r\n+ self.assertListKeyEqual( self.issue.get_labels(), lambda l: l.name, [ \"Project management\" ] )\r\n+ self.issue.add_to_labels( bug, question )\r\n+ self.assertListKeyEqual( self.issue.get_labels(), lambda l: l.name, [ \"Bug\", \"Project management\", \"Question\" ] )\r\n+\r\n+ def testDeleteAndSetLabels( self ):\r\n+ bug = self.repo.get_label( \"Bug\" )\r\n+ question = self.repo.get_label( \"Question\" )\r\n+ self.assertListKeyEqual( self.issue.get_labels(), lambda l: l.name, [ \"Bug\", \"Project management\", \"Question\" ] )\r\n+ self.issue.delete_labels()\r\n+ self.assertListKeyEqual( self.issue.get_labels(), lambda l: l.name, [] )\r\n+ self.issue.set_labels( bug, question )\r\n+ self.assertListKeyEqual( self.issue.get_labels(), lambda l: l.name, [ \"Bug\", \"Question\" ] )\r","status":"modified","deletions":1,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/test/Issue.py","changes":26,"additions":25,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/test/Issue.py","filename":"test/Issue.py"},{"patch":"@@ -3,13 +3,13 @@\n class IssueEvent( Framework.TestCase ):\r\n def setUp( self ):\r\n Framework.TestCase.setUp( self )\r\n- self.event = self.g.get_user().get_repo( \"PyGithub\" ).get_issues_event( 15819975 )\r\n+ self.event = self.g.get_user().get_repo( \"PyGithub\" ).get_issues_event( 16348656 )\r\n \r\n def testAttributes( self ):\r\n self.assertEqual( self.event.actor.login, \"jacquev6\" )\r\n- self.assertEqual( self.event.commit_id, None )\r\n- self.assertEqual( self.event.created_at, \"2012-05-19T10:38:23Z\" )\r\n- self.assertEqual( self.event.event, \"subscribed\" )\r\n- self.assertEqual( self.event.id, 15819975 )\r\n- self.assertEqual( self.event.issue.number, 28 )\r\n- self.assertEqual( self.event.url, \"https://api.github.com/repos/jacquev6/PyGithub/issues/events/15819975\" )\r\n+ self.assertEqual( self.event.commit_id, \"ed866fc43833802ab553e5ff8581c81bb00dd433\" )\r\n+ self.assertEqual( self.event.created_at, \"2012-05-27T07:29:25Z\" )\r\n+ self.assertEqual( self.event.event, \"referenced\" )\r\n+ self.assertEqual( self.event.id, 16348656 )\r\n+ self.assertEqual( self.event.issue.number, 30 )\r\n+ self.assertEqual( self.event.url, \"https://api.github.com/repos/jacquev6/PyGithub/issues/events/16348656\" )\r","status":"modified","deletions":7,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/test/IssueEvent.py","changes":14,"additions":7,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/test/IssueEvent.py","filename":"test/IssueEvent.py"},{"patch":"@@ -0,0 +1,45 @@\n+GET /repos/jacquev6/PyGithub/labels/Bug {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4992'), ('content-length', '97'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"569c414d87e8ec43ec269a9e28bc2982\"'), ('date', 'Sun, 27 May 2012 09:04:01 GMT'), ('content-type', 'application/json; charset=utf-8')]\n+{\"color\":\"e10c02\",\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug\",\"name\":\"Bug\"}\n+\n+GET /repos/jacquev6/PyGithub/labels/Question {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4991'), ('content-length', '107'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"b659c8dcc1212c71f826547c3cc7ae99\"'), ('date', 'Sun, 27 May 2012 09:04:02 GMT'), ('content-type', 'application/json; charset=utf-8')]\n+{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\",\"color\":\"02e10c\"}\n+\n+GET /repos/jacquev6/PyGithub/issues/28/labels {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4990'), ('content-length', '335'), ('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')]\n+[{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug\",\"name\":\"Bug\",\"color\":\"e10c02\"},{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Project+management\",\"name\":\"Project management\",\"color\":\"444444\"},{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\",\"color\":\"02e10c\"}]\n+\n+DELETE /repos/jacquev6/PyGithub/issues/28/labels/Bug {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4989'), ('content-length', '237'), ('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')]\n+[{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Project+management\",\"name\":\"Project management\",\"color\":\"444444\"},{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\",\"color\":\"02e10c\"}]\n+\n+GET /repos/jacquev6/PyGithub/issues/28/labels {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4988'), ('content-length', '237'), ('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')]\n+[{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Project+management\",\"name\":\"Project management\",\"color\":\"444444\"},{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\",\"color\":\"02e10c\"}]\n+\n+DELETE /repos/jacquev6/PyGithub/issues/28/labels/Question {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4987'), ('content-length', '129'), ('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')]\n+[{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Project+management\",\"name\":\"Project management\",\"color\":\"444444\"}]\n+\n+GET /repos/jacquev6/PyGithub/issues/28/labels {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4986'), ('content-length', '129'), ('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')]\n+[{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Project+management\",\"name\":\"Project management\",\"color\":\"444444\"}]\n+\n+POST /repos/jacquev6/PyGithub/issues/28/labels {'Authorization': 'Basic login_and_password_removed'} [\"Bug\", \"Question\"]\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4985'), ('content-length', '335'), ('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')]\n+[{\"color\":\"e10c02\",\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug\",\"name\":\"Bug\"},{\"color\":\"444444\",\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Project+management\",\"name\":\"Project management\"},{\"color\":\"02e10c\",\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\"}]\n+\n+GET /repos/jacquev6/PyGithub/issues/28/labels {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4984'), ('content-length', '335'), ('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')]\n+[{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug\",\"name\":\"Bug\",\"color\":\"e10c02\"},{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Project+management\",\"name\":\"Project management\",\"color\":\"444444\"},{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\",\"color\":\"02e10c\"}]\n+","status":"added","deletions":0,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/test/ReplayData/Issue.testAddAndRemoveLabels.txt","changes":45,"additions":45,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/test/ReplayData/Issue.testAddAndRemoveLabels.txt","filename":"test/ReplayData/Issue.testAddAndRemoveLabels.txt"},{"patch":"@@ -0,0 +1,35 @@\n+GET /repos/jacquev6/PyGithub/labels/Bug {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4974'), ('content-length', '97'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"fe2e942523eecb156d100829a6347516\"'), ('date', 'Sun, 27 May 2012 09:06:37 GMT'), ('content-type', 'application/json; charset=utf-8')]\n+{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug\",\"name\":\"Bug\",\"color\":\"e10c02\"}\n+\n+GET /repos/jacquev6/PyGithub/labels/Question {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4973'), ('content-length', '107'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"931e58d337b2290717303141eda89cd7\"'), ('date', 'Sun, 27 May 2012 09:06:38 GMT'), ('content-type', 'application/json; charset=utf-8')]\n+{\"color\":\"02e10c\",\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\"}\n+\n+GET /repos/jacquev6/PyGithub/issues/28/labels {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4972'), ('content-length', '335'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"d135d74d2ea2159d044676a220d41d3a\"'), ('date', 'Sun, 27 May 2012 09:06:39 GMT'), ('content-type', 'application/json; charset=utf-8')]\n+[{\"color\":\"e10c02\",\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug\",\"name\":\"Bug\"},{\"color\":\"444444\",\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Project+management\",\"name\":\"Project management\"},{\"color\":\"02e10c\",\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\"}]\n+\n+DELETE /repos/jacquev6/PyGithub/issues/28/labels {'Authorization': 'Basic login_and_password_removed'} null\n+204\n+[('status', '204 No Content'), ('x-ratelimit-remaining', '4971'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"d41d8cd98f00b204e9800998ecf8427e\"'), ('date', 'Sun, 27 May 2012 09:06:39 GMT')]\n+\n+\n+GET /repos/jacquev6/PyGithub/issues/28/labels {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4970'), ('content-length', '2'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"d751713988987e9331980363e24189ce\"'), ('date', 'Sun, 27 May 2012 09:06:40 GMT'), ('content-type', 'application/json; charset=utf-8')]\n+[]\n+\n+PUT /repos/jacquev6/PyGithub/issues/28/labels {'Authorization': 'Basic login_and_password_removed'} [\"Bug\", \"Question\"]\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4969'), ('content-length', '207'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"1a56634d9c1050a88592ff55ed8adc62\"'), ('date', 'Sun, 27 May 2012 09:06:40 GMT'), ('content-type', 'application/json; charset=utf-8')]\n+[{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug\",\"name\":\"Bug\",\"color\":\"e10c02\"},{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\",\"color\":\"02e10c\"}]\n+\n+GET /repos/jacquev6/PyGithub/issues/28/labels {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4968'), ('content-length', '207'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"1a56634d9c1050a88592ff55ed8adc62\"'), ('date', 'Sun, 27 May 2012 09:06:41 GMT'), ('content-type', 'application/json; charset=utf-8')]\n+[{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug\",\"name\":\"Bug\",\"color\":\"e10c02\"},{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\",\"color\":\"02e10c\"}]\n+","status":"added","deletions":0,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/test/ReplayData/Issue.testDeleteAndSetLabels.txt","changes":35,"additions":35,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/test/ReplayData/Issue.testDeleteAndSetLabels.txt","filename":"test/ReplayData/Issue.testDeleteAndSetLabels.txt"},{"patch":"@@ -0,0 +1,5 @@\n+GET /repos/jacquev6/PyGithub/issues/28/labels {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4996'), ('content-length', '335'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"c9f9beccb03030beaf7b80927da6fef6\"'), ('date', 'Sun, 27 May 2012 08:56:31 GMT'), ('content-type', 'application/json; charset=utf-8')]\n+[{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug\",\"name\":\"Bug\",\"color\":\"e10c02\"},{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Project+management\",\"name\":\"Project management\",\"color\":\"444444\"},{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\",\"color\":\"02e10c\"}]\n+","status":"added","deletions":0,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/test/ReplayData/Issue.testGetLabels.txt","changes":5,"additions":5,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/test/ReplayData/Issue.testGetLabels.txt","filename":"test/ReplayData/Issue.testGetLabels.txt"},{"patch":"@@ -1,15 +1,15 @@\n GET /user {'Authorization': 'Basic login_and_password_removed'} null\n 200\n-[('status', '200 OK'), ('x-ratelimit-remaining', '4907'), ('content-length', '801'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"99c9bfb75395b749e9913a4729126fb5\"'), ('date', 'Sun, 27 May 2012 07:19:30 GMT'), ('content-type', 'application/json; charset=utf-8')]\n-{\"private_gists\":5,\"type\":\"User\",\"company\":\"Criteo\",\"location\":\"Paris, France\",\"hireable\":false,\"gravatar_id\":\"b68de5ae38616c296fa345d2b9df2225\",\"bio\":\"\",\"following\":24,\"blog\":\"http://vincent-jacques.net\",\"avatar_url\":\"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png\",\"total_private_repos\":5,\"followers\":13,\"owned_private_repos\":5,\"disk_usage\":16976,\"collaborators\":0,\"html_url\":\"https://github.com/jacquev6\",\"url\":\"https://api.github.com/users/jacquev6\",\"name\":\"Vincent Jacques\",\"login\":\"jacquev6\",\"public_repos\":11,\"public_gists\":3,\"email\":\"vincent@vincent-jacques.net\",\"id\":327146,\"plan\":{\"private_repos\":5,\"collaborators\":1,\"name\":\"micro\",\"space\":614400},\"created_at\":\"2010-07-09T06:10:06Z\"}\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4996'), ('content-length', '801'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"8974bb1628a3e3a6d3eb3b08c1b5a46b\"'), ('date', 'Sun, 27 May 2012 07:32:54 GMT'), ('content-type', 'application/json; charset=utf-8')]\n+{\"type\":\"User\",\"bio\":\"\",\"disk_usage\":16976,\"total_private_repos\":5,\"url\":\"https://api.github.com/users/jacquev6\",\"avatar_url\":\"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png\",\"owned_private_repos\":5,\"collaborators\":0,\"plan\":{\"collaborators\":1,\"private_repos\":5,\"name\":\"micro\",\"space\":614400},\"company\":\"Criteo\",\"gravatar_id\":\"b68de5ae38616c296fa345d2b9df2225\",\"login\":\"jacquev6\",\"email\":\"vincent@vincent-jacques.net\",\"public_gists\":3,\"followers\":13,\"name\":\"Vincent Jacques\",\"created_at\":\"2010-07-09T06:10:06Z\",\"blog\":\"http://vincent-jacques.net\",\"location\":\"Paris, France\",\"hireable\":false,\"id\":327146,\"private_gists\":5,\"public_repos\":11,\"following\":24,\"html_url\":\"https://github.com/jacquev6\"}\n \n GET /repos/jacquev6/PyGithub {'Authorization': 'Basic login_and_password_removed'} null\n 200\n-[('status', '200 OK'), ('x-ratelimit-remaining', '4906'), ('content-length', '1129'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"4c20acf0b23f75bbf25106b1a04f65a5\"'), ('date', 'Sun, 27 May 2012 07:19:31 GMT'), ('content-type', 'application/json; charset=utf-8')]\n-{\"description\":\"Python library implementing the full Github API v3\",\"full_name\":\"jacquev6/PyGithub\",\"has_wiki\":false,\"has_issues\":true,\"updated_at\":\"2012-05-27T06:55:28Z\",\"forks\":3,\"mirror_url\":null,\"homepage\":\"http://vincent-jacques.net/PyGithub\",\"ssh_url\":\"git@github.com:jacquev6/PyGithub.git\",\"open_issues\":16,\"fork\":false,\"svn_url\":\"https://github.com/jacquev6/PyGithub\",\"pushed_at\":\"2012-05-27T06:00:28Z\",\"size\":308,\"html_url\":\"https://github.com/jacquev6/PyGithub\",\"private\":false,\"url\":\"https://api.github.com/repos/jacquev6/PyGithub\",\"clone_url\":\"https://github.com/jacquev6/PyGithub.git\",\"owner\":{\"gravatar_id\":\"b68de5ae38616c296fa345d2b9df2225\",\"avatar_url\":\"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png\",\"url\":\"https://api.github.com/users/jacquev6\",\"login\":\"jacquev6\",\"id\":327146},\"name\":\"PyGithub\",\"has_downloads\":true,\"language\":\"Python\",\"watchers\":15,\"git_url\":\"git://github.com/jacquev6/PyGithub.git\",\"id\":3544490,\"permissions\":{\"admin\":true,\"pull\":true,\"push\":true},\"created_at\":\"2012-02-25T12:53:47Z\"}\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4995'), ('content-length', '1129'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"f1e4eb3993a364b66b68ec9db42405bd\"'), ('date', 'Sun, 27 May 2012 07:32:55 GMT'), ('content-type', 'application/json; charset=utf-8')]\n+{\"clone_url\":\"https://github.com/jacquev6/PyGithub.git\",\"has_downloads\":true,\"watchers\":15,\"updated_at\":\"2012-05-27T07:29:24Z\",\"permissions\":{\"pull\":true,\"admin\":true,\"push\":true},\"homepage\":\"http://vincent-jacques.net/PyGithub\",\"url\":\"https://api.github.com/repos/jacquev6/PyGithub\",\"mirror_url\":null,\"has_wiki\":false,\"has_issues\":true,\"fork\":false,\"forks\":3,\"git_url\":\"git://github.com/jacquev6/PyGithub.git\",\"size\":308,\"private\":false,\"open_issues\":16,\"svn_url\":\"https://github.com/jacquev6/PyGithub\",\"owner\":{\"url\":\"https://api.github.com/users/jacquev6\",\"avatar_url\":\"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png\",\"gravatar_id\":\"b68de5ae38616c296fa345d2b9df2225\",\"login\":\"jacquev6\",\"id\":327146},\"name\":\"PyGithub\",\"language\":\"Python\",\"description\":\"Python library implementing the full Github API v3\",\"ssh_url\":\"git@github.com:jacquev6/PyGithub.git\",\"pushed_at\":\"2012-05-27T07:29:24Z\",\"created_at\":\"2012-02-25T12:53:47Z\",\"id\":3544490,\"html_url\":\"https://github.com/jacquev6/PyGithub\",\"full_name\":\"jacquev6/PyGithub\"}\n \n-GET /repos/jacquev6/PyGithub/issues/events/15819975 {'Authorization': 'Basic login_and_password_removed'} null\n+GET /repos/jacquev6/PyGithub/issues/events/16348656 {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} null\n 200\n-[('status', '200 OK'), ('x-ratelimit-remaining', '4905'), ('content-length', '2430'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"a3d244842d23f92f69a23e21626fad11\"'), ('date', 'Sun, 27 May 2012 07:19:31 GMT'), ('content-type', 'application/json; charset=utf-8')]\n-{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/issues/events/15819975\",\"issue\":{\"updated_at\":\"2012-05-26T14:59:33Z\",\"body\":\"Body edited by PyGithub\",\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/issues/28\",\"comments\":0,\"milestone\":{\"creator\":{\"url\":\"https://api.github.com/users/jacquev6\",\"avatar_url\":\"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png\",\"gravatar_id\":\"b68de5ae38616c296fa345d2b9df2225\",\"login\":\"jacquev6\",\"id\":327146},\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/milestones/1\",\"number\":1,\"title\":\"Version 0.4\",\"due_on\":\"2012-03-13T07:00:00Z\",\"closed_issues\":3,\"open_issues\":0,\"created_at\":\"2012-03-08T12:22:10Z\",\"state\":\"closed\",\"description\":\"\",\"id\":93546},\"number\":28,\"assignee\":{\"url\":\"https://api.github.com/users/jacquev6\",\"avatar_url\":\"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png\",\"gravatar_id\":\"b68de5ae38616c296fa345d2b9df2225\",\"login\":\"jacquev6\",\"id\":327146},\"closed_at\":\"2012-05-26T14:59:33Z\",\"title\":\"Issue created by PyGithub\",\"labels\":[{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug\",\"name\":\"Bug\",\"color\":\"e10c02\"},{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Project+management\",\"name\":\"Project management\",\"color\":\"444444\"},{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\",\"color\":\"02e10c\"}],\"created_at\":\"2012-05-19T10:38:23Z\",\"state\":\"closed\",\"user\":{\"url\":\"https://api.github.com/users/jacquev6\",\"avatar_url\":\"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png\",\"gravatar_id\":\"b68de5ae38616c296fa345d2b9df2225\",\"login\":\"jacquev6\",\"id\":327146},\"id\":4653757,\"pull_request\":{\"diff_url\":null,\"patch_url\":null,\"html_url\":null},\"html_url\":\"https://github.com/jacquev6/PyGithub/issues/28\"},\"commit_id\":null,\"created_at\":\"2012-05-19T10:38:23Z\",\"event\":\"subscribed\",\"id\":15819975,\"actor\":{\"url\":\"https://api.github.com/users/jacquev6\",\"avatar_url\":\"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png\",\"gravatar_id\":\"b68de5ae38616c296fa345d2b9df2225\",\"login\":\"jacquev6\",\"id\":327146}}\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4994'), ('content-length', '1384'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"fefecab09e7355d4ef9875677c2631da\"'), ('date', 'Sun, 27 May 2012 07:32:56 GMT'), ('content-type', 'application/json; charset=utf-8')]\n+{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/issues/events/16348656\",\"issue\":{\"updated_at\":\"2012-05-27T07:27:51Z\",\"body\":\"Body created by PyGithub\",\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/issues/30\",\"comments\":0,\"milestone\":null,\"number\":30,\"assignee\":null,\"closed_at\":null,\"title\":\"Issue also created by PyGithub\",\"labels\":[{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\",\"color\":\"02e10c\"}],\"created_at\":\"2012-05-27T05:40:15Z\",\"state\":\"open\",\"user\":{\"url\":\"https://api.github.com/users/jacquev6\",\"gravatar_id\":\"b68de5ae38616c296fa345d2b9df2225\",\"login\":\"jacquev6\",\"id\":327146,\"avatar_url\":\"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png\"},\"id\":4769659,\"pull_request\":{\"patch_url\":null,\"diff_url\":null,\"html_url\":null},\"html_url\":\"https://github.com/jacquev6/PyGithub/issues/30\"},\"commit_id\":\"ed866fc43833802ab553e5ff8581c81bb00dd433\",\"created_at\":\"2012-05-27T07:29:25Z\",\"event\":\"referenced\",\"id\":16348656,\"actor\":{\"url\":\"https://api.github.com/users/jacquev6\",\"gravatar_id\":\"b68de5ae38616c296fa345d2b9df2225\",\"login\":\"jacquev6\",\"id\":327146,\"avatar_url\":\"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png\"}}\n ","status":"modified","deletions":7,"blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/test/ReplayData/IssueEvent.setUp.txt","changes":14,"additions":7,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/test/ReplayData/IssueEvent.setUp.txt","filename":"test/ReplayData/IssueEvent.setUp.txt"}] diff --git a/github/tests/ReplayData/PullRequest.testMerge.txt b/github/tests/ReplayData/PullRequest.testMerge.txt index dee93db3..1d093698 100644 --- a/github/tests/ReplayData/PullRequest.testMerge.txt +++ b/github/tests/ReplayData/PullRequest.testMerge.txt @@ -3,7 +3,7 @@ https GET api.github.com None /repos/jacquev6/PyGithub/pulls/31/merge {'Authoriz [('status', '404 Not Found'), ('x-ratelimit-remaining', '4953'), ('content-length', '23'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"e66a7a6c91e2c26803f3f49feb7a883f"'), ('date', 'Sun, 27 May 2012 10:29:06 GMT'), ('content-type', 'application/json; charset=utf-8')] {"message":"Not Found"} -https PUT api.github.com None /repos/jacquev6/PyGithub/pulls/31/merge {'Authorization': 'Basic login_and_password_removed'} {} +https PUT api.github.com None /repos/jacquev6/PyGithub/pulls/31/merge {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {} 200 [('status', '200 OK'), ('x-ratelimit-remaining', '4952'), ('content-length', '109'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"2cf4589169510ce73907214b7327fe5a"'), ('date', 'Sun, 27 May 2012 10:29:07 GMT'), ('content-type', 'application/json; charset=utf-8')] {"merged":true,"message":"Pull Request successfully merged","sha":"688208b1a5a074871d0e9376119556897439697d"} diff --git a/github/tests/ReplayData/PullRequest.testMergeWithCommitMessage.txt b/github/tests/ReplayData/PullRequest.testMergeWithCommitMessage.txt index c60f403f..7087fa88 100644 --- a/github/tests/ReplayData/PullRequest.testMergeWithCommitMessage.txt +++ b/github/tests/ReplayData/PullRequest.testMergeWithCommitMessage.txt @@ -13,7 +13,7 @@ https GET api.github.com None /repos/jacquev6/PyGithub/pulls/39 {'Authorization' [('status', '200 OK'), ('x-ratelimit-remaining', '4990'), ('content-length', '4494'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"716935e701e066a56718d7a8b2f409f8"'), ('date', 'Tue, 29 May 2012 18:07:53 GMT'), ('content-type', 'application/json; charset=utf-8')] {"merged":false,"diff_url":"https://github.com/jacquev6/PyGithub/pull/39.diff","head":{"ref":"master","label":"BeaverSoftware:master","repo":{"clone_url":"https://github.com/BeaverSoftware/PyGithub.git","has_downloads":true,"watchers":1,"updated_at":"2012-05-29T18:05:10Z","homepage":"http://vincent-jacques.net/PyGithub","url":"https://api.github.com/repos/BeaverSoftware/PyGithub","git_url":"git://github.com/BeaverSoftware/PyGithub.git","html_url":"https://github.com/BeaverSoftware/PyGithub","has_wiki":false,"has_issues":false,"fork":true,"forks":0,"mirror_url":null,"size":428,"private":false,"open_issues":0,"svn_url":"https://github.com/BeaverSoftware/PyGithub","owner":{"url":"https://api.github.com/users/BeaverSoftware","avatar_url":"https://secure.gravatar.com/avatar/d563e337cac2fdc644e2aaaad1e23266?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png","gravatar_id":"d563e337cac2fdc644e2aaaad1e23266","login":"BeaverSoftware","id":1424031},"name":"PyGithub","language":"Python","description":"Python library implementing the full Github API v3","ssh_url":"git@github.com:BeaverSoftware/PyGithub.git","pushed_at":"2012-05-29T18:05:10Z","created_at":"2012-05-29T18:03:19Z","id":4485562,"full_name":"BeaverSoftware/PyGithub"},"user":{"url":"https://api.github.com/users/BeaverSoftware","avatar_url":"https://secure.gravatar.com/avatar/d563e337cac2fdc644e2aaaad1e23266?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png","gravatar_id":"d563e337cac2fdc644e2aaaad1e23266","login":"BeaverSoftware","id":1424031},"sha":"ca6e7ef9ce22dc01290bb59507f24cc17f42daa4"},"updated_at":"2012-05-29T18:06:07Z","issue_url":"https://github.com/jacquev6/PyGithub/issues/39","_links":{"self":{"href":"https://api.github.com/repos/jacquev6/PyGithub/pulls/39"},"review_comments":{"href":"https://api.github.com/repos/jacquev6/PyGithub/pulls/39/comments"},"comments":{"href":"https://api.github.com/repos/jacquev6/PyGithub/issues/39/comments"},"issue":{"href":"https://api.github.com/repos/jacquev6/PyGithub/issues/39"},"html":{"href":"https://github.com/jacquev6/PyGithub/pull/39"}},"body":"","url":"https://api.github.com/repos/jacquev6/PyGithub/pulls/39","comments":0,"review_comments":0,"changed_files":15,"base":{"ref":"topic/RewriteWithGeneratedCode","label":"jacquev6:topic/RewriteWithGeneratedCode","repo":{"clone_url":"https://github.com/jacquev6/PyGithub.git","has_downloads":true,"watchers":17,"updated_at":"2012-05-29T18:04:08Z","homepage":"http://vincent-jacques.net/PyGithub","url":"https://api.github.com/repos/jacquev6/PyGithub","git_url":"git://github.com/jacquev6/PyGithub.git","html_url":"https://github.com/jacquev6/PyGithub","has_wiki":false,"has_issues":true,"fork":false,"forks":3,"mirror_url":null,"size":480,"private":false,"open_issues":15,"svn_url":"https://github.com/jacquev6/PyGithub","owner":{"url":"https://api.github.com/users/jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146},"name":"PyGithub","language":"Python","description":"Python library implementing the full Github API v3","ssh_url":"git@github.com:jacquev6/PyGithub.git","pushed_at":"2012-05-29T18:04:07Z","created_at":"2012-02-25T12:53:47Z","id":3544490,"full_name":"jacquev6/PyGithub"},"user":{"url":"https://api.github.com/users/jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146},"sha":"d57aea6a898050115a089e6f86c5314d7daf97e8"},"number":39,"html_url":"https://github.com/jacquev6/PyGithub/pull/39","patch_url":"https://github.com/jacquev6/PyGithub/pull/39.patch","mergeable":true,"title":"Pull request to be merged by PyGithub with a custom commit message","deletions":31,"merged_by":null,"additions":95,"closed_at":null,"created_at":"2012-05-29T18:06:07Z","user":{"url":"https://api.github.com/users/jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146},"state":"open","id":1448168,"commits":2,"merged_at":null} -https PUT api.github.com None /repos/jacquev6/PyGithub/pulls/39/merge {'Authorization': 'Basic login_and_password_removed'} {"commit_message": "Custom commit message created by PyGithub"} +https PUT api.github.com None /repos/jacquev6/PyGithub/pulls/39/merge {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"commit_message": "Custom commit message created by PyGithub"} 200 [('status', '200 OK'), ('x-ratelimit-remaining', '4989'), ('content-length', '109'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"378c85a4f6b6694e0f7686effbc2c29f"'), ('date', 'Tue, 29 May 2012 18:07:54 GMT'), ('content-type', 'application/json; charset=utf-8')] {"merged":true,"message":"Pull Request successfully merged","sha":"2525d86ae3bf7d26003e2a6d5226a8d870499792"} diff --git a/github/tests/ReplayData/PullRequestComment.testEdit.txt b/github/tests/ReplayData/PullRequestComment.testEdit.txt index 25ae20ff..d1b2cae8 100644 --- a/github/tests/ReplayData/PullRequestComment.testEdit.txt +++ b/github/tests/ReplayData/PullRequestComment.testEdit.txt @@ -1,4 +1,4 @@ -https PATCH api.github.com None /repos/jacquev6/PyGithub/pulls/comments/886298 {'Authorization': 'Basic login_and_password_removed'} {"body": "Comment edited by PyGithub"} +https PATCH api.github.com None /repos/jacquev6/PyGithub/pulls/comments/886298 {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"body": "Comment edited by PyGithub"} 200 [('status', '200 OK'), ('x-ratelimit-remaining', '4991'), ('content-length', '936'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"e8c290c08cd5ed76a92529759e9148bc"'), ('date', 'Sun, 27 May 2012 10:09:07 GMT'), ('content-type', 'application/json; charset=utf-8')] {"updated_at":"2012-05-27T10:09:07Z","position":5,"_links":{"self":{"href":"https://api.github.com/repos/jacquev6/PyGithub/pulls/comments/886298"},"html":{"href":"https://github.com/jacquev6/PyGithub/pull/31#r886298"},"pull_request":{"href":"https://api.github.com/repos/jacquev6/PyGithub/pulls/31"}},"original_position":5,"body":"Comment edited by PyGithub","url":"https://api.github.com/repos/jacquev6/PyGithub/pulls/comments/886298","commit_id":"8a4f306d4b223682dd19410d4a9150636ebe4206","created_at":"2012-05-27T09:40:12Z","user":{"url":"https://api.github.com/users/jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146},"original_commit_id":"8a4f306d4b223682dd19410d4a9150636ebe4206","path":"src/github/Issue.py","id":886298} diff --git a/github/tests/ReplayData/PullRequestFile.setUp.txt b/github/tests/ReplayData/PullRequestFile.setUp.txt index a632c90c..80944b6f 100644 --- a/github/tests/ReplayData/PullRequestFile.setUp.txt +++ b/github/tests/ReplayData/PullRequestFile.setUp.txt @@ -16,5 +16,5 @@ https GET api.github.com None /repos/jacquev6/PyGithub/pulls/31 {'Authorization' https GET api.github.com None /repos/jacquev6/PyGithub/pulls/31/files {'Authorization': 'Basic login_and_password_removed'} null 200 [('status', '200 OK'), ('x-ratelimit-remaining', '4941'), ('content-length', '169480'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"0eeb19c75ce5a922107d104ec2a5dd4e"'), ('date', 'Sun, 27 May 2012 10:47:16 GMT'), ('content-type', 'application/json; charset=utf-8')] -[{"status":"modified","changes":2,"deletions":1,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/codegen/templates/GithubObject.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/codegen/templates/GithubObject.py","filename":"codegen/templates/GithubObject.py","patch":"@@ -70,7 +70,7 @@ def __useAttributes( self, attributes ):\n \n # @toto No need to check if attribute is in attributes when attribute is mandatory\n {% for attribute in class.attributes|dictsort:\"name\" %}\n- if \"{{ attribute.name }}\" in attributes and attributes[ \"{{ attribute.name }}\" ] is not None:\n+ if \"{{ attribute.name }}\" in attributes and attributes[ \"{{ attribute.name }}\" ] is not None: # pragma no branch\n \n {% if attribute.type.cardinality == \"scalar\" %}\n {% if attribute.type.simple %}","additions":1,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":50,"deletions":25,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/AuthenticatedUser.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/AuthenticatedUser.py","filename":"src/github/AuthenticatedUser.py","patch":"@@ -568,78 +568,78 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"avatar_url\", \"bio\", \"blog\", \"collaborators\", \"company\", \"created_at\", \"disk_usage\", \"email\", \"followers\", \"following\", \"gravatar_id\", \"hireable\", \"html_url\", \"id\", \"location\", \"login\", \"name\", \"owned_private_repos\", \"plan\", \"private_gists\", \"public_gists\", \"public_repos\", \"total_private_repos\", \"type\", \"url\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"avatar_url\" in attributes and attributes[ \"avatar_url\" ] is not None:\n+ if \"avatar_url\" in attributes and attributes[ \"avatar_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"avatar_url\" ], ( str, unicode ) )\n self.__avatar_url = attributes[ \"avatar_url\" ]\n- if \"bio\" in attributes and attributes[ \"bio\" ] is not None:\n+ if \"bio\" in attributes and attributes[ \"bio\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"bio\" ], ( str, unicode ) )\n self.__bio = attributes[ \"bio\" ]\n- if \"blog\" in attributes and attributes[ \"blog\" ] is not None:\n+ if \"blog\" in attributes and attributes[ \"blog\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"blog\" ], ( str, unicode ) )\n self.__blog = attributes[ \"blog\" ]\n- if \"collaborators\" in attributes and attributes[ \"collaborators\" ] is not None:\n+ if \"collaborators\" in attributes and attributes[ \"collaborators\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"collaborators\" ], int )\n self.__collaborators = attributes[ \"collaborators\" ]\n- if \"company\" in attributes and attributes[ \"company\" ] is not None:\n+ if \"company\" in attributes and attributes[ \"company\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"company\" ], ( str, unicode ) )\n self.__company = attributes[ \"company\" ]\n- if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None:\n+ if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"created_at\" ], ( str, unicode ) )\n self.__created_at = attributes[ \"created_at\" ]\n- if \"disk_usage\" in attributes and attributes[ \"disk_usage\" ] is not None:\n+ if \"disk_usage\" in attributes and attributes[ \"disk_usage\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"disk_usage\" ], int )\n self.__disk_usage = attributes[ \"disk_usage\" ]\n- if \"email\" in attributes and attributes[ \"email\" ] is not None:\n+ if \"email\" in attributes and attributes[ \"email\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"email\" ], ( str, unicode ) )\n self.__email = attributes[ \"email\" ]\n- if \"followers\" in attributes and attributes[ \"followers\" ] is not None:\n+ if \"followers\" in attributes and attributes[ \"followers\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"followers\" ], int )\n self.__followers = attributes[ \"followers\" ]\n- if \"following\" in attributes and attributes[ \"following\" ] is not None:\n+ if \"following\" in attributes and attributes[ \"following\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"following\" ], int )\n self.__following = attributes[ \"following\" ]\n- if \"gravatar_id\" in attributes and attributes[ \"gravatar_id\" ] is not None:\n+ if \"gravatar_id\" in attributes and attributes[ \"gravatar_id\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"gravatar_id\" ], ( str, unicode ) )\n self.__gravatar_id = attributes[ \"gravatar_id\" ]\n- if \"hireable\" in attributes and attributes[ \"hireable\" ] is not None:\n+ if \"hireable\" in attributes and attributes[ \"hireable\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"hireable\" ], bool )\n self.__hireable = attributes[ \"hireable\" ]\n- if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None:\n+ if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"html_url\" ], ( str, unicode ) )\n self.__html_url = attributes[ \"html_url\" ]\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"id\" ], int )\n self.__id = attributes[ \"id\" ]\n- if \"location\" in attributes and attributes[ \"location\" ] is not None:\n+ if \"location\" in attributes and attributes[ \"location\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"location\" ], ( str, unicode ) )\n self.__location = attributes[ \"location\" ]\n- if \"login\" in attributes and attributes[ \"login\" ] is not None:\n+ if \"login\" in attributes and attributes[ \"login\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"login\" ], ( str, unicode ) )\n self.__login = attributes[ \"login\" ]\n- if \"name\" in attributes and attributes[ \"name\" ] is not None:\n+ if \"name\" in attributes and attributes[ \"name\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"name\" ], ( str, unicode ) )\n self.__name = attributes[ \"name\" ]\n- if \"owned_private_repos\" in attributes and attributes[ \"owned_private_repos\" ] is not None:\n+ if \"owned_private_repos\" in attributes and attributes[ \"owned_private_repos\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"owned_private_repos\" ], int )\n self.__owned_private_repos = attributes[ \"owned_private_repos\" ]\n- if \"plan\" in attributes and attributes[ \"plan\" ] is not None:\n+ if \"plan\" in attributes and attributes[ \"plan\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"plan\" ], dict )\n self.__plan = Plan.Plan( self.__requester, attributes[ \"plan\" ], completion = LazyCompletion )\n- if \"private_gists\" in attributes and attributes[ \"private_gists\" ] is not None:\n+ if \"private_gists\" in attributes and attributes[ \"private_gists\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"private_gists\" ], int )\n self.__private_gists = attributes[ \"private_gists\" ]\n- if \"public_gists\" in attributes and attributes[ \"public_gists\" ] is not None:\n+ if \"public_gists\" in attributes and attributes[ \"public_gists\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"public_gists\" ], int )\n self.__public_gists = attributes[ \"public_gists\" ]\n- if \"public_repos\" in attributes and attributes[ \"public_repos\" ] is not None:\n+ if \"public_repos\" in attributes and attributes[ \"public_repos\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"public_repos\" ], int )\n self.__public_repos = attributes[ \"public_repos\" ]\n- if \"total_private_repos\" in attributes and attributes[ \"total_private_repos\" ] is not None:\n+ if \"total_private_repos\" in attributes and attributes[ \"total_private_repos\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"total_private_repos\" ], int )\n self.__total_private_repos = attributes[ \"total_private_repos\" ]\n- if \"type\" in attributes and attributes[ \"type\" ] is not None:\n+ if \"type\" in attributes and attributes[ \"type\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"type\" ], ( str, unicode ) )\n self.__type = attributes[ \"type\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"url\" ], ( str, unicode ) )\n self.__url = attributes[ \"url\" ]","additions":25,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":18,"deletions":9,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Authorization.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Authorization.py","filename":"src/github/Authorization.py","patch":"@@ -117,21 +117,21 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"app\", \"created_at\", \"id\", \"note\", \"note_url\", \"scopes\", \"token\", \"updated_at\", \"url\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"app\" in attributes and attributes[ \"app\" ] is not None:\n+ if \"app\" in attributes and attributes[ \"app\" ] is not None: # pragma no branch\n self.__app = attributes[ \"app\" ]\n- if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None:\n+ if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None: # pragma no branch\n self.__created_at = attributes[ \"created_at\" ]\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n self.__id = attributes[ \"id\" ]\n- if \"note\" in attributes and attributes[ \"note\" ] is not None:\n+ if \"note\" in attributes and attributes[ \"note\" ] is not None: # pragma no branch\n self.__note = attributes[ \"note\" ]\n- if \"note_url\" in attributes and attributes[ \"note_url\" ] is not None:\n+ if \"note_url\" in attributes and attributes[ \"note_url\" ] is not None: # pragma no branch\n self.__note_url = attributes[ \"note_url\" ]\n- if \"scopes\" in attributes and attributes[ \"scopes\" ] is not None:\n+ if \"scopes\" in attributes and attributes[ \"scopes\" ] is not None: # pragma no branch\n self.__scopes = attributes[ \"scopes\" ]\n- if \"token\" in attributes and attributes[ \"token\" ] is not None:\n+ if \"token\" in attributes and attributes[ \"token\" ] is not None: # pragma no branch\n self.__token = attributes[ \"token\" ]\n- if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None:\n+ if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None: # pragma no branch\n self.__updated_at = attributes[ \"updated_at\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n self.__url = attributes[ \"url\" ]","additions":9,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":4,"deletions":2,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Branch.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Branch.py","filename":"src/github/Branch.py","patch":"@@ -28,9 +28,9 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"commit\", \"name\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"commit\" in attributes and attributes[ \"commit\" ] is not None:\n+ if \"commit\" in attributes and attributes[ \"commit\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"commit\" ], dict )\n self.__commit = Commit.Commit( self.__requester, attributes[ \"commit\" ], completion = LazyCompletion )\n- if \"name\" in attributes and attributes[ \"name\" ] is not None:\n+ if \"name\" in attributes and attributes[ \"name\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"name\" ], ( str, unicode ) )\n self.__name = attributes[ \"name\" ]","additions":2,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":16,"deletions":8,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Commit.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Commit.py","filename":"src/github/Commit.py","patch":"@@ -120,33 +120,33 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"author\", \"commit\", \"committer\", \"files\", \"parents\", \"sha\", \"stats\", \"url\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"author\" in attributes and attributes[ \"author\" ] is not None:\n+ if \"author\" in attributes and attributes[ \"author\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"author\" ], dict )\n self.__author = NamedUser.NamedUser( self.__requester, attributes[ \"author\" ], completion = LazyCompletion )\n- if \"commit\" in attributes and attributes[ \"commit\" ] is not None:\n+ if \"commit\" in attributes and attributes[ \"commit\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"commit\" ], dict )\n self.__commit = GitCommit.GitCommit( self.__requester, attributes[ \"commit\" ], completion = LazyCompletion )\n- if \"committer\" in attributes and attributes[ \"committer\" ] is not None:\n+ if \"committer\" in attributes and attributes[ \"committer\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"committer\" ], dict )\n self.__committer = NamedUser.NamedUser( self.__requester, attributes[ \"committer\" ], completion = LazyCompletion )\n- if \"files\" in attributes and attributes[ \"files\" ] is not None:\n+ if \"files\" in attributes and attributes[ \"files\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"files\" ], list ) and ( len( attributes[ \"files\" ] ) == 0 or isinstance( attributes[ \"files\" ][ 0 ], dict ) )\n self.__files = [\n CommitFile.CommitFile( self.__requester, element, completion = LazyCompletion )\n for element in attributes[ \"files\" ]\n ]\n- if \"parents\" in attributes and attributes[ \"parents\" ] is not None:\n+ if \"parents\" in attributes and attributes[ \"parents\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"parents\" ], list ) and ( len( attributes[ \"parents\" ] ) == 0 or isinstance( attributes[ \"parents\" ][ 0 ], dict ) )\n self.__parents = [\n Commit( self.__requester, element, completion = LazyCompletion )\n for element in attributes[ \"parents\" ]\n ]\n- if \"sha\" in attributes and attributes[ \"sha\" ] is not None:\n+ if \"sha\" in attributes and attributes[ \"sha\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"sha\" ], ( str, unicode ) )\n self.__sha = attributes[ \"sha\" ]\n- if \"stats\" in attributes and attributes[ \"stats\" ] is not None:\n+ if \"stats\" in attributes and attributes[ \"stats\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"stats\" ], dict )\n self.__stats = CommitStats.CommitStats( self.__requester, attributes[ \"stats\" ], completion = LazyCompletion )\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"url\" ], ( str, unicode ) )\n self.__url = attributes[ \"url\" ]","additions":8,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":22,"deletions":11,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/CommitComment.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/CommitComment.py","filename":"src/github/CommitComment.py","patch":"@@ -121,36 +121,36 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"body\", \"commit_id\", \"created_at\", \"html_url\", \"id\", \"line\", \"path\", \"position\", \"updated_at\", \"url\", \"user\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"body\" in attributes and attributes[ \"body\" ] is not None:\n+ if \"body\" in attributes and attributes[ \"body\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"body\" ], ( str, unicode ) )\n self.__body = attributes[ \"body\" ]\n- if \"commit_id\" in attributes and attributes[ \"commit_id\" ] is not None:\n+ if \"commit_id\" in attributes and attributes[ \"commit_id\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"commit_id\" ], ( str, unicode ) )\n self.__commit_id = attributes[ \"commit_id\" ]\n- if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None:\n+ if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"created_at\" ], ( str, unicode ) )\n self.__created_at = attributes[ \"created_at\" ]\n- if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None:\n+ if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"html_url\" ], ( str, unicode ) )\n self.__html_url = attributes[ \"html_url\" ]\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"id\" ], int )\n self.__id = attributes[ \"id\" ]\n- if \"line\" in attributes and attributes[ \"line\" ] is not None:\n+ if \"line\" in attributes and attributes[ \"line\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"line\" ], int )\n self.__line = attributes[ \"line\" ]\n- if \"path\" in attributes and attributes[ \"path\" ] is not None:\n+ if \"path\" in attributes and attributes[ \"path\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"path\" ], ( str, unicode ) )\n self.__path = attributes[ \"path\" ]\n- if \"position\" in attributes and attributes[ \"position\" ] is not None:\n+ if \"position\" in attributes and attributes[ \"position\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"position\" ], int )\n self.__position = attributes[ \"position\" ]\n- if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None:\n+ if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"updated_at\" ], ( str, unicode ) )\n self.__updated_at = attributes[ \"updated_at\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"url\" ], ( str, unicode ) )\n self.__url = attributes[ \"url\" ]\n- if \"user\" in attributes and attributes[ \"user\" ] is not None:\n+ if \"user\" in attributes and attributes[ \"user\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"user\" ], dict )\n self.__user = NamedUser.NamedUser( self.__requester, attributes[ \"user\" ], completion = LazyCompletion )","additions":11,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":18,"deletions":9,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/CommitFile.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/CommitFile.py","filename":"src/github/CommitFile.py","patch":"@@ -62,21 +62,21 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"additions\", \"blob_url\", \"changes\", \"deletions\", \"filename\", \"patch\", \"raw_url\", \"sha\", \"status\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"additions\" in attributes and attributes[ \"additions\" ] is not None:\n+ if \"additions\" in attributes and attributes[ \"additions\" ] is not None: # pragma no branch\n self.__additions = attributes[ \"additions\" ]\n- if \"blob_url\" in attributes and attributes[ \"blob_url\" ] is not None:\n+ if \"blob_url\" in attributes and attributes[ \"blob_url\" ] is not None: # pragma no branch\n self.__blob_url = attributes[ \"blob_url\" ]\n- if \"changes\" in attributes and attributes[ \"changes\" ] is not None:\n+ if \"changes\" in attributes and attributes[ \"changes\" ] is not None: # pragma no branch\n self.__changes = attributes[ \"changes\" ]\n- if \"deletions\" in attributes and attributes[ \"deletions\" ] is not None:\n+ if \"deletions\" in attributes and attributes[ \"deletions\" ] is not None: # pragma no branch\n self.__deletions = attributes[ \"deletions\" ]\n- if \"filename\" in attributes and attributes[ \"filename\" ] is not None:\n+ if \"filename\" in attributes and attributes[ \"filename\" ] is not None: # pragma no branch\n self.__filename = attributes[ \"filename\" ]\n- if \"patch\" in attributes and attributes[ \"patch\" ] is not None:\n+ if \"patch\" in attributes and attributes[ \"patch\" ] is not None: # pragma no branch\n self.__patch = attributes[ \"patch\" ]\n- if \"raw_url\" in attributes and attributes[ \"raw_url\" ] is not None:\n+ if \"raw_url\" in attributes and attributes[ \"raw_url\" ] is not None: # pragma no branch\n self.__raw_url = attributes[ \"raw_url\" ]\n- if \"sha\" in attributes and attributes[ \"sha\" ] is not None:\n+ if \"sha\" in attributes and attributes[ \"sha\" ] is not None: # pragma no branch\n self.__sha = attributes[ \"sha\" ]\n- if \"status\" in attributes and attributes[ \"status\" ] is not None:\n+ if \"status\" in attributes and attributes[ \"status\" ] is not None: # pragma no branch\n self.__status = attributes[ \"status\" ]","additions":9,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":6,"deletions":3,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/CommitStats.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/CommitStats.py","filename":"src/github/CommitStats.py","patch":"@@ -32,12 +32,12 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"additions\", \"deletions\", \"total\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"additions\" in attributes and attributes[ \"additions\" ] is not None:\n+ if \"additions\" in attributes and attributes[ \"additions\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"additions\" ], int )\n self.__additions = attributes[ \"additions\" ]\n- if \"deletions\" in attributes and attributes[ \"deletions\" ] is not None:\n+ if \"deletions\" in attributes and attributes[ \"deletions\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"deletions\" ], int )\n self.__deletions = attributes[ \"deletions\" ]\n- if \"total\" in attributes and attributes[ \"total\" ] is not None:\n+ if \"total\" in attributes and attributes[ \"total\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"total\" ], int )\n self.__total = attributes[ \"total\" ]","additions":3,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":40,"deletions":20,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Download.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Download.py","filename":"src/github/Download.py","patch":"@@ -162,43 +162,43 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"accesskeyid\", \"acl\", \"bucket\", \"content_type\", \"created_at\", \"description\", \"download_count\", \"expirationdate\", \"html_url\", \"id\", \"mime_type\", \"name\", \"path\", \"policy\", \"prefix\", \"redirect\", \"s3_url\", \"signature\", \"size\", \"url\", \"x-amz-meta-content-disposition\" ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"accesskeyid\" in attributes and attributes[ \"accesskeyid\" ] is not None:\n+ if \"accesskeyid\" in attributes and attributes[ \"accesskeyid\" ] is not None: # pragma no branch\n self.__accesskeyid = attributes[ \"accesskeyid\" ]\n- if \"acl\" in attributes and attributes[ \"acl\" ] is not None:\n+ if \"acl\" in attributes and attributes[ \"acl\" ] is not None: # pragma no branch\n self.__acl = attributes[ \"acl\" ]\n- if \"bucket\" in attributes and attributes[ \"bucket\" ] is not None:\n+ if \"bucket\" in attributes and attributes[ \"bucket\" ] is not None: # pragma no branch\n self.__bucket = attributes[ \"bucket\" ]\n- if \"content_type\" in attributes and attributes[ \"content_type\" ] is not None:\n+ if \"content_type\" in attributes and attributes[ \"content_type\" ] is not None: # pragma no branch\n self.__content_type = attributes[ \"content_type\" ]\n- if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None:\n+ if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None: # pragma no branch\n self.__created_at = attributes[ \"created_at\" ]\n- if \"description\" in attributes and attributes[ \"description\" ] is not None:\n+ if \"description\" in attributes and attributes[ \"description\" ] is not None: # pragma no branch\n self.__description = attributes[ \"description\" ]\n- if \"download_count\" in attributes and attributes[ \"download_count\" ] is not None:\n+ if \"download_count\" in attributes and attributes[ \"download_count\" ] is not None: # pragma no branch\n self.__download_count = attributes[ \"download_count\" ]\n- if \"expirationdate\" in attributes and attributes[ \"expirationdate\" ] is not None:\n+ if \"expirationdate\" in attributes and attributes[ \"expirationdate\" ] is not None: # pragma no branch\n self.__expirationdate = attributes[ \"expirationdate\" ]\n- if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None:\n+ if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None: # pragma no branch\n self.__html_url = attributes[ \"html_url\" ]\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n self.__id = attributes[ \"id\" ]\n- if \"mime_type\" in attributes and attributes[ \"mime_type\" ] is not None:\n+ if \"mime_type\" in attributes and attributes[ \"mime_type\" ] is not None: # pragma no branch\n self.__mime_type = attributes[ \"mime_type\" ]\n- if \"name\" in attributes and attributes[ \"name\" ] is not None:\n+ if \"name\" in attributes and attributes[ \"name\" ] is not None: # pragma no branch\n self.__name = attributes[ \"name\" ]\n- if \"path\" in attributes and attributes[ \"path\" ] is not None:\n+ if \"path\" in attributes and attributes[ \"path\" ] is not None: # pragma no branch\n self.__path = attributes[ \"path\" ]\n- if \"policy\" in attributes and attributes[ \"policy\" ] is not None:\n+ if \"policy\" in attributes and attributes[ \"policy\" ] is not None: # pragma no branch\n self.__policy = attributes[ \"policy\" ]\n- if \"prefix\" in attributes and attributes[ \"prefix\" ] is not None:\n+ if \"prefix\" in attributes and attributes[ \"prefix\" ] is not None: # pragma no branch\n self.__prefix = attributes[ \"prefix\" ]\n- if \"redirect\" in attributes and attributes[ \"redirect\" ] is not None:\n+ if \"redirect\" in attributes and attributes[ \"redirect\" ] is not None: # pragma no branch\n self.__redirect = attributes[ \"redirect\" ]\n- if \"s3_url\" in attributes and attributes[ \"s3_url\" ] is not None:\n+ if \"s3_url\" in attributes and attributes[ \"s3_url\" ] is not None: # pragma no branch\n self.__s3_url = attributes[ \"s3_url\" ]\n- if \"signature\" in attributes and attributes[ \"signature\" ] is not None:\n+ if \"signature\" in attributes and attributes[ \"signature\" ] is not None: # pragma no branch\n self.__signature = attributes[ \"signature\" ]\n- if \"size\" in attributes and attributes[ \"size\" ] is not None:\n+ if \"size\" in attributes and attributes[ \"size\" ] is not None: # pragma no branch\n self.__size = attributes[ \"size\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n self.__url = attributes[ \"url\" ]","additions":20,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":16,"deletions":8,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Event.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Event.py","filename":"src/github/Event.py","patch":"@@ -60,22 +60,22 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"actor\", \"created_at\", \"id\", \"org\", \"payload\", \"public\", \"repo\", \"type\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"actor\" in attributes and attributes[ \"actor\" ] is not None:\n+ if \"actor\" in attributes and attributes[ \"actor\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"actor\" ], dict )\n self.__actor = NamedUser.NamedUser( self.__requester, attributes[ \"actor\" ], completion = LazyCompletion )\n- if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None:\n+ if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None: # pragma no branch\n self.__created_at = attributes[ \"created_at\" ]\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n self.__id = attributes[ \"id\" ]\n- if \"org\" in attributes and attributes[ \"org\" ] is not None:\n+ if \"org\" in attributes and attributes[ \"org\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"org\" ], dict )\n self.__org = Organization.Organization( self.__requester, attributes[ \"org\" ], completion = LazyCompletion )\n- if \"payload\" in attributes and attributes[ \"payload\" ] is not None:\n+ if \"payload\" in attributes and attributes[ \"payload\" ] is not None: # pragma no branch\n self.__payload = attributes[ \"payload\" ]\n- if \"public\" in attributes and attributes[ \"public\" ] is not None:\n+ if \"public\" in attributes and attributes[ \"public\" ] is not None: # pragma no branch\n self.__public = attributes[ \"public\" ]\n- if \"repo\" in attributes and attributes[ \"repo\" ] is not None:\n+ if \"repo\" in attributes and attributes[ \"repo\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"repo\" ], dict )\n self.__repo = Repository.Repository( self.__requester, attributes[ \"repo\" ], completion = LazyCompletion )\n- if \"type\" in attributes and attributes[ \"type\" ] is not None:\n+ if \"type\" in attributes and attributes[ \"type\" ] is not None: # pragma no branch\n self.__type = attributes[ \"type\" ]","additions":8,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":30,"deletions":15,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Gist.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Gist.py","filename":"src/github/Gist.py","patch":"@@ -220,53 +220,53 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"comments\", \"created_at\", \"description\", \"files\", \"fork_of\", \"forks\", \"git_pull_url\", \"git_push_url\", \"history\", \"html_url\", \"id\", \"public\", \"updated_at\", \"url\", \"user\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"comments\" in attributes and attributes[ \"comments\" ] is not None:\n+ if \"comments\" in attributes and attributes[ \"comments\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"comments\" ], int )\n self.__comments = attributes[ \"comments\" ]\n- if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None:\n+ if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"created_at\" ], ( str, unicode ) )\n self.__created_at = attributes[ \"created_at\" ]\n- if \"description\" in attributes and attributes[ \"description\" ] is not None:\n+ if \"description\" in attributes and attributes[ \"description\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"description\" ], ( str, unicode ) )\n self.__description = attributes[ \"description\" ]\n- if \"files\" in attributes and attributes[ \"files\" ] is not None:\n+ if \"files\" in attributes and attributes[ \"files\" ] is not None: # pragma no branch\n self.__files = attributes[ \"files\" ]\n- if \"fork_of\" in attributes and attributes[ \"fork_of\" ] is not None:\n+ if \"fork_of\" in attributes and attributes[ \"fork_of\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"fork_of\" ], dict )\n self.__fork_of = Gist( self.__requester, attributes[ \"fork_of\" ], completion = LazyCompletion )\n- if \"forks\" in attributes and attributes[ \"forks\" ] is not None:\n+ if \"forks\" in attributes and attributes[ \"forks\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"forks\" ], list ) and ( len( attributes[ \"forks\" ] ) == 0 or isinstance( attributes[ \"forks\" ][ 0 ], dict ) )\n self.__forks = [\n Gist( self.__requester, element, completion = LazyCompletion )\n for element in attributes[ \"forks\" ]\n ]\n- if \"git_pull_url\" in attributes and attributes[ \"git_pull_url\" ] is not None:\n+ if \"git_pull_url\" in attributes and attributes[ \"git_pull_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"git_pull_url\" ], ( str, unicode ) )\n self.__git_pull_url = attributes[ \"git_pull_url\" ]\n- if \"git_push_url\" in attributes and attributes[ \"git_push_url\" ] is not None:\n+ if \"git_push_url\" in attributes and attributes[ \"git_push_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"git_push_url\" ], ( str, unicode ) )\n self.__git_push_url = attributes[ \"git_push_url\" ]\n- if \"history\" in attributes and attributes[ \"history\" ] is not None:\n+ if \"history\" in attributes and attributes[ \"history\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"history\" ], list ) and ( len( attributes[ \"history\" ] ) == 0 or isinstance( attributes[ \"history\" ][ 0 ], dict ) )\n self.__history = [\n GistHistoryState.GistHistoryState( self.__requester, element, completion = LazyCompletion )\n for element in attributes[ \"history\" ]\n ]\n- if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None:\n+ if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"html_url\" ], ( str, unicode ) )\n self.__html_url = attributes[ \"html_url\" ]\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"id\" ], ( str, unicode ) )\n self.__id = attributes[ \"id\" ]\n- if \"public\" in attributes and attributes[ \"public\" ] is not None:\n+ if \"public\" in attributes and attributes[ \"public\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"public\" ], bool )\n self.__public = attributes[ \"public\" ]\n- if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None:\n+ if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"updated_at\" ], ( str, unicode ) )\n self.__updated_at = attributes[ \"updated_at\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"url\" ], ( str, unicode ) )\n self.__url = attributes[ \"url\" ]\n- if \"user\" in attributes and attributes[ \"user\" ] is not None:\n+ if \"user\" in attributes and attributes[ \"user\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"user\" ], dict )\n self.__user = NamedUser.NamedUser( self.__requester, attributes[ \"user\" ], completion = LazyCompletion )","additions":15,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":12,"deletions":6,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GistComment.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GistComment.py","filename":"src/github/GistComment.py","patch":"@@ -68,16 +68,16 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"body\", \"created_at\", \"id\", \"updated_at\", \"url\", \"user\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"body\" in attributes and attributes[ \"body\" ] is not None:\n+ if \"body\" in attributes and attributes[ \"body\" ] is not None: # pragma no branch\n self.__body = attributes[ \"body\" ]\n- if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None:\n+ if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None: # pragma no branch\n self.__created_at = attributes[ \"created_at\" ]\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n self.__id = attributes[ \"id\" ]\n- if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None:\n+ if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None: # pragma no branch\n self.__updated_at = attributes[ \"updated_at\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n self.__url = attributes[ \"url\" ]\n- if \"user\" in attributes and attributes[ \"user\" ] is not None:\n+ if \"user\" in attributes and attributes[ \"user\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"user\" ], dict )\n self.__user = NamedUser.NamedUser( self.__requester, attributes[ \"user\" ], completion = LazyCompletion )","additions":6,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":10,"deletions":5,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GistHistoryState.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GistHistoryState.py","filename":"src/github/GistHistoryState.py","patch":"@@ -44,18 +44,18 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"change_status\", \"committed_at\", \"url\", \"user\", \"version\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"change_status\" in attributes and attributes[ \"change_status\" ] is not None:\n+ if \"change_status\" in attributes and attributes[ \"change_status\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"change_status\" ], dict )\n self.__change_status = CommitStats.CommitStats( self.__requester, attributes[ \"change_status\" ], completion = LazyCompletion )\n- if \"committed_at\" in attributes and attributes[ \"committed_at\" ] is not None:\n+ if \"committed_at\" in attributes and attributes[ \"committed_at\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"committed_at\" ], ( str, unicode ) )\n self.__committed_at = attributes[ \"committed_at\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"url\" ], ( str, unicode ) )\n self.__url = attributes[ \"url\" ]\n- if \"user\" in attributes and attributes[ \"user\" ] is not None:\n+ if \"user\" in attributes and attributes[ \"user\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"user\" ], dict )\n self.__user = NamedUser.NamedUser( self.__requester, attributes[ \"user\" ], completion = LazyCompletion )\n- if \"version\" in attributes and attributes[ \"version\" ] is not None:\n+ if \"version\" in attributes and attributes[ \"version\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"version\" ], ( str, unicode ) )\n self.__version = attributes[ \"version\" ]","additions":5,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":6,"deletions":3,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GitAuthor.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GitAuthor.py","filename":"src/github/GitAuthor.py","patch":"@@ -32,12 +32,12 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"date\", \"email\", \"name\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"date\" in attributes and attributes[ \"date\" ] is not None:\n+ if \"date\" in attributes and attributes[ \"date\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"date\" ], ( str, unicode ) )\n self.__date = attributes[ \"date\" ]\n- if \"email\" in attributes and attributes[ \"email\" ] is not None:\n+ if \"email\" in attributes and attributes[ \"email\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"email\" ], ( str, unicode ) )\n self.__email = attributes[ \"email\" ]\n- if \"name\" in attributes and attributes[ \"name\" ] is not None:\n+ if \"name\" in attributes and attributes[ \"name\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"name\" ], ( str, unicode ) )\n self.__name = attributes[ \"name\" ]","additions":3,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":10,"deletions":5,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GitBlob.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GitBlob.py","filename":"src/github/GitBlob.py","patch":"@@ -42,18 +42,18 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"content\", \"encoding\", \"sha\", \"size\", \"url\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"content\" in attributes and attributes[ \"content\" ] is not None:\n+ if \"content\" in attributes and attributes[ \"content\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"content\" ], ( str, unicode ) )\n self.__content = attributes[ \"content\" ]\n- if \"encoding\" in attributes and attributes[ \"encoding\" ] is not None:\n+ if \"encoding\" in attributes and attributes[ \"encoding\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"encoding\" ], ( str, unicode ) )\n self.__encoding = attributes[ \"encoding\" ]\n- if \"sha\" in attributes and attributes[ \"sha\" ] is not None:\n+ if \"sha\" in attributes and attributes[ \"sha\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"sha\" ], ( str, unicode ) )\n self.__sha = attributes[ \"sha\" ]\n- if \"size\" in attributes and attributes[ \"size\" ] is not None:\n+ if \"size\" in attributes and attributes[ \"size\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"size\" ], int )\n self.__size = attributes[ \"size\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"url\" ], ( str, unicode ) )\n self.__url = attributes[ \"url\" ]","additions":5,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":14,"deletions":7,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GitCommit.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GitCommit.py","filename":"src/github/GitCommit.py","patch":"@@ -55,27 +55,27 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"author\", \"committer\", \"message\", \"parents\", \"sha\", \"tree\", \"url\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"author\" in attributes and attributes[ \"author\" ] is not None:\n+ if \"author\" in attributes and attributes[ \"author\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"author\" ], dict )\n self.__author = GitAuthor.GitAuthor( self.__requester, attributes[ \"author\" ], completion = LazyCompletion )\n- if \"committer\" in attributes and attributes[ \"committer\" ] is not None:\n+ if \"committer\" in attributes and attributes[ \"committer\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"committer\" ], dict )\n self.__committer = GitAuthor.GitAuthor( self.__requester, attributes[ \"committer\" ], completion = LazyCompletion )\n- if \"message\" in attributes and attributes[ \"message\" ] is not None:\n+ if \"message\" in attributes and attributes[ \"message\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"message\" ], ( str, unicode ) )\n self.__message = attributes[ \"message\" ]\n- if \"parents\" in attributes and attributes[ \"parents\" ] is not None:\n+ if \"parents\" in attributes and attributes[ \"parents\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"parents\" ], list ) and ( len( attributes[ \"parents\" ] ) == 0 or isinstance( attributes[ \"parents\" ][ 0 ], dict ) )\n self.__parents = [\n GitCommit( self.__requester, element, completion = LazyCompletion )\n for element in attributes[ \"parents\" ]\n ]\n- if \"sha\" in attributes and attributes[ \"sha\" ] is not None:\n+ if \"sha\" in attributes and attributes[ \"sha\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"sha\" ], ( str, unicode ) )\n self.__sha = attributes[ \"sha\" ]\n- if \"tree\" in attributes and attributes[ \"tree\" ] is not None:\n+ if \"tree\" in attributes and attributes[ \"tree\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"tree\" ], dict )\n self.__tree = GitTree.GitTree( self.__requester, attributes[ \"tree\" ], completion = LazyCompletion )\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"url\" ], ( str, unicode ) )\n self.__url = attributes[ \"url\" ]","additions":7,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":6,"deletions":3,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GitObject.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GitObject.py","filename":"src/github/GitObject.py","patch":"@@ -32,12 +32,12 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"sha\", \"type\", \"url\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"sha\" in attributes and attributes[ \"sha\" ] is not None:\n+ if \"sha\" in attributes and attributes[ \"sha\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"sha\" ], ( str, unicode ) )\n self.__sha = attributes[ \"sha\" ]\n- if \"type\" in attributes and attributes[ \"type\" ] is not None:\n+ if \"type\" in attributes and attributes[ \"type\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"type\" ], ( str, unicode ) )\n self.__type = attributes[ \"type\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"url\" ], ( str, unicode ) )\n self.__url = attributes[ \"url\" ]","additions":3,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":6,"deletions":3,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GitRef.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GitRef.py","filename":"src/github/GitRef.py","patch":"@@ -55,12 +55,12 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"object\", \"ref\", \"url\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"object\" in attributes and attributes[ \"object\" ] is not None:\n+ if \"object\" in attributes and attributes[ \"object\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"object\" ], dict )\n self.__object = GitObject.GitObject( self.__requester, attributes[ \"object\" ], completion = LazyCompletion )\n- if \"ref\" in attributes and attributes[ \"ref\" ] is not None:\n+ if \"ref\" in attributes and attributes[ \"ref\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"ref\" ], ( str, unicode ) )\n self.__ref = attributes[ \"ref\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"url\" ], ( str, unicode ) )\n self.__url = attributes[ \"url\" ]","additions":3,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":12,"deletions":6,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GitTag.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GitTag.py","filename":"src/github/GitTag.py","patch":"@@ -49,21 +49,21 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"message\", \"object\", \"sha\", \"tag\", \"tagger\", \"url\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"message\" in attributes and attributes[ \"message\" ] is not None:\n+ if \"message\" in attributes and attributes[ \"message\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"message\" ], ( str, unicode ) )\n self.__message = attributes[ \"message\" ]\n- if \"object\" in attributes and attributes[ \"object\" ] is not None:\n+ if \"object\" in attributes and attributes[ \"object\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"object\" ], dict )\n self.__object = GitObject.GitObject( self.__requester, attributes[ \"object\" ], completion = LazyCompletion )\n- if \"sha\" in attributes and attributes[ \"sha\" ] is not None:\n+ if \"sha\" in attributes and attributes[ \"sha\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"sha\" ], ( str, unicode ) )\n self.__sha = attributes[ \"sha\" ]\n- if \"tag\" in attributes and attributes[ \"tag\" ] is not None:\n+ if \"tag\" in attributes and attributes[ \"tag\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"tag\" ], ( str, unicode ) )\n self.__tag = attributes[ \"tag\" ]\n- if \"tagger\" in attributes and attributes[ \"tagger\" ] is not None:\n+ if \"tagger\" in attributes and attributes[ \"tagger\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"tagger\" ], dict )\n self.__tagger = GitAuthor.GitAuthor( self.__requester, attributes[ \"tagger\" ], completion = LazyCompletion )\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"url\" ], ( str, unicode ) )\n self.__url = attributes[ \"url\" ]","additions":6,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":6,"deletions":3,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GitTree.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GitTree.py","filename":"src/github/GitTree.py","patch":"@@ -33,15 +33,15 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"sha\", \"tree\", \"url\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"sha\" in attributes and attributes[ \"sha\" ] is not None:\n+ if \"sha\" in attributes and attributes[ \"sha\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"sha\" ], ( str, unicode ) )\n self.__sha = attributes[ \"sha\" ]\n- if \"tree\" in attributes and attributes[ \"tree\" ] is not None:\n+ if \"tree\" in attributes and attributes[ \"tree\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"tree\" ], list ) and ( len( attributes[ \"tree\" ] ) == 0 or isinstance( attributes[ \"tree\" ][ 0 ], dict ) )\n self.__tree = [\n GitTreeElement.GitTreeElement( self.__requester, element, completion = LazyCompletion )\n for element in attributes[ \"tree\" ]\n ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"url\" ], ( str, unicode ) )\n self.__url = attributes[ \"url\" ]","additions":3,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":12,"deletions":6,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GitTreeElement.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GitTreeElement.py","filename":"src/github/GitTreeElement.py","patch":"@@ -47,21 +47,21 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"mode\", \"path\", \"sha\", \"size\", \"type\", \"url\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"mode\" in attributes and attributes[ \"mode\" ] is not None:\n+ if \"mode\" in attributes and attributes[ \"mode\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"mode\" ], ( str, unicode ) )\n self.__mode = attributes[ \"mode\" ]\n- if \"path\" in attributes and attributes[ \"path\" ] is not None:\n+ if \"path\" in attributes and attributes[ \"path\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"path\" ], ( str, unicode ) )\n self.__path = attributes[ \"path\" ]\n- if \"sha\" in attributes and attributes[ \"sha\" ] is not None:\n+ if \"sha\" in attributes and attributes[ \"sha\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"sha\" ], ( str, unicode ) )\n self.__sha = attributes[ \"sha\" ]\n- if \"size\" in attributes and attributes[ \"size\" ] is not None:\n+ if \"size\" in attributes and attributes[ \"size\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"size\" ], int )\n self.__size = attributes[ \"size\" ]\n- if \"type\" in attributes and attributes[ \"type\" ] is not None:\n+ if \"type\" in attributes and attributes[ \"type\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"type\" ], ( str, unicode ) )\n self.__type = attributes[ \"type\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"url\" ], ( str, unicode ) )\n self.__url = attributes[ \"url\" ]","additions":6,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":18,"deletions":9,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Hook.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Hook.py","filename":"src/github/Hook.py","patch":"@@ -99,21 +99,21 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"active\", \"config\", \"created_at\", \"events\", \"id\", \"last_response\", \"name\", \"updated_at\", \"url\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"active\" in attributes and attributes[ \"active\" ] is not None:\n+ if \"active\" in attributes and attributes[ \"active\" ] is not None: # pragma no branch\n self.__active = attributes[ \"active\" ]\n- if \"config\" in attributes and attributes[ \"config\" ] is not None:\n+ if \"config\" in attributes and attributes[ \"config\" ] is not None: # pragma no branch\n self.__config = attributes[ \"config\" ]\n- if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None:\n+ if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None: # pragma no branch\n self.__created_at = attributes[ \"created_at\" ]\n- if \"events\" in attributes and attributes[ \"events\" ] is not None:\n+ if \"events\" in attributes and attributes[ \"events\" ] is not None: # pragma no branch\n self.__events = attributes[ \"events\" ]\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n self.__id = attributes[ \"id\" ]\n- if \"last_response\" in attributes and attributes[ \"last_response\" ] is not None:\n+ if \"last_response\" in attributes and attributes[ \"last_response\" ] is not None: # pragma no branch\n self.__last_response = attributes[ \"last_response\" ]\n- if \"name\" in attributes and attributes[ \"name\" ] is not None:\n+ if \"name\" in attributes and attributes[ \"name\" ] is not None: # pragma no branch\n self.__name = attributes[ \"name\" ]\n- if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None:\n+ if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None: # pragma no branch\n self.__updated_at = attributes[ \"updated_at\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n self.__url = attributes[ \"url\" ]","additions":9,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":53,"deletions":21,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Issue.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Issue.py","filename":"src/github/Issue.py","patch":"@@ -110,7 +110,7 @@ def user( self ):\n return self.__user\n \n def add_to_labels( self, *labels ):\n- post_parameters = labels\n+ post_parameters = [ label.name for label in labels ]\n status, headers, data = self.__requester.request(\n \"POST\",\n str( self.url ) + \"/labels\",\n@@ -131,7 +131,12 @@ def create_comment( self, body ):\n return IssueComment.IssueComment( self.__requester, data, completion = NoCompletion )\n \n def delete_labels( self ):\n- pass\n+ status, headers, data = self.__requester.request(\n+ \"DELETE\",\n+ str( self.url ) + \"/labels\",\n+ None,\n+ None\n+ )\n \n def edit( self, title = DefaultValueForOptionalParameters, body = DefaultValueForOptionalParameters, assignee = DefaultValueForOptionalParameters, state = DefaultValueForOptionalParameters, milestone = DefaultValueForOptionalParameters, labels = DefaultValueForOptionalParameters ):\n post_parameters = {\n@@ -216,7 +221,13 @@ def remove_from_labels( self, label ):\n )\n \n def set_labels( self, *labels ):\n- pass\n+ post_parameters = [ label.name for label in labels ]\n+ status, headers, data = self.__requester.request(\n+ \"PUT\",\n+ str( self.url ) + \"/labels\",\n+ None,\n+ post_parameters\n+ )\n \n def __initAttributes( self ):\n self.__assignee = None\n@@ -257,59 +268,59 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"assignee\", \"body\", \"closed_at\", \"closed_by\", \"comments\", \"created_at\", \"html_url\", \"id\", \"labels\", \"milestone\", \"number\", \"pull_request\", \"repository\", \"state\", \"title\", \"updated_at\", \"url\", \"user\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"assignee\" in attributes and attributes[ \"assignee\" ] is not None:\n+ if \"assignee\" in attributes and attributes[ \"assignee\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"assignee\" ], dict )\n self.__assignee = NamedUser.NamedUser( self.__requester, attributes[ \"assignee\" ], completion = LazyCompletion )\n- if \"body\" in attributes and attributes[ \"body\" ] is not None:\n+ if \"body\" in attributes and attributes[ \"body\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"body\" ], ( str, unicode ) )\n self.__body = attributes[ \"body\" ]\n- if \"closed_at\" in attributes and attributes[ \"closed_at\" ] is not None:\n+ if \"closed_at\" in attributes and attributes[ \"closed_at\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"closed_at\" ], ( str, unicode ) )\n self.__closed_at = attributes[ \"closed_at\" ]\n- if \"closed_by\" in attributes and attributes[ \"closed_by\" ] is not None:\n+ if \"closed_by\" in attributes and attributes[ \"closed_by\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"closed_by\" ], dict )\n self.__closed_by = NamedUser.NamedUser( self.__requester, attributes[ \"closed_by\" ], completion = LazyCompletion )\n- if \"comments\" in attributes and attributes[ \"comments\" ] is not None:\n+ if \"comments\" in attributes and attributes[ \"comments\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"comments\" ], int )\n self.__comments = attributes[ \"comments\" ]\n- if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None:\n+ if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"created_at\" ], ( str, unicode ) )\n self.__created_at = attributes[ \"created_at\" ]\n- if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None:\n+ if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"html_url\" ], ( str, unicode ) )\n self.__html_url = attributes[ \"html_url\" ]\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"id\" ], int )\n self.__id = attributes[ \"id\" ]\n- if \"labels\" in attributes and attributes[ \"labels\" ] is not None:\n+ if \"labels\" in attributes and attributes[ \"labels\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"labels\" ], list ) and ( len( attributes[ \"labels\" ] ) == 0 or isinstance( attributes[ \"labels\" ][ 0 ], dict ) )\n self.__labels = [\n Label.Label( self.__requester, element, completion = LazyCompletion )\n for element in attributes[ \"labels\" ]\n ]\n- if \"milestone\" in attributes and attributes[ \"milestone\" ] is not None:\n+ if \"milestone\" in attributes and attributes[ \"milestone\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"milestone\" ], dict )\n self.__milestone = Milestone.Milestone( self.__requester, attributes[ \"milestone\" ], completion = LazyCompletion )\n- if \"number\" in attributes and attributes[ \"number\" ] is not None:\n+ if \"number\" in attributes and attributes[ \"number\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"number\" ], int )\n self.__number = attributes[ \"number\" ]\n- if \"pull_request\" in attributes and attributes[ \"pull_request\" ] is not None:\n+ if \"pull_request\" in attributes and attributes[ \"pull_request\" ] is not None: # pragma no branch\n self.__pull_request = attributes[ \"pull_request\" ]\n- if \"repository\" in attributes and attributes[ \"repository\" ] is not None:\n+ if \"repository\" in attributes and attributes[ \"repository\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"repository\" ], dict )\n self.__repository = Repository.Repository( self.__requester, attributes[ \"repository\" ], completion = LazyCompletion )\n- if \"state\" in attributes and attributes[ \"state\" ] is not None:\n+ if \"state\" in attributes and attributes[ \"state\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"state\" ], ( str, unicode ) )\n self.__state = attributes[ \"state\" ]\n- if \"title\" in attributes and attributes[ \"title\" ] is not None:\n+ if \"title\" in attributes and attributes[ \"title\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"title\" ], ( str, unicode ) )\n self.__title = attributes[ \"title\" ]\n- if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None:\n+ if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"updated_at\" ], ( str, unicode ) )\n self.__updated_at = attributes[ \"updated_at\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"url\" ], ( str, unicode ) )\n self.__url = attributes[ \"url\" ]\n- if \"user\" in attributes and attributes[ \"user\" ] is not None:\n+ if \"user\" in attributes and attributes[ \"user\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"user\" ], dict )\n self.__user = NamedUser.NamedUser( self.__requester, attributes[ \"user\" ], completion = LazyCompletion )","additions":32,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":12,"deletions":6,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/IssueComment.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/IssueComment.py","filename":"src/github/IssueComment.py","patch":"@@ -68,16 +68,16 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"body\", \"created_at\", \"id\", \"updated_at\", \"url\", \"user\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"body\" in attributes and attributes[ \"body\" ] is not None:\n+ if \"body\" in attributes and attributes[ \"body\" ] is not None: # pragma no branch\n self.__body = attributes[ \"body\" ]\n- if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None:\n+ if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None: # pragma no branch\n self.__created_at = attributes[ \"created_at\" ]\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n self.__id = attributes[ \"id\" ]\n- if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None:\n+ if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None: # pragma no branch\n self.__updated_at = attributes[ \"updated_at\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n self.__url = attributes[ \"url\" ]\n- if \"user\" in attributes and attributes[ \"user\" ] is not None:\n+ if \"user\" in attributes and attributes[ \"user\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"user\" ], dict )\n self.__user = NamedUser.NamedUser( self.__requester, attributes[ \"user\" ], completion = LazyCompletion )","additions":6,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":14,"deletions":7,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/IssueEvent.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/IssueEvent.py","filename":"src/github/IssueEvent.py","patch":"@@ -78,24 +78,24 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"actor\", \"commit_id\", \"created_at\", \"event\", \"id\", \"issue\", \"url\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"actor\" in attributes and attributes[ \"actor\" ] is not None:\n+ if \"actor\" in attributes and attributes[ \"actor\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"actor\" ], dict )\n self.__actor = NamedUser.NamedUser( self.__requester, attributes[ \"actor\" ], completion = LazyCompletion )\n- if \"commit_id\" in attributes and attributes[ \"commit_id\" ] is not None:\n+ if \"commit_id\" in attributes and attributes[ \"commit_id\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"commit_id\" ], ( str, unicode ) )\n self.__commit_id = attributes[ \"commit_id\" ]\n- if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None:\n+ if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"created_at\" ], ( str, unicode ) )\n self.__created_at = attributes[ \"created_at\" ]\n- if \"event\" in attributes and attributes[ \"event\" ] is not None:\n+ if \"event\" in attributes and attributes[ \"event\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"event\" ], ( str, unicode ) )\n self.__event = attributes[ \"event\" ]\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"id\" ], int )\n self.__id = attributes[ \"id\" ]\n- if \"issue\" in attributes and attributes[ \"issue\" ] is not None:\n+ if \"issue\" in attributes and attributes[ \"issue\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"issue\" ], dict )\n self.__issue = Issue.Issue( self.__requester, attributes[ \"issue\" ], completion = LazyCompletion )\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"url\" ], ( str, unicode ) )\n self.__url = attributes[ \"url\" ]","additions":7,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":13,"deletions":3,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Label.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Label.py","filename":"src/github/Label.py","patch":"@@ -1,6 +1,8 @@\n # WARNING: this file is generated automaticaly.\n # Do not modify it manually, your work would be lost.\n \n+import urllib\n+\n import PaginatedList\n from GithubObject import *\n \n@@ -43,6 +45,11 @@ def edit( self, name, color ):\n )\n self.__useAttributes( data )\n \n+ # @toto Remove '_identity' from the normalized json description\n+ @property\n+ def _identity( self ):\n+ return urllib.quote( self.name )\n+\n def __initAttributes( self ):\n self.__color = None\n self.__name = None\n@@ -53,9 +60,9 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"color\", \"name\", \"url\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"color\" in attributes and attributes[ \"color\" ] is not None:\n+ if \"color\" in attributes and attributes[ \"color\" ] is not None: # pragma no branch\n self.__color = attributes[ \"color\" ]\n- if \"name\" in attributes and attributes[ \"name\" ] is not None:\n+ if \"name\" in attributes and attributes[ \"name\" ] is not None: # pragma no branch\n self.__name = attributes[ \"name\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n self.__url = attributes[ \"url\" ]","additions":10,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":22,"deletions":11,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Milestone.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Milestone.py","filename":"src/github/Milestone.py","patch":"@@ -114,36 +114,36 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"closed_issues\", \"created_at\", \"creator\", \"description\", \"due_on\", \"id\", \"number\", \"open_issues\", \"state\", \"title\", \"url\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"closed_issues\" in attributes and attributes[ \"closed_issues\" ] is not None:\n+ if \"closed_issues\" in attributes and attributes[ \"closed_issues\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"closed_issues\" ], int )\n self.__closed_issues = attributes[ \"closed_issues\" ]\n- if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None:\n+ if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"created_at\" ], ( str, unicode ) )\n self.__created_at = attributes[ \"created_at\" ]\n- if \"creator\" in attributes and attributes[ \"creator\" ] is not None:\n+ if \"creator\" in attributes and attributes[ \"creator\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"creator\" ], dict )\n self.__creator = NamedUser.NamedUser( self.__requester, attributes[ \"creator\" ], completion = LazyCompletion )\n- if \"description\" in attributes and attributes[ \"description\" ] is not None:\n+ if \"description\" in attributes and attributes[ \"description\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"description\" ], ( str, unicode ) )\n self.__description = attributes[ \"description\" ]\n- if \"due_on\" in attributes and attributes[ \"due_on\" ] is not None:\n+ if \"due_on\" in attributes and attributes[ \"due_on\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"due_on\" ], ( str, unicode ) )\n self.__due_on = attributes[ \"due_on\" ]\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"id\" ], int )\n self.__id = attributes[ \"id\" ]\n- if \"number\" in attributes and attributes[ \"number\" ] is not None:\n+ if \"number\" in attributes and attributes[ \"number\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"number\" ], int )\n self.__number = attributes[ \"number\" ]\n- if \"open_issues\" in attributes and attributes[ \"open_issues\" ] is not None:\n+ if \"open_issues\" in attributes and attributes[ \"open_issues\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"open_issues\" ], int )\n self.__open_issues = attributes[ \"open_issues\" ]\n- if \"state\" in attributes and attributes[ \"state\" ] is not None:\n+ if \"state\" in attributes and attributes[ \"state\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"state\" ], ( str, unicode ) )\n self.__state = attributes[ \"state\" ]\n- if \"title\" in attributes and attributes[ \"title\" ] is not None:\n+ if \"title\" in attributes and attributes[ \"title\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"title\" ], ( str, unicode ) )\n self.__title = attributes[ \"title\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"url\" ], ( str, unicode ) )\n self.__url = attributes[ \"url\" ]","additions":11,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":52,"deletions":26,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/NamedUser.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/NamedUser.py","filename":"src/github/NamedUser.py","patch":"@@ -365,81 +365,81 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"avatar_url\", \"bio\", \"blog\", \"collaborators\", \"company\", \"contributions\", \"created_at\", \"disk_usage\", \"email\", \"followers\", \"following\", \"gravatar_id\", \"hireable\", \"html_url\", \"id\", \"location\", \"login\", \"name\", \"owned_private_repos\", \"plan\", \"private_gists\", \"public_gists\", \"public_repos\", \"total_private_repos\", \"type\", \"url\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"avatar_url\" in attributes and attributes[ \"avatar_url\" ] is not None:\n+ if \"avatar_url\" in attributes and attributes[ \"avatar_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"avatar_url\" ], ( str, unicode ) )\n self.__avatar_url = attributes[ \"avatar_url\" ]\n- if \"bio\" in attributes and attributes[ \"bio\" ] is not None:\n+ if \"bio\" in attributes and attributes[ \"bio\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"bio\" ], ( str, unicode ) )\n self.__bio = attributes[ \"bio\" ]\n- if \"blog\" in attributes and attributes[ \"blog\" ] is not None:\n+ if \"blog\" in attributes and attributes[ \"blog\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"blog\" ], ( str, unicode ) )\n self.__blog = attributes[ \"blog\" ]\n- if \"collaborators\" in attributes and attributes[ \"collaborators\" ] is not None:\n+ if \"collaborators\" in attributes and attributes[ \"collaborators\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"collaborators\" ], int )\n self.__collaborators = attributes[ \"collaborators\" ]\n- if \"company\" in attributes and attributes[ \"company\" ] is not None:\n+ if \"company\" in attributes and attributes[ \"company\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"company\" ], ( str, unicode ) )\n self.__company = attributes[ \"company\" ]\n- if \"contributions\" in attributes and attributes[ \"contributions\" ] is not None:\n+ if \"contributions\" in attributes and attributes[ \"contributions\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"contributions\" ], int )\n self.__contributions = attributes[ \"contributions\" ]\n- if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None:\n+ if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"created_at\" ], ( str, unicode ) )\n self.__created_at = attributes[ \"created_at\" ]\n- if \"disk_usage\" in attributes and attributes[ \"disk_usage\" ] is not None:\n+ if \"disk_usage\" in attributes and attributes[ \"disk_usage\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"disk_usage\" ], int )\n self.__disk_usage = attributes[ \"disk_usage\" ]\n- if \"email\" in attributes and attributes[ \"email\" ] is not None:\n+ if \"email\" in attributes and attributes[ \"email\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"email\" ], ( str, unicode ) )\n self.__email = attributes[ \"email\" ]\n- if \"followers\" in attributes and attributes[ \"followers\" ] is not None:\n+ if \"followers\" in attributes and attributes[ \"followers\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"followers\" ], int )\n self.__followers = attributes[ \"followers\" ]\n- if \"following\" in attributes and attributes[ \"following\" ] is not None:\n+ if \"following\" in attributes and attributes[ \"following\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"following\" ], int )\n self.__following = attributes[ \"following\" ]\n- if \"gravatar_id\" in attributes and attributes[ \"gravatar_id\" ] is not None:\n+ if \"gravatar_id\" in attributes and attributes[ \"gravatar_id\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"gravatar_id\" ], ( str, unicode ) )\n self.__gravatar_id = attributes[ \"gravatar_id\" ]\n- if \"hireable\" in attributes and attributes[ \"hireable\" ] is not None:\n+ if \"hireable\" in attributes and attributes[ \"hireable\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"hireable\" ], bool )\n self.__hireable = attributes[ \"hireable\" ]\n- if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None:\n+ if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"html_url\" ], ( str, unicode ) )\n self.__html_url = attributes[ \"html_url\" ]\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"id\" ], int )\n self.__id = attributes[ \"id\" ]\n- if \"location\" in attributes and attributes[ \"location\" ] is not None:\n+ if \"location\" in attributes and attributes[ \"location\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"location\" ], ( str, unicode ) )\n self.__location = attributes[ \"location\" ]\n- if \"login\" in attributes and attributes[ \"login\" ] is not None:\n+ if \"login\" in attributes and attributes[ \"login\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"login\" ], ( str, unicode ) )\n self.__login = attributes[ \"login\" ]\n- if \"name\" in attributes and attributes[ \"name\" ] is not None:\n+ if \"name\" in attributes and attributes[ \"name\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"name\" ], ( str, unicode ) )\n self.__name = attributes[ \"name\" ]\n- if \"owned_private_repos\" in attributes and attributes[ \"owned_private_repos\" ] is not None:\n+ if \"owned_private_repos\" in attributes and attributes[ \"owned_private_repos\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"owned_private_repos\" ], int )\n self.__owned_private_repos = attributes[ \"owned_private_repos\" ]\n- if \"plan\" in attributes and attributes[ \"plan\" ] is not None:\n+ if \"plan\" in attributes and attributes[ \"plan\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"plan\" ], dict )\n self.__plan = Plan.Plan( self.__requester, attributes[ \"plan\" ], completion = LazyCompletion )\n- if \"private_gists\" in attributes and attributes[ \"private_gists\" ] is not None:\n+ if \"private_gists\" in attributes and attributes[ \"private_gists\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"private_gists\" ], int )\n self.__private_gists = attributes[ \"private_gists\" ]\n- if \"public_gists\" in attributes and attributes[ \"public_gists\" ] is not None:\n+ if \"public_gists\" in attributes and attributes[ \"public_gists\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"public_gists\" ], int )\n self.__public_gists = attributes[ \"public_gists\" ]\n- if \"public_repos\" in attributes and attributes[ \"public_repos\" ] is not None:\n+ if \"public_repos\" in attributes and attributes[ \"public_repos\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"public_repos\" ], int )\n self.__public_repos = attributes[ \"public_repos\" ]\n- if \"total_private_repos\" in attributes and attributes[ \"total_private_repos\" ] is not None:\n+ if \"total_private_repos\" in attributes and attributes[ \"total_private_repos\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"total_private_repos\" ], int )\n self.__total_private_repos = attributes[ \"total_private_repos\" ]\n- if \"type\" in attributes and attributes[ \"type\" ] is not None:\n+ if \"type\" in attributes and attributes[ \"type\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"type\" ], ( str, unicode ) )\n self.__type = attributes[ \"type\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"url\" ], ( str, unicode ) )\n self.__url = attributes[ \"url\" ]","additions":26,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":48,"deletions":24,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Organization.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Organization.py","filename":"src/github/Organization.py","patch":"@@ -390,75 +390,75 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"avatar_url\", \"billing_email\", \"blog\", \"collaborators\", \"company\", \"created_at\", \"disk_usage\", \"email\", \"followers\", \"following\", \"gravatar_id\", \"html_url\", \"id\", \"location\", \"login\", \"name\", \"owned_private_repos\", \"plan\", \"private_gists\", \"public_gists\", \"public_repos\", \"total_private_repos\", \"type\", \"url\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"avatar_url\" in attributes and attributes[ \"avatar_url\" ] is not None:\n+ if \"avatar_url\" in attributes and attributes[ \"avatar_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"avatar_url\" ], ( str, unicode ) )\n self.__avatar_url = attributes[ \"avatar_url\" ]\n- if \"billing_email\" in attributes and attributes[ \"billing_email\" ] is not None:\n+ if \"billing_email\" in attributes and attributes[ \"billing_email\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"billing_email\" ], ( str, unicode ) )\n self.__billing_email = attributes[ \"billing_email\" ]\n- if \"blog\" in attributes and attributes[ \"blog\" ] is not None:\n+ if \"blog\" in attributes and attributes[ \"blog\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"blog\" ], ( str, unicode ) )\n self.__blog = attributes[ \"blog\" ]\n- if \"collaborators\" in attributes and attributes[ \"collaborators\" ] is not None:\n+ if \"collaborators\" in attributes and attributes[ \"collaborators\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"collaborators\" ], int )\n self.__collaborators = attributes[ \"collaborators\" ]\n- if \"company\" in attributes and attributes[ \"company\" ] is not None:\n+ if \"company\" in attributes and attributes[ \"company\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"company\" ], ( str, unicode ) )\n self.__company = attributes[ \"company\" ]\n- if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None:\n+ if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"created_at\" ], ( str, unicode ) )\n self.__created_at = attributes[ \"created_at\" ]\n- if \"disk_usage\" in attributes and attributes[ \"disk_usage\" ] is not None:\n+ if \"disk_usage\" in attributes and attributes[ \"disk_usage\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"disk_usage\" ], int )\n self.__disk_usage = attributes[ \"disk_usage\" ]\n- if \"email\" in attributes and attributes[ \"email\" ] is not None:\n+ if \"email\" in attributes and attributes[ \"email\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"email\" ], ( str, unicode ) )\n self.__email = attributes[ \"email\" ]\n- if \"followers\" in attributes and attributes[ \"followers\" ] is not None:\n+ if \"followers\" in attributes and attributes[ \"followers\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"followers\" ], int )\n self.__followers = attributes[ \"followers\" ]\n- if \"following\" in attributes and attributes[ \"following\" ] is not None:\n+ if \"following\" in attributes and attributes[ \"following\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"following\" ], int )\n self.__following = attributes[ \"following\" ]\n- if \"gravatar_id\" in attributes and attributes[ \"gravatar_id\" ] is not None:\n+ if \"gravatar_id\" in attributes and attributes[ \"gravatar_id\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"gravatar_id\" ], ( str, unicode ) )\n self.__gravatar_id = attributes[ \"gravatar_id\" ]\n- if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None:\n+ if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"html_url\" ], ( str, unicode ) )\n self.__html_url = attributes[ \"html_url\" ]\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"id\" ], int )\n self.__id = attributes[ \"id\" ]\n- if \"location\" in attributes and attributes[ \"location\" ] is not None:\n+ if \"location\" in attributes and attributes[ \"location\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"location\" ], ( str, unicode ) )\n self.__location = attributes[ \"location\" ]\n- if \"login\" in attributes and attributes[ \"login\" ] is not None:\n+ if \"login\" in attributes and attributes[ \"login\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"login\" ], ( str, unicode ) )\n self.__login = attributes[ \"login\" ]\n- if \"name\" in attributes and attributes[ \"name\" ] is not None:\n+ if \"name\" in attributes and attributes[ \"name\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"name\" ], ( str, unicode ) )\n self.__name = attributes[ \"name\" ]\n- if \"owned_private_repos\" in attributes and attributes[ \"owned_private_repos\" ] is not None:\n+ if \"owned_private_repos\" in attributes and attributes[ \"owned_private_repos\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"owned_private_repos\" ], int )\n self.__owned_private_repos = attributes[ \"owned_private_repos\" ]\n- if \"plan\" in attributes and attributes[ \"plan\" ] is not None:\n+ if \"plan\" in attributes and attributes[ \"plan\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"plan\" ], dict )\n self.__plan = Plan.Plan( self.__requester, attributes[ \"plan\" ], completion = LazyCompletion )\n- if \"private_gists\" in attributes and attributes[ \"private_gists\" ] is not None:\n+ if \"private_gists\" in attributes and attributes[ \"private_gists\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"private_gists\" ], int )\n self.__private_gists = attributes[ \"private_gists\" ]\n- if \"public_gists\" in attributes and attributes[ \"public_gists\" ] is not None:\n+ if \"public_gists\" in attributes and attributes[ \"public_gists\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"public_gists\" ], int )\n self.__public_gists = attributes[ \"public_gists\" ]\n- if \"public_repos\" in attributes and attributes[ \"public_repos\" ] is not None:\n+ if \"public_repos\" in attributes and attributes[ \"public_repos\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"public_repos\" ], int )\n self.__public_repos = attributes[ \"public_repos\" ]\n- if \"total_private_repos\" in attributes and attributes[ \"total_private_repos\" ] is not None:\n+ if \"total_private_repos\" in attributes and attributes[ \"total_private_repos\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"total_private_repos\" ], int )\n self.__total_private_repos = attributes[ \"total_private_repos\" ]\n- if \"type\" in attributes and attributes[ \"type\" ] is not None:\n+ if \"type\" in attributes and attributes[ \"type\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"type\" ], ( str, unicode ) )\n self.__type = attributes[ \"type\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"url\" ], ( str, unicode ) )\n self.__url = attributes[ \"url\" ]","additions":24,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":6,"deletions":3,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Permissions.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Permissions.py","filename":"src/github/Permissions.py","patch":"@@ -32,12 +32,12 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"admin\", \"pull\", \"push\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"admin\" in attributes and attributes[ \"admin\" ] is not None:\n+ if \"admin\" in attributes and attributes[ \"admin\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"admin\" ], bool )\n self.__admin = attributes[ \"admin\" ]\n- if \"pull\" in attributes and attributes[ \"pull\" ] is not None:\n+ if \"pull\" in attributes and attributes[ \"pull\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"pull\" ], bool )\n self.__pull = attributes[ \"pull\" ]\n- if \"push\" in attributes and attributes[ \"push\" ] is not None:\n+ if \"push\" in attributes and attributes[ \"push\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"push\" ], bool )\n self.__push = attributes[ \"push\" ]","additions":3,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":8,"deletions":4,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Plan.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Plan.py","filename":"src/github/Plan.py","patch":"@@ -37,15 +37,15 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"collaborators\", \"name\", \"private_repos\", \"space\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"collaborators\" in attributes and attributes[ \"collaborators\" ] is not None:\n+ if \"collaborators\" in attributes and attributes[ \"collaborators\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"collaborators\" ], int )\n self.__collaborators = attributes[ \"collaborators\" ]\n- if \"name\" in attributes and attributes[ \"name\" ] is not None:\n+ if \"name\" in attributes and attributes[ \"name\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"name\" ], ( str, unicode ) )\n self.__name = attributes[ \"name\" ]\n- if \"private_repos\" in attributes and attributes[ \"private_repos\" ] is not None:\n+ if \"private_repos\" in attributes and attributes[ \"private_repos\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"private_repos\" ], int )\n self.__private_repos = attributes[ \"private_repos\" ]\n- if \"space\" in attributes and attributes[ \"space\" ] is not None:\n+ if \"space\" in attributes and attributes[ \"space\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"space\" ], int )\n self.__space = attributes[ \"space\" ]","additions":4,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":52,"deletions":26,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/PullRequest.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/PullRequest.py","filename":"src/github/PullRequest.py","patch":"@@ -279,56 +279,56 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"additions\", \"base\", \"body\", \"changed_files\", \"closed_at\", \"comments\", \"commits\", \"created_at\", \"deletions\", \"diff_url\", \"head\", \"html_url\", \"id\", \"issue_url\", \"mergeable\", \"merged\", \"merged_at\", \"merged_by\", \"number\", \"patch_url\", \"review_comments\", \"state\", \"title\", \"updated_at\", \"url\", \"user\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"additions\" in attributes and attributes[ \"additions\" ] is not None:\n+ if \"additions\" in attributes and attributes[ \"additions\" ] is not None: # pragma no branch\n self.__additions = attributes[ \"additions\" ]\n- if \"base\" in attributes and attributes[ \"base\" ] is not None:\n+ if \"base\" in attributes and attributes[ \"base\" ] is not None: # pragma no branch\n self.__base = attributes[ \"base\" ]\n- if \"body\" in attributes and attributes[ \"body\" ] is not None:\n+ if \"body\" in attributes and attributes[ \"body\" ] is not None: # pragma no branch\n self.__body = attributes[ \"body\" ]\n- if \"changed_files\" in attributes and attributes[ \"changed_files\" ] is not None:\n+ if \"changed_files\" in attributes and attributes[ \"changed_files\" ] is not None: # pragma no branch\n self.__changed_files = attributes[ \"changed_files\" ]\n- if \"closed_at\" in attributes and attributes[ \"closed_at\" ] is not None:\n+ if \"closed_at\" in attributes and attributes[ \"closed_at\" ] is not None: # pragma no branch\n self.__closed_at = attributes[ \"closed_at\" ]\n- if \"comments\" in attributes and attributes[ \"comments\" ] is not None:\n+ if \"comments\" in attributes and attributes[ \"comments\" ] is not None: # pragma no branch\n self.__comments = attributes[ \"comments\" ]\n- if \"commits\" in attributes and attributes[ \"commits\" ] is not None:\n+ if \"commits\" in attributes and attributes[ \"commits\" ] is not None: # pragma no branch\n self.__commits = attributes[ \"commits\" ]\n- if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None:\n+ if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None: # pragma no branch\n self.__created_at = attributes[ \"created_at\" ]\n- if \"deletions\" in attributes and attributes[ \"deletions\" ] is not None:\n+ if \"deletions\" in attributes and attributes[ \"deletions\" ] is not None: # pragma no branch\n self.__deletions = attributes[ \"deletions\" ]\n- if \"diff_url\" in attributes and attributes[ \"diff_url\" ] is not None:\n+ if \"diff_url\" in attributes and attributes[ \"diff_url\" ] is not None: # pragma no branch\n self.__diff_url = attributes[ \"diff_url\" ]\n- if \"head\" in attributes and attributes[ \"head\" ] is not None:\n+ if \"head\" in attributes and attributes[ \"head\" ] is not None: # pragma no branch\n self.__head = attributes[ \"head\" ]\n- if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None:\n+ if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None: # pragma no branch\n self.__html_url = attributes[ \"html_url\" ]\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n self.__id = attributes[ \"id\" ]\n- if \"issue_url\" in attributes and attributes[ \"issue_url\" ] is not None:\n+ if \"issue_url\" in attributes and attributes[ \"issue_url\" ] is not None: # pragma no branch\n self.__issue_url = attributes[ \"issue_url\" ]\n- if \"mergeable\" in attributes and attributes[ \"mergeable\" ] is not None:\n+ if \"mergeable\" in attributes and attributes[ \"mergeable\" ] is not None: # pragma no branch\n self.__mergeable = attributes[ \"mergeable\" ]\n- if \"merged\" in attributes and attributes[ \"merged\" ] is not None:\n+ if \"merged\" in attributes and attributes[ \"merged\" ] is not None: # pragma no branch\n self.__merged = attributes[ \"merged\" ]\n- if \"merged_at\" in attributes and attributes[ \"merged_at\" ] is not None:\n+ if \"merged_at\" in attributes and attributes[ \"merged_at\" ] is not None: # pragma no branch\n self.__merged_at = attributes[ \"merged_at\" ]\n- if \"merged_by\" in attributes and attributes[ \"merged_by\" ] is not None:\n+ if \"merged_by\" in attributes and attributes[ \"merged_by\" ] is not None: # pragma no branch\n self.__merged_by = attributes[ \"merged_by\" ]\n- if \"number\" in attributes and attributes[ \"number\" ] is not None:\n+ if \"number\" in attributes and attributes[ \"number\" ] is not None: # pragma no branch\n self.__number = attributes[ \"number\" ]\n- if \"patch_url\" in attributes and attributes[ \"patch_url\" ] is not None:\n+ if \"patch_url\" in attributes and attributes[ \"patch_url\" ] is not None: # pragma no branch\n self.__patch_url = attributes[ \"patch_url\" ]\n- if \"review_comments\" in attributes and attributes[ \"review_comments\" ] is not None:\n+ if \"review_comments\" in attributes and attributes[ \"review_comments\" ] is not None: # pragma no branch\n self.__review_comments = attributes[ \"review_comments\" ]\n- if \"state\" in attributes and attributes[ \"state\" ] is not None:\n+ if \"state\" in attributes and attributes[ \"state\" ] is not None: # pragma no branch\n self.__state = attributes[ \"state\" ]\n- if \"title\" in attributes and attributes[ \"title\" ] is not None:\n+ if \"title\" in attributes and attributes[ \"title\" ] is not None: # pragma no branch\n self.__title = attributes[ \"title\" ]\n- if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None:\n+ if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None: # pragma no branch\n self.__updated_at = attributes[ \"updated_at\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n self.__url = attributes[ \"url\" ]\n- if \"user\" in attributes and attributes[ \"user\" ] is not None:\n+ if \"user\" in attributes and attributes[ \"user\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"user\" ], dict )\n self.__user = NamedUser.NamedUser( self.__requester, attributes[ \"user\" ], completion = LazyCompletion )","additions":26,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":22,"deletions":11,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/PullRequestComment.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/PullRequestComment.py","filename":"src/github/PullRequestComment.py","patch":"@@ -121,26 +121,26 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"body\", \"commit_id\", \"created_at\", \"html_url\", \"id\", \"line\", \"path\", \"position\", \"updated_at\", \"url\", \"user\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"body\" in attributes and attributes[ \"body\" ] is not None:\n+ if \"body\" in attributes and attributes[ \"body\" ] is not None: # pragma no branch\n self.__body = attributes[ \"body\" ]\n- if \"commit_id\" in attributes and attributes[ \"commit_id\" ] is not None:\n+ if \"commit_id\" in attributes and attributes[ \"commit_id\" ] is not None: # pragma no branch\n self.__commit_id = attributes[ \"commit_id\" ]\n- if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None:\n+ if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None: # pragma no branch\n self.__created_at = attributes[ \"created_at\" ]\n- if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None:\n+ if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None: # pragma no branch\n self.__html_url = attributes[ \"html_url\" ]\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n self.__id = attributes[ \"id\" ]\n- if \"line\" in attributes and attributes[ \"line\" ] is not None:\n+ if \"line\" in attributes and attributes[ \"line\" ] is not None: # pragma no branch\n self.__line = attributes[ \"line\" ]\n- if \"path\" in attributes and attributes[ \"path\" ] is not None:\n+ if \"path\" in attributes and attributes[ \"path\" ] is not None: # pragma no branch\n self.__path = attributes[ \"path\" ]\n- if \"position\" in attributes and attributes[ \"position\" ] is not None:\n+ if \"position\" in attributes and attributes[ \"position\" ] is not None: # pragma no branch\n self.__position = attributes[ \"position\" ]\n- if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None:\n+ if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None: # pragma no branch\n self.__updated_at = attributes[ \"updated_at\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n self.__url = attributes[ \"url\" ]\n- if \"user\" in attributes and attributes[ \"user\" ] is not None:\n+ if \"user\" in attributes and attributes[ \"user\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"user\" ], dict )\n self.__user = NamedUser.NamedUser( self.__requester, attributes[ \"user\" ], completion = LazyCompletion )","additions":11,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":18,"deletions":9,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/PullRequestFile.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/PullRequestFile.py","filename":"src/github/PullRequestFile.py","patch":"@@ -62,21 +62,21 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"additions\", \"blob_url\", \"changes\", \"deletions\", \"filename\", \"patch\", \"raw_url\", \"sha\", \"status\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"additions\" in attributes and attributes[ \"additions\" ] is not None:\n+ if \"additions\" in attributes and attributes[ \"additions\" ] is not None: # pragma no branch\n self.__additions = attributes[ \"additions\" ]\n- if \"blob_url\" in attributes and attributes[ \"blob_url\" ] is not None:\n+ if \"blob_url\" in attributes and attributes[ \"blob_url\" ] is not None: # pragma no branch\n self.__blob_url = attributes[ \"blob_url\" ]\n- if \"changes\" in attributes and attributes[ \"changes\" ] is not None:\n+ if \"changes\" in attributes and attributes[ \"changes\" ] is not None: # pragma no branch\n self.__changes = attributes[ \"changes\" ]\n- if \"deletions\" in attributes and attributes[ \"deletions\" ] is not None:\n+ if \"deletions\" in attributes and attributes[ \"deletions\" ] is not None: # pragma no branch\n self.__deletions = attributes[ \"deletions\" ]\n- if \"filename\" in attributes and attributes[ \"filename\" ] is not None:\n+ if \"filename\" in attributes and attributes[ \"filename\" ] is not None: # pragma no branch\n self.__filename = attributes[ \"filename\" ]\n- if \"patch\" in attributes and attributes[ \"patch\" ] is not None:\n+ if \"patch\" in attributes and attributes[ \"patch\" ] is not None: # pragma no branch\n self.__patch = attributes[ \"patch\" ]\n- if \"raw_url\" in attributes and attributes[ \"raw_url\" ] is not None:\n+ if \"raw_url\" in attributes and attributes[ \"raw_url\" ] is not None: # pragma no branch\n self.__raw_url = attributes[ \"raw_url\" ]\n- if \"sha\" in attributes and attributes[ \"sha\" ] is not None:\n+ if \"sha\" in attributes and attributes[ \"sha\" ] is not None: # pragma no branch\n self.__sha = attributes[ \"sha\" ]\n- if \"status\" in attributes and attributes[ \"status\" ] is not None:\n+ if \"status\" in attributes and attributes[ \"status\" ] is not None: # pragma no branch\n self.__status = attributes[ \"status\" ]","additions":9,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":62,"deletions":31,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Repository.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Repository.py","filename":"src/github/Repository.py","patch":"@@ -905,96 +905,96 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"clone_url\", \"created_at\", \"description\", \"fork\", \"forks\", \"full_name\", \"git_url\", \"has_downloads\", \"has_issues\", \"has_wiki\", \"homepage\", \"html_url\", \"id\", \"language\", \"master_branch\", \"mirror_url\", \"name\", \"open_issues\", \"organization\", \"owner\", \"parent\", \"permissions\", \"private\", \"pushed_at\", \"size\", \"source\", \"ssh_url\", \"svn_url\", \"updated_at\", \"url\", \"watchers\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"clone_url\" in attributes and attributes[ \"clone_url\" ] is not None:\n+ if \"clone_url\" in attributes and attributes[ \"clone_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"clone_url\" ], ( str, unicode ) )\n self.__clone_url = attributes[ \"clone_url\" ]\n- if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None:\n+ if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"created_at\" ], ( str, unicode ) )\n self.__created_at = attributes[ \"created_at\" ]\n- if \"description\" in attributes and attributes[ \"description\" ] is not None:\n+ if \"description\" in attributes and attributes[ \"description\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"description\" ], ( str, unicode ) )\n self.__description = attributes[ \"description\" ]\n- if \"fork\" in attributes and attributes[ \"fork\" ] is not None:\n+ if \"fork\" in attributes and attributes[ \"fork\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"fork\" ], bool )\n self.__fork = attributes[ \"fork\" ]\n- if \"forks\" in attributes and attributes[ \"forks\" ] is not None:\n+ if \"forks\" in attributes and attributes[ \"forks\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"forks\" ], int )\n self.__forks = attributes[ \"forks\" ]\n- if \"full_name\" in attributes and attributes[ \"full_name\" ] is not None:\n+ if \"full_name\" in attributes and attributes[ \"full_name\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"full_name\" ], ( str, unicode ) )\n self.__full_name = attributes[ \"full_name\" ]\n- if \"git_url\" in attributes and attributes[ \"git_url\" ] is not None:\n+ if \"git_url\" in attributes and attributes[ \"git_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"git_url\" ], ( str, unicode ) )\n self.__git_url = attributes[ \"git_url\" ]\n- if \"has_downloads\" in attributes and attributes[ \"has_downloads\" ] is not None:\n+ if \"has_downloads\" in attributes and attributes[ \"has_downloads\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"has_downloads\" ], bool )\n self.__has_downloads = attributes[ \"has_downloads\" ]\n- if \"has_issues\" in attributes and attributes[ \"has_issues\" ] is not None:\n+ if \"has_issues\" in attributes and attributes[ \"has_issues\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"has_issues\" ], bool )\n self.__has_issues = attributes[ \"has_issues\" ]\n- if \"has_wiki\" in attributes and attributes[ \"has_wiki\" ] is not None:\n+ if \"has_wiki\" in attributes and attributes[ \"has_wiki\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"has_wiki\" ], bool )\n self.__has_wiki = attributes[ \"has_wiki\" ]\n- if \"homepage\" in attributes and attributes[ \"homepage\" ] is not None:\n+ if \"homepage\" in attributes and attributes[ \"homepage\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"homepage\" ], ( str, unicode ) )\n self.__homepage = attributes[ \"homepage\" ]\n- if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None:\n+ if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"html_url\" ], ( str, unicode ) )\n self.__html_url = attributes[ \"html_url\" ]\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"id\" ], int )\n self.__id = attributes[ \"id\" ]\n- if \"language\" in attributes and attributes[ \"language\" ] is not None:\n+ if \"language\" in attributes and attributes[ \"language\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"language\" ], ( str, unicode ) )\n self.__language = attributes[ \"language\" ]\n- if \"master_branch\" in attributes and attributes[ \"master_branch\" ] is not None:\n+ if \"master_branch\" in attributes and attributes[ \"master_branch\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"master_branch\" ], ( str, unicode ) )\n self.__master_branch = attributes[ \"master_branch\" ]\n- if \"mirror_url\" in attributes and attributes[ \"mirror_url\" ] is not None:\n+ if \"mirror_url\" in attributes and attributes[ \"mirror_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"mirror_url\" ], ( str, unicode ) )\n self.__mirror_url = attributes[ \"mirror_url\" ]\n- if \"name\" in attributes and attributes[ \"name\" ] is not None:\n+ if \"name\" in attributes and attributes[ \"name\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"name\" ], ( str, unicode ) )\n self.__name = attributes[ \"name\" ]\n- if \"open_issues\" in attributes and attributes[ \"open_issues\" ] is not None:\n+ if \"open_issues\" in attributes and attributes[ \"open_issues\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"open_issues\" ], int )\n self.__open_issues = attributes[ \"open_issues\" ]\n- if \"organization\" in attributes and attributes[ \"organization\" ] is not None:\n+ if \"organization\" in attributes and attributes[ \"organization\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"organization\" ], dict )\n self.__organization = Organization.Organization( self.__requester, attributes[ \"organization\" ], completion = LazyCompletion )\n- if \"owner\" in attributes and attributes[ \"owner\" ] is not None:\n+ if \"owner\" in attributes and attributes[ \"owner\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"owner\" ], dict )\n self.__owner = NamedUser.NamedUser( self.__requester, attributes[ \"owner\" ], completion = LazyCompletion )\n- if \"parent\" in attributes and attributes[ \"parent\" ] is not None:\n+ if \"parent\" in attributes and attributes[ \"parent\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"parent\" ], dict )\n self.__parent = Repository( self.__requester, attributes[ \"parent\" ], completion = LazyCompletion )\n- if \"permissions\" in attributes and attributes[ \"permissions\" ] is not None:\n+ if \"permissions\" in attributes and attributes[ \"permissions\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"permissions\" ], dict )\n self.__permissions = Permissions.Permissions( self.__requester, attributes[ \"permissions\" ], completion = LazyCompletion )\n- if \"private\" in attributes and attributes[ \"private\" ] is not None:\n+ if \"private\" in attributes and attributes[ \"private\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"private\" ], bool )\n self.__private = attributes[ \"private\" ]\n- if \"pushed_at\" in attributes and attributes[ \"pushed_at\" ] is not None:\n+ if \"pushed_at\" in attributes and attributes[ \"pushed_at\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"pushed_at\" ], ( str, unicode ) )\n self.__pushed_at = attributes[ \"pushed_at\" ]\n- if \"size\" in attributes and attributes[ \"size\" ] is not None:\n+ if \"size\" in attributes and attributes[ \"size\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"size\" ], int )\n self.__size = attributes[ \"size\" ]\n- if \"source\" in attributes and attributes[ \"source\" ] is not None:\n+ if \"source\" in attributes and attributes[ \"source\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"source\" ], dict )\n self.__source = Repository( self.__requester, attributes[ \"source\" ], completion = LazyCompletion )\n- if \"ssh_url\" in attributes and attributes[ \"ssh_url\" ] is not None:\n+ if \"ssh_url\" in attributes and attributes[ \"ssh_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"ssh_url\" ], ( str, unicode ) )\n self.__ssh_url = attributes[ \"ssh_url\" ]\n- if \"svn_url\" in attributes and attributes[ \"svn_url\" ] is not None:\n+ if \"svn_url\" in attributes and attributes[ \"svn_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"svn_url\" ], ( str, unicode ) )\n self.__svn_url = attributes[ \"svn_url\" ]\n- if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None:\n+ if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"updated_at\" ], ( str, unicode ) )\n self.__updated_at = attributes[ \"updated_at\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"url\" ], ( str, unicode ) )\n self.__url = attributes[ \"url\" ]\n- if \"watchers\" in attributes and attributes[ \"watchers\" ] is not None:\n+ if \"watchers\" in attributes and attributes[ \"watchers\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"watchers\" ], int )\n self.__watchers = attributes[ \"watchers\" ]","additions":31,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":10,"deletions":5,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/RepositoryKey.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/RepositoryKey.py","filename":"src/github/RepositoryKey.py","patch":"@@ -87,14 +87,14 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"id\", \"key\", \"title\", \"url\", \"verified\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n self.__id = attributes[ \"id\" ]\n- if \"key\" in attributes and attributes[ \"key\" ] is not None:\n+ if \"key\" in attributes and attributes[ \"key\" ] is not None: # pragma no branch\n self.__key = attributes[ \"key\" ]\n- if \"title\" in attributes and attributes[ \"title\" ] is not None:\n+ if \"title\" in attributes and attributes[ \"title\" ] is not None: # pragma no branch\n self.__title = attributes[ \"title\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n self.__url = attributes[ \"url\" ]\n- if \"verified\" in attributes and attributes[ \"verified\" ] is not None:\n+ if \"verified\" in attributes and attributes[ \"verified\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"verified\" ], bool )\n self.__verified = attributes[ \"verified\" ]","additions":5,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":8,"deletions":4,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Tag.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Tag.py","filename":"src/github/Tag.py","patch":"@@ -38,15 +38,15 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"commit\", \"name\", \"tarball_url\", \"zipball_url\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"commit\" in attributes and attributes[ \"commit\" ] is not None:\n+ if \"commit\" in attributes and attributes[ \"commit\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"commit\" ], dict )\n self.__commit = Commit.Commit( self.__requester, attributes[ \"commit\" ], completion = LazyCompletion )\n- if \"name\" in attributes and attributes[ \"name\" ] is not None:\n+ if \"name\" in attributes and attributes[ \"name\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"name\" ], ( str, unicode ) )\n self.__name = attributes[ \"name\" ]\n- if \"tarball_url\" in attributes and attributes[ \"tarball_url\" ] is not None:\n+ if \"tarball_url\" in attributes and attributes[ \"tarball_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"tarball_url\" ], ( str, unicode ) )\n self.__tarball_url = attributes[ \"tarball_url\" ]\n- if \"zipball_url\" in attributes and attributes[ \"zipball_url\" ] is not None:\n+ if \"zipball_url\" in attributes and attributes[ \"zipball_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"zipball_url\" ], ( str, unicode ) )\n self.__zipball_url = attributes[ \"zipball_url\" ]","additions":4,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":12,"deletions":6,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Team.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Team.py","filename":"src/github/Team.py","patch":"@@ -172,15 +172,15 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"id\", \"members_count\", \"name\", \"permission\", \"repos_count\", \"url\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n self.__id = attributes[ \"id\" ]\n- if \"members_count\" in attributes and attributes[ \"members_count\" ] is not None:\n+ if \"members_count\" in attributes and attributes[ \"members_count\" ] is not None: # pragma no branch\n self.__members_count = attributes[ \"members_count\" ]\n- if \"name\" in attributes and attributes[ \"name\" ] is not None:\n+ if \"name\" in attributes and attributes[ \"name\" ] is not None: # pragma no branch\n self.__name = attributes[ \"name\" ]\n- if \"permission\" in attributes and attributes[ \"permission\" ] is not None:\n+ if \"permission\" in attributes and attributes[ \"permission\" ] is not None: # pragma no branch\n self.__permission = attributes[ \"permission\" ]\n- if \"repos_count\" in attributes and attributes[ \"repos_count\" ] is not None:\n+ if \"repos_count\" in attributes and attributes[ \"repos_count\" ] is not None: # pragma no branch\n self.__repos_count = attributes[ \"repos_count\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n self.__url = attributes[ \"url\" ]","additions":6,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":10,"deletions":5,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/UserKey.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/UserKey.py","filename":"src/github/UserKey.py","patch":"@@ -87,14 +87,14 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"id\", \"key\", \"title\", \"url\", \"verified\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n self.__id = attributes[ \"id\" ]\n- if \"key\" in attributes and attributes[ \"key\" ] is not None:\n+ if \"key\" in attributes and attributes[ \"key\" ] is not None: # pragma no branch\n self.__key = attributes[ \"key\" ]\n- if \"title\" in attributes and attributes[ \"title\" ] is not None:\n+ if \"title\" in attributes and attributes[ \"title\" ] is not None: # pragma no branch\n self.__title = attributes[ \"title\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n self.__url = attributes[ \"url\" ]\n- if \"verified\" in attributes and attributes[ \"verified\" ] is not None:\n+ if \"verified\" in attributes and attributes[ \"verified\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"verified\" ], bool )\n self.__verified = attributes[ \"verified\" ]","additions":5,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":26,"deletions":1,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/test/Issue.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/test/Issue.py","filename":"test/Issue.py","patch":"@@ -3,7 +3,8 @@\n class Issue( Framework.TestCase ):\r\n def setUp( self ):\r\n Framework.TestCase.setUp( self )\r\n- self.issue = self.g.get_user().get_repo( \"PyGithub\" ).get_issue( 28 )\r\n+ self.repo = self.g.get_user().get_repo( \"PyGithub\" )\r\n+ self.issue = self.repo.get_issue( 28 )\r\n \r\n def testAttributes( self ):\r\n self.assertEqual( self.issue.assignee.login, \"jacquev6\" )\r\n@@ -47,3 +48,26 @@ def testGetComments( self ):\n \r\n def testGetEvents( self ):\r\n self.assertListKeyEqual( self.issue.get_events(), lambda e: e.id, [ 15819975, 15820048 ] )\r\n+\r\n+ def testGetLabels( self ):\r\n+ self.assertListKeyEqual( self.issue.get_labels(), lambda l: l.name, [ \"Bug\", \"Project management\", \"Question\" ] )\r\n+\r\n+ def testAddAndRemoveLabels( self ):\r\n+ bug = self.repo.get_label( \"Bug\" )\r\n+ question = self.repo.get_label( \"Question\" )\r\n+ self.assertListKeyEqual( self.issue.get_labels(), lambda l: l.name, [ \"Bug\", \"Project management\", \"Question\" ] )\r\n+ self.issue.remove_from_labels( bug )\r\n+ self.assertListKeyEqual( self.issue.get_labels(), lambda l: l.name, [ \"Project management\", \"Question\" ] )\r\n+ self.issue.remove_from_labels( question )\r\n+ self.assertListKeyEqual( self.issue.get_labels(), lambda l: l.name, [ \"Project management\" ] )\r\n+ self.issue.add_to_labels( bug, question )\r\n+ self.assertListKeyEqual( self.issue.get_labels(), lambda l: l.name, [ \"Bug\", \"Project management\", \"Question\" ] )\r\n+\r\n+ def testDeleteAndSetLabels( self ):\r\n+ bug = self.repo.get_label( \"Bug\" )\r\n+ question = self.repo.get_label( \"Question\" )\r\n+ self.assertListKeyEqual( self.issue.get_labels(), lambda l: l.name, [ \"Bug\", \"Project management\", \"Question\" ] )\r\n+ self.issue.delete_labels()\r\n+ self.assertListKeyEqual( self.issue.get_labels(), lambda l: l.name, [] )\r\n+ self.issue.set_labels( bug, question )\r\n+ self.assertListKeyEqual( self.issue.get_labels(), lambda l: l.name, [ \"Bug\", \"Question\" ] )\r","additions":25,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":14,"deletions":7,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/test/IssueEvent.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/test/IssueEvent.py","filename":"test/IssueEvent.py","patch":"@@ -3,13 +3,13 @@\n class IssueEvent( Framework.TestCase ):\r\n def setUp( self ):\r\n Framework.TestCase.setUp( self )\r\n- self.event = self.g.get_user().get_repo( \"PyGithub\" ).get_issues_event( 15819975 )\r\n+ self.event = self.g.get_user().get_repo( \"PyGithub\" ).get_issues_event( 16348656 )\r\n \r\n def testAttributes( self ):\r\n self.assertEqual( self.event.actor.login, \"jacquev6\" )\r\n- self.assertEqual( self.event.commit_id, None )\r\n- self.assertEqual( self.event.created_at, \"2012-05-19T10:38:23Z\" )\r\n- self.assertEqual( self.event.event, \"subscribed\" )\r\n- self.assertEqual( self.event.id, 15819975 )\r\n- self.assertEqual( self.event.issue.number, 28 )\r\n- self.assertEqual( self.event.url, \"https://api.github.com/repos/jacquev6/PyGithub/issues/events/15819975\" )\r\n+ self.assertEqual( self.event.commit_id, \"ed866fc43833802ab553e5ff8581c81bb00dd433\" )\r\n+ self.assertEqual( self.event.created_at, \"2012-05-27T07:29:25Z\" )\r\n+ self.assertEqual( self.event.event, \"referenced\" )\r\n+ self.assertEqual( self.event.id, 16348656 )\r\n+ self.assertEqual( self.event.issue.number, 30 )\r\n+ self.assertEqual( self.event.url, \"https://api.github.com/repos/jacquev6/PyGithub/issues/events/16348656\" )\r","additions":7,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"added","changes":45,"deletions":0,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/test/ReplayData/Issue.testAddAndRemoveLabels.txt","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/test/ReplayData/Issue.testAddAndRemoveLabels.txt","filename":"test/ReplayData/Issue.testAddAndRemoveLabels.txt","patch":"@@ -0,0 +1,45 @@\n+GET /repos/jacquev6/PyGithub/labels/Bug {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4992'), ('content-length', '97'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"569c414d87e8ec43ec269a9e28bc2982\"'), ('date', 'Sun, 27 May 2012 09:04:01 GMT'), ('content-type', 'application/json; charset=utf-8')]\n+{\"color\":\"e10c02\",\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug\",\"name\":\"Bug\"}\n+\n+GET /repos/jacquev6/PyGithub/labels/Question {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4991'), ('content-length', '107'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"b659c8dcc1212c71f826547c3cc7ae99\"'), ('date', 'Sun, 27 May 2012 09:04:02 GMT'), ('content-type', 'application/json; charset=utf-8')]\n+{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\",\"color\":\"02e10c\"}\n+\n+GET /repos/jacquev6/PyGithub/issues/28/labels {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4990'), ('content-length', '335'), ('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')]\n+[{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug\",\"name\":\"Bug\",\"color\":\"e10c02\"},{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Project+management\",\"name\":\"Project management\",\"color\":\"444444\"},{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\",\"color\":\"02e10c\"}]\n+\n+DELETE /repos/jacquev6/PyGithub/issues/28/labels/Bug {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4989'), ('content-length', '237'), ('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')]\n+[{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Project+management\",\"name\":\"Project management\",\"color\":\"444444\"},{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\",\"color\":\"02e10c\"}]\n+\n+GET /repos/jacquev6/PyGithub/issues/28/labels {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4988'), ('content-length', '237'), ('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')]\n+[{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Project+management\",\"name\":\"Project management\",\"color\":\"444444\"},{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\",\"color\":\"02e10c\"}]\n+\n+DELETE /repos/jacquev6/PyGithub/issues/28/labels/Question {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4987'), ('content-length', '129'), ('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')]\n+[{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Project+management\",\"name\":\"Project management\",\"color\":\"444444\"}]\n+\n+GET /repos/jacquev6/PyGithub/issues/28/labels {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4986'), ('content-length', '129'), ('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')]\n+[{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Project+management\",\"name\":\"Project management\",\"color\":\"444444\"}]\n+\n+POST /repos/jacquev6/PyGithub/issues/28/labels {'Authorization': 'Basic login_and_password_removed'} [\"Bug\", \"Question\"]\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4985'), ('content-length', '335'), ('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')]\n+[{\"color\":\"e10c02\",\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug\",\"name\":\"Bug\"},{\"color\":\"444444\",\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Project+management\",\"name\":\"Project management\"},{\"color\":\"02e10c\",\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\"}]\n+\n+GET /repos/jacquev6/PyGithub/issues/28/labels {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4984'), ('content-length', '335'), ('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')]\n+[{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug\",\"name\":\"Bug\",\"color\":\"e10c02\"},{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Project+management\",\"name\":\"Project management\",\"color\":\"444444\"},{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\",\"color\":\"02e10c\"}]\n+","additions":45,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"added","changes":35,"deletions":0,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/test/ReplayData/Issue.testDeleteAndSetLabels.txt","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/test/ReplayData/Issue.testDeleteAndSetLabels.txt","filename":"test/ReplayData/Issue.testDeleteAndSetLabels.txt","patch":"@@ -0,0 +1,35 @@\n+GET /repos/jacquev6/PyGithub/labels/Bug {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4974'), ('content-length', '97'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"fe2e942523eecb156d100829a6347516\"'), ('date', 'Sun, 27 May 2012 09:06:37 GMT'), ('content-type', 'application/json; charset=utf-8')]\n+{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug\",\"name\":\"Bug\",\"color\":\"e10c02\"}\n+\n+GET /repos/jacquev6/PyGithub/labels/Question {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4973'), ('content-length', '107'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"931e58d337b2290717303141eda89cd7\"'), ('date', 'Sun, 27 May 2012 09:06:38 GMT'), ('content-type', 'application/json; charset=utf-8')]\n+{\"color\":\"02e10c\",\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\"}\n+\n+GET /repos/jacquev6/PyGithub/issues/28/labels {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4972'), ('content-length', '335'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"d135d74d2ea2159d044676a220d41d3a\"'), ('date', 'Sun, 27 May 2012 09:06:39 GMT'), ('content-type', 'application/json; charset=utf-8')]\n+[{\"color\":\"e10c02\",\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug\",\"name\":\"Bug\"},{\"color\":\"444444\",\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Project+management\",\"name\":\"Project management\"},{\"color\":\"02e10c\",\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\"}]\n+\n+DELETE /repos/jacquev6/PyGithub/issues/28/labels {'Authorization': 'Basic login_and_password_removed'} null\n+204\n+[('status', '204 No Content'), ('x-ratelimit-remaining', '4971'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"d41d8cd98f00b204e9800998ecf8427e\"'), ('date', 'Sun, 27 May 2012 09:06:39 GMT')]\n+\n+\n+GET /repos/jacquev6/PyGithub/issues/28/labels {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4970'), ('content-length', '2'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"d751713988987e9331980363e24189ce\"'), ('date', 'Sun, 27 May 2012 09:06:40 GMT'), ('content-type', 'application/json; charset=utf-8')]\n+[]\n+\n+PUT /repos/jacquev6/PyGithub/issues/28/labels {'Authorization': 'Basic login_and_password_removed'} [\"Bug\", \"Question\"]\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4969'), ('content-length', '207'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"1a56634d9c1050a88592ff55ed8adc62\"'), ('date', 'Sun, 27 May 2012 09:06:40 GMT'), ('content-type', 'application/json; charset=utf-8')]\n+[{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug\",\"name\":\"Bug\",\"color\":\"e10c02\"},{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\",\"color\":\"02e10c\"}]\n+\n+GET /repos/jacquev6/PyGithub/issues/28/labels {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4968'), ('content-length', '207'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"1a56634d9c1050a88592ff55ed8adc62\"'), ('date', 'Sun, 27 May 2012 09:06:41 GMT'), ('content-type', 'application/json; charset=utf-8')]\n+[{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug\",\"name\":\"Bug\",\"color\":\"e10c02\"},{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\",\"color\":\"02e10c\"}]\n+","additions":35,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"added","changes":5,"deletions":0,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/test/ReplayData/Issue.testGetLabels.txt","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/test/ReplayData/Issue.testGetLabels.txt","filename":"test/ReplayData/Issue.testGetLabels.txt","patch":"@@ -0,0 +1,5 @@\n+GET /repos/jacquev6/PyGithub/issues/28/labels {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4996'), ('content-length', '335'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"c9f9beccb03030beaf7b80927da6fef6\"'), ('date', 'Sun, 27 May 2012 08:56:31 GMT'), ('content-type', 'application/json; charset=utf-8')]\n+[{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug\",\"name\":\"Bug\",\"color\":\"e10c02\"},{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Project+management\",\"name\":\"Project management\",\"color\":\"444444\"},{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\",\"color\":\"02e10c\"}]\n+","additions":5,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":14,"deletions":7,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/test/ReplayData/IssueEvent.setUp.txt","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/test/ReplayData/IssueEvent.setUp.txt","filename":"test/ReplayData/IssueEvent.setUp.txt","patch":"@@ -1,15 +1,15 @@\n GET /user {'Authorization': 'Basic login_and_password_removed'} null\n 200\n-[('status', '200 OK'), ('x-ratelimit-remaining', '4907'), ('content-length', '801'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"99c9bfb75395b749e9913a4729126fb5\"'), ('date', 'Sun, 27 May 2012 07:19:30 GMT'), ('content-type', 'application/json; charset=utf-8')]\n-{\"private_gists\":5,\"type\":\"User\",\"company\":\"Criteo\",\"location\":\"Paris, France\",\"hireable\":false,\"gravatar_id\":\"b68de5ae38616c296fa345d2b9df2225\",\"bio\":\"\",\"following\":24,\"blog\":\"http://vincent-jacques.net\",\"avatar_url\":\"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png\",\"total_private_repos\":5,\"followers\":13,\"owned_private_repos\":5,\"disk_usage\":16976,\"collaborators\":0,\"html_url\":\"https://github.com/jacquev6\",\"url\":\"https://api.github.com/users/jacquev6\",\"name\":\"Vincent Jacques\",\"login\":\"jacquev6\",\"public_repos\":11,\"public_gists\":3,\"email\":\"vincent@vincent-jacques.net\",\"id\":327146,\"plan\":{\"private_repos\":5,\"collaborators\":1,\"name\":\"micro\",\"space\":614400},\"created_at\":\"2010-07-09T06:10:06Z\"}\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4996'), ('content-length', '801'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"8974bb1628a3e3a6d3eb3b08c1b5a46b\"'), ('date', 'Sun, 27 May 2012 07:32:54 GMT'), ('content-type', 'application/json; charset=utf-8')]\n+{\"type\":\"User\",\"bio\":\"\",\"disk_usage\":16976,\"total_private_repos\":5,\"url\":\"https://api.github.com/users/jacquev6\",\"avatar_url\":\"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png\",\"owned_private_repos\":5,\"collaborators\":0,\"plan\":{\"collaborators\":1,\"private_repos\":5,\"name\":\"micro\",\"space\":614400},\"company\":\"Criteo\",\"gravatar_id\":\"b68de5ae38616c296fa345d2b9df2225\",\"login\":\"jacquev6\",\"email\":\"vincent@vincent-jacques.net\",\"public_gists\":3,\"followers\":13,\"name\":\"Vincent Jacques\",\"created_at\":\"2010-07-09T06:10:06Z\",\"blog\":\"http://vincent-jacques.net\",\"location\":\"Paris, France\",\"hireable\":false,\"id\":327146,\"private_gists\":5,\"public_repos\":11,\"following\":24,\"html_url\":\"https://github.com/jacquev6\"}\n \n GET /repos/jacquev6/PyGithub {'Authorization': 'Basic login_and_password_removed'} null\n 200\n-[('status', '200 OK'), ('x-ratelimit-remaining', '4906'), ('content-length', '1129'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"4c20acf0b23f75bbf25106b1a04f65a5\"'), ('date', 'Sun, 27 May 2012 07:19:31 GMT'), ('content-type', 'application/json; charset=utf-8')]\n-{\"description\":\"Python library implementing the full Github API v3\",\"full_name\":\"jacquev6/PyGithub\",\"has_wiki\":false,\"has_issues\":true,\"updated_at\":\"2012-05-27T06:55:28Z\",\"forks\":3,\"mirror_url\":null,\"homepage\":\"http://vincent-jacques.net/PyGithub\",\"ssh_url\":\"git@github.com:jacquev6/PyGithub.git\",\"open_issues\":16,\"fork\":false,\"svn_url\":\"https://github.com/jacquev6/PyGithub\",\"pushed_at\":\"2012-05-27T06:00:28Z\",\"size\":308,\"html_url\":\"https://github.com/jacquev6/PyGithub\",\"private\":false,\"url\":\"https://api.github.com/repos/jacquev6/PyGithub\",\"clone_url\":\"https://github.com/jacquev6/PyGithub.git\",\"owner\":{\"gravatar_id\":\"b68de5ae38616c296fa345d2b9df2225\",\"avatar_url\":\"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png\",\"url\":\"https://api.github.com/users/jacquev6\",\"login\":\"jacquev6\",\"id\":327146},\"name\":\"PyGithub\",\"has_downloads\":true,\"language\":\"Python\",\"watchers\":15,\"git_url\":\"git://github.com/jacquev6/PyGithub.git\",\"id\":3544490,\"permissions\":{\"admin\":true,\"pull\":true,\"push\":true},\"created_at\":\"2012-02-25T12:53:47Z\"}\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4995'), ('content-length', '1129'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"f1e4eb3993a364b66b68ec9db42405bd\"'), ('date', 'Sun, 27 May 2012 07:32:55 GMT'), ('content-type', 'application/json; charset=utf-8')]\n+{\"clone_url\":\"https://github.com/jacquev6/PyGithub.git\",\"has_downloads\":true,\"watchers\":15,\"updated_at\":\"2012-05-27T07:29:24Z\",\"permissions\":{\"pull\":true,\"admin\":true,\"push\":true},\"homepage\":\"http://vincent-jacques.net/PyGithub\",\"url\":\"https://api.github.com/repos/jacquev6/PyGithub\",\"mirror_url\":null,\"has_wiki\":false,\"has_issues\":true,\"fork\":false,\"forks\":3,\"git_url\":\"git://github.com/jacquev6/PyGithub.git\",\"size\":308,\"private\":false,\"open_issues\":16,\"svn_url\":\"https://github.com/jacquev6/PyGithub\",\"owner\":{\"url\":\"https://api.github.com/users/jacquev6\",\"avatar_url\":\"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png\",\"gravatar_id\":\"b68de5ae38616c296fa345d2b9df2225\",\"login\":\"jacquev6\",\"id\":327146},\"name\":\"PyGithub\",\"language\":\"Python\",\"description\":\"Python library implementing the full Github API v3\",\"ssh_url\":\"git@github.com:jacquev6/PyGithub.git\",\"pushed_at\":\"2012-05-27T07:29:24Z\",\"created_at\":\"2012-02-25T12:53:47Z\",\"id\":3544490,\"html_url\":\"https://github.com/jacquev6/PyGithub\",\"full_name\":\"jacquev6/PyGithub\"}\n \n-GET /repos/jacquev6/PyGithub/issues/events/15819975 {'Authorization': 'Basic login_and_password_removed'} null\n+GET /repos/jacquev6/PyGithub/issues/events/16348656 {'Authorization': 'Basic login_and_password_removed'} null\n 200\n-[('status', '200 OK'), ('x-ratelimit-remaining', '4905'), ('content-length', '2430'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"a3d244842d23f92f69a23e21626fad11\"'), ('date', 'Sun, 27 May 2012 07:19:31 GMT'), ('content-type', 'application/json; charset=utf-8')]\n-{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/issues/events/15819975\",\"issue\":{\"updated_at\":\"2012-05-26T14:59:33Z\",\"body\":\"Body edited by PyGithub\",\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/issues/28\",\"comments\":0,\"milestone\":{\"creator\":{\"url\":\"https://api.github.com/users/jacquev6\",\"avatar_url\":\"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png\",\"gravatar_id\":\"b68de5ae38616c296fa345d2b9df2225\",\"login\":\"jacquev6\",\"id\":327146},\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/milestones/1\",\"number\":1,\"title\":\"Version 0.4\",\"due_on\":\"2012-03-13T07:00:00Z\",\"closed_issues\":3,\"open_issues\":0,\"created_at\":\"2012-03-08T12:22:10Z\",\"state\":\"closed\",\"description\":\"\",\"id\":93546},\"number\":28,\"assignee\":{\"url\":\"https://api.github.com/users/jacquev6\",\"avatar_url\":\"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png\",\"gravatar_id\":\"b68de5ae38616c296fa345d2b9df2225\",\"login\":\"jacquev6\",\"id\":327146},\"closed_at\":\"2012-05-26T14:59:33Z\",\"title\":\"Issue created by PyGithub\",\"labels\":[{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug\",\"name\":\"Bug\",\"color\":\"e10c02\"},{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Project+management\",\"name\":\"Project management\",\"color\":\"444444\"},{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\",\"color\":\"02e10c\"}],\"created_at\":\"2012-05-19T10:38:23Z\",\"state\":\"closed\",\"user\":{\"url\":\"https://api.github.com/users/jacquev6\",\"avatar_url\":\"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png\",\"gravatar_id\":\"b68de5ae38616c296fa345d2b9df2225\",\"login\":\"jacquev6\",\"id\":327146},\"id\":4653757,\"pull_request\":{\"diff_url\":null,\"patch_url\":null,\"html_url\":null},\"html_url\":\"https://github.com/jacquev6/PyGithub/issues/28\"},\"commit_id\":null,\"created_at\":\"2012-05-19T10:38:23Z\",\"event\":\"subscribed\",\"id\":15819975,\"actor\":{\"url\":\"https://api.github.com/users/jacquev6\",\"avatar_url\":\"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png\",\"gravatar_id\":\"b68de5ae38616c296fa345d2b9df2225\",\"login\":\"jacquev6\",\"id\":327146}}\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4994'), ('content-length', '1384'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"fefecab09e7355d4ef9875677c2631da\"'), ('date', 'Sun, 27 May 2012 07:32:56 GMT'), ('content-type', 'application/json; charset=utf-8')]\n+{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/issues/events/16348656\",\"issue\":{\"updated_at\":\"2012-05-27T07:27:51Z\",\"body\":\"Body created by PyGithub\",\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/issues/30\",\"comments\":0,\"milestone\":null,\"number\":30,\"assignee\":null,\"closed_at\":null,\"title\":\"Issue also created by PyGithub\",\"labels\":[{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\",\"color\":\"02e10c\"}],\"created_at\":\"2012-05-27T05:40:15Z\",\"state\":\"open\",\"user\":{\"url\":\"https://api.github.com/users/jacquev6\",\"gravatar_id\":\"b68de5ae38616c296fa345d2b9df2225\",\"login\":\"jacquev6\",\"id\":327146,\"avatar_url\":\"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png\"},\"id\":4769659,\"pull_request\":{\"patch_url\":null,\"diff_url\":null,\"html_url\":null},\"html_url\":\"https://github.com/jacquev6/PyGithub/issues/30\"},\"commit_id\":\"ed866fc43833802ab553e5ff8581c81bb00dd433\",\"created_at\":\"2012-05-27T07:29:25Z\",\"event\":\"referenced\",\"id\":16348656,\"actor\":{\"url\":\"https://api.github.com/users/jacquev6\",\"gravatar_id\":\"b68de5ae38616c296fa345d2b9df2225\",\"login\":\"jacquev6\",\"id\":327146,\"avatar_url\":\"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png\"}}\n ","additions":7,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"}] +[{"status":"modified","changes":2,"deletions":1,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/codegen/templates/GithubObject.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/codegen/templates/GithubObject.py","filename":"codegen/templates/GithubObject.py","patch":"@@ -70,7 +70,7 @@ def __useAttributes( self, attributes ):\n \n # @toto No need to check if attribute is in attributes when attribute is mandatory\n {% for attribute in class.attributes|dictsort:\"name\" %}\n- if \"{{ attribute.name }}\" in attributes and attributes[ \"{{ attribute.name }}\" ] is not None:\n+ if \"{{ attribute.name }}\" in attributes and attributes[ \"{{ attribute.name }}\" ] is not None: # pragma no branch\n \n {% if attribute.type.cardinality == \"scalar\" %}\n {% if attribute.type.simple %}","additions":1,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":50,"deletions":25,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/AuthenticatedUser.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/AuthenticatedUser.py","filename":"src/github/AuthenticatedUser.py","patch":"@@ -568,78 +568,78 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"avatar_url\", \"bio\", \"blog\", \"collaborators\", \"company\", \"created_at\", \"disk_usage\", \"email\", \"followers\", \"following\", \"gravatar_id\", \"hireable\", \"html_url\", \"id\", \"location\", \"login\", \"name\", \"owned_private_repos\", \"plan\", \"private_gists\", \"public_gists\", \"public_repos\", \"total_private_repos\", \"type\", \"url\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"avatar_url\" in attributes and attributes[ \"avatar_url\" ] is not None:\n+ if \"avatar_url\" in attributes and attributes[ \"avatar_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"avatar_url\" ], ( str, unicode ) )\n self.__avatar_url = attributes[ \"avatar_url\" ]\n- if \"bio\" in attributes and attributes[ \"bio\" ] is not None:\n+ if \"bio\" in attributes and attributes[ \"bio\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"bio\" ], ( str, unicode ) )\n self.__bio = attributes[ \"bio\" ]\n- if \"blog\" in attributes and attributes[ \"blog\" ] is not None:\n+ if \"blog\" in attributes and attributes[ \"blog\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"blog\" ], ( str, unicode ) )\n self.__blog = attributes[ \"blog\" ]\n- if \"collaborators\" in attributes and attributes[ \"collaborators\" ] is not None:\n+ if \"collaborators\" in attributes and attributes[ \"collaborators\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"collaborators\" ], int )\n self.__collaborators = attributes[ \"collaborators\" ]\n- if \"company\" in attributes and attributes[ \"company\" ] is not None:\n+ if \"company\" in attributes and attributes[ \"company\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"company\" ], ( str, unicode ) )\n self.__company = attributes[ \"company\" ]\n- if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None:\n+ if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"created_at\" ], ( str, unicode ) )\n self.__created_at = attributes[ \"created_at\" ]\n- if \"disk_usage\" in attributes and attributes[ \"disk_usage\" ] is not None:\n+ if \"disk_usage\" in attributes and attributes[ \"disk_usage\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"disk_usage\" ], int )\n self.__disk_usage = attributes[ \"disk_usage\" ]\n- if \"email\" in attributes and attributes[ \"email\" ] is not None:\n+ if \"email\" in attributes and attributes[ \"email\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"email\" ], ( str, unicode ) )\n self.__email = attributes[ \"email\" ]\n- if \"followers\" in attributes and attributes[ \"followers\" ] is not None:\n+ if \"followers\" in attributes and attributes[ \"followers\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"followers\" ], int )\n self.__followers = attributes[ \"followers\" ]\n- if \"following\" in attributes and attributes[ \"following\" ] is not None:\n+ if \"following\" in attributes and attributes[ \"following\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"following\" ], int )\n self.__following = attributes[ \"following\" ]\n- if \"gravatar_id\" in attributes and attributes[ \"gravatar_id\" ] is not None:\n+ if \"gravatar_id\" in attributes and attributes[ \"gravatar_id\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"gravatar_id\" ], ( str, unicode ) )\n self.__gravatar_id = attributes[ \"gravatar_id\" ]\n- if \"hireable\" in attributes and attributes[ \"hireable\" ] is not None:\n+ if \"hireable\" in attributes and attributes[ \"hireable\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"hireable\" ], bool )\n self.__hireable = attributes[ \"hireable\" ]\n- if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None:\n+ if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"html_url\" ], ( str, unicode ) )\n self.__html_url = attributes[ \"html_url\" ]\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"id\" ], int )\n self.__id = attributes[ \"id\" ]\n- if \"location\" in attributes and attributes[ \"location\" ] is not None:\n+ if \"location\" in attributes and attributes[ \"location\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"location\" ], ( str, unicode ) )\n self.__location = attributes[ \"location\" ]\n- if \"login\" in attributes and attributes[ \"login\" ] is not None:\n+ if \"login\" in attributes and attributes[ \"login\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"login\" ], ( str, unicode ) )\n self.__login = attributes[ \"login\" ]\n- if \"name\" in attributes and attributes[ \"name\" ] is not None:\n+ if \"name\" in attributes and attributes[ \"name\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"name\" ], ( str, unicode ) )\n self.__name = attributes[ \"name\" ]\n- if \"owned_private_repos\" in attributes and attributes[ \"owned_private_repos\" ] is not None:\n+ if \"owned_private_repos\" in attributes and attributes[ \"owned_private_repos\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"owned_private_repos\" ], int )\n self.__owned_private_repos = attributes[ \"owned_private_repos\" ]\n- if \"plan\" in attributes and attributes[ \"plan\" ] is not None:\n+ if \"plan\" in attributes and attributes[ \"plan\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"plan\" ], dict )\n self.__plan = Plan.Plan( self.__requester, attributes[ \"plan\" ], completion = LazyCompletion )\n- if \"private_gists\" in attributes and attributes[ \"private_gists\" ] is not None:\n+ if \"private_gists\" in attributes and attributes[ \"private_gists\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"private_gists\" ], int )\n self.__private_gists = attributes[ \"private_gists\" ]\n- if \"public_gists\" in attributes and attributes[ \"public_gists\" ] is not None:\n+ if \"public_gists\" in attributes and attributes[ \"public_gists\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"public_gists\" ], int )\n self.__public_gists = attributes[ \"public_gists\" ]\n- if \"public_repos\" in attributes and attributes[ \"public_repos\" ] is not None:\n+ if \"public_repos\" in attributes and attributes[ \"public_repos\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"public_repos\" ], int )\n self.__public_repos = attributes[ \"public_repos\" ]\n- if \"total_private_repos\" in attributes and attributes[ \"total_private_repos\" ] is not None:\n+ if \"total_private_repos\" in attributes and attributes[ \"total_private_repos\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"total_private_repos\" ], int )\n self.__total_private_repos = attributes[ \"total_private_repos\" ]\n- if \"type\" in attributes and attributes[ \"type\" ] is not None:\n+ if \"type\" in attributes and attributes[ \"type\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"type\" ], ( str, unicode ) )\n self.__type = attributes[ \"type\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"url\" ], ( str, unicode ) )\n self.__url = attributes[ \"url\" ]","additions":25,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":18,"deletions":9,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Authorization.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Authorization.py","filename":"src/github/Authorization.py","patch":"@@ -117,21 +117,21 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"app\", \"created_at\", \"id\", \"note\", \"note_url\", \"scopes\", \"token\", \"updated_at\", \"url\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"app\" in attributes and attributes[ \"app\" ] is not None:\n+ if \"app\" in attributes and attributes[ \"app\" ] is not None: # pragma no branch\n self.__app = attributes[ \"app\" ]\n- if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None:\n+ if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None: # pragma no branch\n self.__created_at = attributes[ \"created_at\" ]\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n self.__id = attributes[ \"id\" ]\n- if \"note\" in attributes and attributes[ \"note\" ] is not None:\n+ if \"note\" in attributes and attributes[ \"note\" ] is not None: # pragma no branch\n self.__note = attributes[ \"note\" ]\n- if \"note_url\" in attributes and attributes[ \"note_url\" ] is not None:\n+ if \"note_url\" in attributes and attributes[ \"note_url\" ] is not None: # pragma no branch\n self.__note_url = attributes[ \"note_url\" ]\n- if \"scopes\" in attributes and attributes[ \"scopes\" ] is not None:\n+ if \"scopes\" in attributes and attributes[ \"scopes\" ] is not None: # pragma no branch\n self.__scopes = attributes[ \"scopes\" ]\n- if \"token\" in attributes and attributes[ \"token\" ] is not None:\n+ if \"token\" in attributes and attributes[ \"token\" ] is not None: # pragma no branch\n self.__token = attributes[ \"token\" ]\n- if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None:\n+ if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None: # pragma no branch\n self.__updated_at = attributes[ \"updated_at\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n self.__url = attributes[ \"url\" ]","additions":9,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":4,"deletions":2,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Branch.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Branch.py","filename":"src/github/Branch.py","patch":"@@ -28,9 +28,9 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"commit\", \"name\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"commit\" in attributes and attributes[ \"commit\" ] is not None:\n+ if \"commit\" in attributes and attributes[ \"commit\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"commit\" ], dict )\n self.__commit = Commit.Commit( self.__requester, attributes[ \"commit\" ], completion = LazyCompletion )\n- if \"name\" in attributes and attributes[ \"name\" ] is not None:\n+ if \"name\" in attributes and attributes[ \"name\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"name\" ], ( str, unicode ) )\n self.__name = attributes[ \"name\" ]","additions":2,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":16,"deletions":8,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Commit.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Commit.py","filename":"src/github/Commit.py","patch":"@@ -120,33 +120,33 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"author\", \"commit\", \"committer\", \"files\", \"parents\", \"sha\", \"stats\", \"url\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"author\" in attributes and attributes[ \"author\" ] is not None:\n+ if \"author\" in attributes and attributes[ \"author\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"author\" ], dict )\n self.__author = NamedUser.NamedUser( self.__requester, attributes[ \"author\" ], completion = LazyCompletion )\n- if \"commit\" in attributes and attributes[ \"commit\" ] is not None:\n+ if \"commit\" in attributes and attributes[ \"commit\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"commit\" ], dict )\n self.__commit = GitCommit.GitCommit( self.__requester, attributes[ \"commit\" ], completion = LazyCompletion )\n- if \"committer\" in attributes and attributes[ \"committer\" ] is not None:\n+ if \"committer\" in attributes and attributes[ \"committer\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"committer\" ], dict )\n self.__committer = NamedUser.NamedUser( self.__requester, attributes[ \"committer\" ], completion = LazyCompletion )\n- if \"files\" in attributes and attributes[ \"files\" ] is not None:\n+ if \"files\" in attributes and attributes[ \"files\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"files\" ], list ) and ( len( attributes[ \"files\" ] ) == 0 or isinstance( attributes[ \"files\" ][ 0 ], dict ) )\n self.__files = [\n CommitFile.CommitFile( self.__requester, element, completion = LazyCompletion )\n for element in attributes[ \"files\" ]\n ]\n- if \"parents\" in attributes and attributes[ \"parents\" ] is not None:\n+ if \"parents\" in attributes and attributes[ \"parents\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"parents\" ], list ) and ( len( attributes[ \"parents\" ] ) == 0 or isinstance( attributes[ \"parents\" ][ 0 ], dict ) )\n self.__parents = [\n Commit( self.__requester, element, completion = LazyCompletion )\n for element in attributes[ \"parents\" ]\n ]\n- if \"sha\" in attributes and attributes[ \"sha\" ] is not None:\n+ if \"sha\" in attributes and attributes[ \"sha\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"sha\" ], ( str, unicode ) )\n self.__sha = attributes[ \"sha\" ]\n- if \"stats\" in attributes and attributes[ \"stats\" ] is not None:\n+ if \"stats\" in attributes and attributes[ \"stats\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"stats\" ], dict )\n self.__stats = CommitStats.CommitStats( self.__requester, attributes[ \"stats\" ], completion = LazyCompletion )\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"url\" ], ( str, unicode ) )\n self.__url = attributes[ \"url\" ]","additions":8,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":22,"deletions":11,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/CommitComment.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/CommitComment.py","filename":"src/github/CommitComment.py","patch":"@@ -121,36 +121,36 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"body\", \"commit_id\", \"created_at\", \"html_url\", \"id\", \"line\", \"path\", \"position\", \"updated_at\", \"url\", \"user\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"body\" in attributes and attributes[ \"body\" ] is not None:\n+ if \"body\" in attributes and attributes[ \"body\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"body\" ], ( str, unicode ) )\n self.__body = attributes[ \"body\" ]\n- if \"commit_id\" in attributes and attributes[ \"commit_id\" ] is not None:\n+ if \"commit_id\" in attributes and attributes[ \"commit_id\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"commit_id\" ], ( str, unicode ) )\n self.__commit_id = attributes[ \"commit_id\" ]\n- if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None:\n+ if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"created_at\" ], ( str, unicode ) )\n self.__created_at = attributes[ \"created_at\" ]\n- if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None:\n+ if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"html_url\" ], ( str, unicode ) )\n self.__html_url = attributes[ \"html_url\" ]\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"id\" ], int )\n self.__id = attributes[ \"id\" ]\n- if \"line\" in attributes and attributes[ \"line\" ] is not None:\n+ if \"line\" in attributes and attributes[ \"line\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"line\" ], int )\n self.__line = attributes[ \"line\" ]\n- if \"path\" in attributes and attributes[ \"path\" ] is not None:\n+ if \"path\" in attributes and attributes[ \"path\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"path\" ], ( str, unicode ) )\n self.__path = attributes[ \"path\" ]\n- if \"position\" in attributes and attributes[ \"position\" ] is not None:\n+ if \"position\" in attributes and attributes[ \"position\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"position\" ], int )\n self.__position = attributes[ \"position\" ]\n- if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None:\n+ if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"updated_at\" ], ( str, unicode ) )\n self.__updated_at = attributes[ \"updated_at\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"url\" ], ( str, unicode ) )\n self.__url = attributes[ \"url\" ]\n- if \"user\" in attributes and attributes[ \"user\" ] is not None:\n+ if \"user\" in attributes and attributes[ \"user\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"user\" ], dict )\n self.__user = NamedUser.NamedUser( self.__requester, attributes[ \"user\" ], completion = LazyCompletion )","additions":11,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":18,"deletions":9,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/CommitFile.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/CommitFile.py","filename":"src/github/CommitFile.py","patch":"@@ -62,21 +62,21 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"additions\", \"blob_url\", \"changes\", \"deletions\", \"filename\", \"patch\", \"raw_url\", \"sha\", \"status\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"additions\" in attributes and attributes[ \"additions\" ] is not None:\n+ if \"additions\" in attributes and attributes[ \"additions\" ] is not None: # pragma no branch\n self.__additions = attributes[ \"additions\" ]\n- if \"blob_url\" in attributes and attributes[ \"blob_url\" ] is not None:\n+ if \"blob_url\" in attributes and attributes[ \"blob_url\" ] is not None: # pragma no branch\n self.__blob_url = attributes[ \"blob_url\" ]\n- if \"changes\" in attributes and attributes[ \"changes\" ] is not None:\n+ if \"changes\" in attributes and attributes[ \"changes\" ] is not None: # pragma no branch\n self.__changes = attributes[ \"changes\" ]\n- if \"deletions\" in attributes and attributes[ \"deletions\" ] is not None:\n+ if \"deletions\" in attributes and attributes[ \"deletions\" ] is not None: # pragma no branch\n self.__deletions = attributes[ \"deletions\" ]\n- if \"filename\" in attributes and attributes[ \"filename\" ] is not None:\n+ if \"filename\" in attributes and attributes[ \"filename\" ] is not None: # pragma no branch\n self.__filename = attributes[ \"filename\" ]\n- if \"patch\" in attributes and attributes[ \"patch\" ] is not None:\n+ if \"patch\" in attributes and attributes[ \"patch\" ] is not None: # pragma no branch\n self.__patch = attributes[ \"patch\" ]\n- if \"raw_url\" in attributes and attributes[ \"raw_url\" ] is not None:\n+ if \"raw_url\" in attributes and attributes[ \"raw_url\" ] is not None: # pragma no branch\n self.__raw_url = attributes[ \"raw_url\" ]\n- if \"sha\" in attributes and attributes[ \"sha\" ] is not None:\n+ if \"sha\" in attributes and attributes[ \"sha\" ] is not None: # pragma no branch\n self.__sha = attributes[ \"sha\" ]\n- if \"status\" in attributes and attributes[ \"status\" ] is not None:\n+ if \"status\" in attributes and attributes[ \"status\" ] is not None: # pragma no branch\n self.__status = attributes[ \"status\" ]","additions":9,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":6,"deletions":3,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/CommitStats.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/CommitStats.py","filename":"src/github/CommitStats.py","patch":"@@ -32,12 +32,12 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"additions\", \"deletions\", \"total\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"additions\" in attributes and attributes[ \"additions\" ] is not None:\n+ if \"additions\" in attributes and attributes[ \"additions\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"additions\" ], int )\n self.__additions = attributes[ \"additions\" ]\n- if \"deletions\" in attributes and attributes[ \"deletions\" ] is not None:\n+ if \"deletions\" in attributes and attributes[ \"deletions\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"deletions\" ], int )\n self.__deletions = attributes[ \"deletions\" ]\n- if \"total\" in attributes and attributes[ \"total\" ] is not None:\n+ if \"total\" in attributes and attributes[ \"total\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"total\" ], int )\n self.__total = attributes[ \"total\" ]","additions":3,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":40,"deletions":20,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Download.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Download.py","filename":"src/github/Download.py","patch":"@@ -162,43 +162,43 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"accesskeyid\", \"acl\", \"bucket\", \"content_type\", \"created_at\", \"description\", \"download_count\", \"expirationdate\", \"html_url\", \"id\", \"mime_type\", \"name\", \"path\", \"policy\", \"prefix\", \"redirect\", \"s3_url\", \"signature\", \"size\", \"url\", \"x-amz-meta-content-disposition\" ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"accesskeyid\" in attributes and attributes[ \"accesskeyid\" ] is not None:\n+ if \"accesskeyid\" in attributes and attributes[ \"accesskeyid\" ] is not None: # pragma no branch\n self.__accesskeyid = attributes[ \"accesskeyid\" ]\n- if \"acl\" in attributes and attributes[ \"acl\" ] is not None:\n+ if \"acl\" in attributes and attributes[ \"acl\" ] is not None: # pragma no branch\n self.__acl = attributes[ \"acl\" ]\n- if \"bucket\" in attributes and attributes[ \"bucket\" ] is not None:\n+ if \"bucket\" in attributes and attributes[ \"bucket\" ] is not None: # pragma no branch\n self.__bucket = attributes[ \"bucket\" ]\n- if \"content_type\" in attributes and attributes[ \"content_type\" ] is not None:\n+ if \"content_type\" in attributes and attributes[ \"content_type\" ] is not None: # pragma no branch\n self.__content_type = attributes[ \"content_type\" ]\n- if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None:\n+ if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None: # pragma no branch\n self.__created_at = attributes[ \"created_at\" ]\n- if \"description\" in attributes and attributes[ \"description\" ] is not None:\n+ if \"description\" in attributes and attributes[ \"description\" ] is not None: # pragma no branch\n self.__description = attributes[ \"description\" ]\n- if \"download_count\" in attributes and attributes[ \"download_count\" ] is not None:\n+ if \"download_count\" in attributes and attributes[ \"download_count\" ] is not None: # pragma no branch\n self.__download_count = attributes[ \"download_count\" ]\n- if \"expirationdate\" in attributes and attributes[ \"expirationdate\" ] is not None:\n+ if \"expirationdate\" in attributes and attributes[ \"expirationdate\" ] is not None: # pragma no branch\n self.__expirationdate = attributes[ \"expirationdate\" ]\n- if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None:\n+ if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None: # pragma no branch\n self.__html_url = attributes[ \"html_url\" ]\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n self.__id = attributes[ \"id\" ]\n- if \"mime_type\" in attributes and attributes[ \"mime_type\" ] is not None:\n+ if \"mime_type\" in attributes and attributes[ \"mime_type\" ] is not None: # pragma no branch\n self.__mime_type = attributes[ \"mime_type\" ]\n- if \"name\" in attributes and attributes[ \"name\" ] is not None:\n+ if \"name\" in attributes and attributes[ \"name\" ] is not None: # pragma no branch\n self.__name = attributes[ \"name\" ]\n- if \"path\" in attributes and attributes[ \"path\" ] is not None:\n+ if \"path\" in attributes and attributes[ \"path\" ] is not None: # pragma no branch\n self.__path = attributes[ \"path\" ]\n- if \"policy\" in attributes and attributes[ \"policy\" ] is not None:\n+ if \"policy\" in attributes and attributes[ \"policy\" ] is not None: # pragma no branch\n self.__policy = attributes[ \"policy\" ]\n- if \"prefix\" in attributes and attributes[ \"prefix\" ] is not None:\n+ if \"prefix\" in attributes and attributes[ \"prefix\" ] is not None: # pragma no branch\n self.__prefix = attributes[ \"prefix\" ]\n- if \"redirect\" in attributes and attributes[ \"redirect\" ] is not None:\n+ if \"redirect\" in attributes and attributes[ \"redirect\" ] is not None: # pragma no branch\n self.__redirect = attributes[ \"redirect\" ]\n- if \"s3_url\" in attributes and attributes[ \"s3_url\" ] is not None:\n+ if \"s3_url\" in attributes and attributes[ \"s3_url\" ] is not None: # pragma no branch\n self.__s3_url = attributes[ \"s3_url\" ]\n- if \"signature\" in attributes and attributes[ \"signature\" ] is not None:\n+ if \"signature\" in attributes and attributes[ \"signature\" ] is not None: # pragma no branch\n self.__signature = attributes[ \"signature\" ]\n- if \"size\" in attributes and attributes[ \"size\" ] is not None:\n+ if \"size\" in attributes and attributes[ \"size\" ] is not None: # pragma no branch\n self.__size = attributes[ \"size\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n self.__url = attributes[ \"url\" ]","additions":20,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":16,"deletions":8,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Event.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Event.py","filename":"src/github/Event.py","patch":"@@ -60,22 +60,22 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"actor\", \"created_at\", \"id\", \"org\", \"payload\", \"public\", \"repo\", \"type\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"actor\" in attributes and attributes[ \"actor\" ] is not None:\n+ if \"actor\" in attributes and attributes[ \"actor\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"actor\" ], dict )\n self.__actor = NamedUser.NamedUser( self.__requester, attributes[ \"actor\" ], completion = LazyCompletion )\n- if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None:\n+ if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None: # pragma no branch\n self.__created_at = attributes[ \"created_at\" ]\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n self.__id = attributes[ \"id\" ]\n- if \"org\" in attributes and attributes[ \"org\" ] is not None:\n+ if \"org\" in attributes and attributes[ \"org\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"org\" ], dict )\n self.__org = Organization.Organization( self.__requester, attributes[ \"org\" ], completion = LazyCompletion )\n- if \"payload\" in attributes and attributes[ \"payload\" ] is not None:\n+ if \"payload\" in attributes and attributes[ \"payload\" ] is not None: # pragma no branch\n self.__payload = attributes[ \"payload\" ]\n- if \"public\" in attributes and attributes[ \"public\" ] is not None:\n+ if \"public\" in attributes and attributes[ \"public\" ] is not None: # pragma no branch\n self.__public = attributes[ \"public\" ]\n- if \"repo\" in attributes and attributes[ \"repo\" ] is not None:\n+ if \"repo\" in attributes and attributes[ \"repo\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"repo\" ], dict )\n self.__repo = Repository.Repository( self.__requester, attributes[ \"repo\" ], completion = LazyCompletion )\n- if \"type\" in attributes and attributes[ \"type\" ] is not None:\n+ if \"type\" in attributes and attributes[ \"type\" ] is not None: # pragma no branch\n self.__type = attributes[ \"type\" ]","additions":8,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":30,"deletions":15,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Gist.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Gist.py","filename":"src/github/Gist.py","patch":"@@ -220,53 +220,53 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"comments\", \"created_at\", \"description\", \"files\", \"fork_of\", \"forks\", \"git_pull_url\", \"git_push_url\", \"history\", \"html_url\", \"id\", \"public\", \"updated_at\", \"url\", \"user\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"comments\" in attributes and attributes[ \"comments\" ] is not None:\n+ if \"comments\" in attributes and attributes[ \"comments\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"comments\" ], int )\n self.__comments = attributes[ \"comments\" ]\n- if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None:\n+ if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"created_at\" ], ( str, unicode ) )\n self.__created_at = attributes[ \"created_at\" ]\n- if \"description\" in attributes and attributes[ \"description\" ] is not None:\n+ if \"description\" in attributes and attributes[ \"description\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"description\" ], ( str, unicode ) )\n self.__description = attributes[ \"description\" ]\n- if \"files\" in attributes and attributes[ \"files\" ] is not None:\n+ if \"files\" in attributes and attributes[ \"files\" ] is not None: # pragma no branch\n self.__files = attributes[ \"files\" ]\n- if \"fork_of\" in attributes and attributes[ \"fork_of\" ] is not None:\n+ if \"fork_of\" in attributes and attributes[ \"fork_of\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"fork_of\" ], dict )\n self.__fork_of = Gist( self.__requester, attributes[ \"fork_of\" ], completion = LazyCompletion )\n- if \"forks\" in attributes and attributes[ \"forks\" ] is not None:\n+ if \"forks\" in attributes and attributes[ \"forks\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"forks\" ], list ) and ( len( attributes[ \"forks\" ] ) == 0 or isinstance( attributes[ \"forks\" ][ 0 ], dict ) )\n self.__forks = [\n Gist( self.__requester, element, completion = LazyCompletion )\n for element in attributes[ \"forks\" ]\n ]\n- if \"git_pull_url\" in attributes and attributes[ \"git_pull_url\" ] is not None:\n+ if \"git_pull_url\" in attributes and attributes[ \"git_pull_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"git_pull_url\" ], ( str, unicode ) )\n self.__git_pull_url = attributes[ \"git_pull_url\" ]\n- if \"git_push_url\" in attributes and attributes[ \"git_push_url\" ] is not None:\n+ if \"git_push_url\" in attributes and attributes[ \"git_push_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"git_push_url\" ], ( str, unicode ) )\n self.__git_push_url = attributes[ \"git_push_url\" ]\n- if \"history\" in attributes and attributes[ \"history\" ] is not None:\n+ if \"history\" in attributes and attributes[ \"history\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"history\" ], list ) and ( len( attributes[ \"history\" ] ) == 0 or isinstance( attributes[ \"history\" ][ 0 ], dict ) )\n self.__history = [\n GistHistoryState.GistHistoryState( self.__requester, element, completion = LazyCompletion )\n for element in attributes[ \"history\" ]\n ]\n- if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None:\n+ if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"html_url\" ], ( str, unicode ) )\n self.__html_url = attributes[ \"html_url\" ]\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"id\" ], ( str, unicode ) )\n self.__id = attributes[ \"id\" ]\n- if \"public\" in attributes and attributes[ \"public\" ] is not None:\n+ if \"public\" in attributes and attributes[ \"public\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"public\" ], bool )\n self.__public = attributes[ \"public\" ]\n- if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None:\n+ if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"updated_at\" ], ( str, unicode ) )\n self.__updated_at = attributes[ \"updated_at\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"url\" ], ( str, unicode ) )\n self.__url = attributes[ \"url\" ]\n- if \"user\" in attributes and attributes[ \"user\" ] is not None:\n+ if \"user\" in attributes and attributes[ \"user\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"user\" ], dict )\n self.__user = NamedUser.NamedUser( self.__requester, attributes[ \"user\" ], completion = LazyCompletion )","additions":15,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":12,"deletions":6,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GistComment.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GistComment.py","filename":"src/github/GistComment.py","patch":"@@ -68,16 +68,16 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"body\", \"created_at\", \"id\", \"updated_at\", \"url\", \"user\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"body\" in attributes and attributes[ \"body\" ] is not None:\n+ if \"body\" in attributes and attributes[ \"body\" ] is not None: # pragma no branch\n self.__body = attributes[ \"body\" ]\n- if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None:\n+ if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None: # pragma no branch\n self.__created_at = attributes[ \"created_at\" ]\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n self.__id = attributes[ \"id\" ]\n- if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None:\n+ if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None: # pragma no branch\n self.__updated_at = attributes[ \"updated_at\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n self.__url = attributes[ \"url\" ]\n- if \"user\" in attributes and attributes[ \"user\" ] is not None:\n+ if \"user\" in attributes and attributes[ \"user\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"user\" ], dict )\n self.__user = NamedUser.NamedUser( self.__requester, attributes[ \"user\" ], completion = LazyCompletion )","additions":6,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":10,"deletions":5,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GistHistoryState.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GistHistoryState.py","filename":"src/github/GistHistoryState.py","patch":"@@ -44,18 +44,18 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"change_status\", \"committed_at\", \"url\", \"user\", \"version\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"change_status\" in attributes and attributes[ \"change_status\" ] is not None:\n+ if \"change_status\" in attributes and attributes[ \"change_status\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"change_status\" ], dict )\n self.__change_status = CommitStats.CommitStats( self.__requester, attributes[ \"change_status\" ], completion = LazyCompletion )\n- if \"committed_at\" in attributes and attributes[ \"committed_at\" ] is not None:\n+ if \"committed_at\" in attributes and attributes[ \"committed_at\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"committed_at\" ], ( str, unicode ) )\n self.__committed_at = attributes[ \"committed_at\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"url\" ], ( str, unicode ) )\n self.__url = attributes[ \"url\" ]\n- if \"user\" in attributes and attributes[ \"user\" ] is not None:\n+ if \"user\" in attributes and attributes[ \"user\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"user\" ], dict )\n self.__user = NamedUser.NamedUser( self.__requester, attributes[ \"user\" ], completion = LazyCompletion )\n- if \"version\" in attributes and attributes[ \"version\" ] is not None:\n+ if \"version\" in attributes and attributes[ \"version\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"version\" ], ( str, unicode ) )\n self.__version = attributes[ \"version\" ]","additions":5,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":6,"deletions":3,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GitAuthor.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GitAuthor.py","filename":"src/github/GitAuthor.py","patch":"@@ -32,12 +32,12 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"date\", \"email\", \"name\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"date\" in attributes and attributes[ \"date\" ] is not None:\n+ if \"date\" in attributes and attributes[ \"date\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"date\" ], ( str, unicode ) )\n self.__date = attributes[ \"date\" ]\n- if \"email\" in attributes and attributes[ \"email\" ] is not None:\n+ if \"email\" in attributes and attributes[ \"email\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"email\" ], ( str, unicode ) )\n self.__email = attributes[ \"email\" ]\n- if \"name\" in attributes and attributes[ \"name\" ] is not None:\n+ if \"name\" in attributes and attributes[ \"name\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"name\" ], ( str, unicode ) )\n self.__name = attributes[ \"name\" ]","additions":3,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":10,"deletions":5,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GitBlob.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GitBlob.py","filename":"src/github/GitBlob.py","patch":"@@ -42,18 +42,18 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"content\", \"encoding\", \"sha\", \"size\", \"url\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"content\" in attributes and attributes[ \"content\" ] is not None:\n+ if \"content\" in attributes and attributes[ \"content\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"content\" ], ( str, unicode ) )\n self.__content = attributes[ \"content\" ]\n- if \"encoding\" in attributes and attributes[ \"encoding\" ] is not None:\n+ if \"encoding\" in attributes and attributes[ \"encoding\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"encoding\" ], ( str, unicode ) )\n self.__encoding = attributes[ \"encoding\" ]\n- if \"sha\" in attributes and attributes[ \"sha\" ] is not None:\n+ if \"sha\" in attributes and attributes[ \"sha\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"sha\" ], ( str, unicode ) )\n self.__sha = attributes[ \"sha\" ]\n- if \"size\" in attributes and attributes[ \"size\" ] is not None:\n+ if \"size\" in attributes and attributes[ \"size\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"size\" ], int )\n self.__size = attributes[ \"size\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"url\" ], ( str, unicode ) )\n self.__url = attributes[ \"url\" ]","additions":5,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":14,"deletions":7,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GitCommit.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GitCommit.py","filename":"src/github/GitCommit.py","patch":"@@ -55,27 +55,27 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"author\", \"committer\", \"message\", \"parents\", \"sha\", \"tree\", \"url\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"author\" in attributes and attributes[ \"author\" ] is not None:\n+ if \"author\" in attributes and attributes[ \"author\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"author\" ], dict )\n self.__author = GitAuthor.GitAuthor( self.__requester, attributes[ \"author\" ], completion = LazyCompletion )\n- if \"committer\" in attributes and attributes[ \"committer\" ] is not None:\n+ if \"committer\" in attributes and attributes[ \"committer\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"committer\" ], dict )\n self.__committer = GitAuthor.GitAuthor( self.__requester, attributes[ \"committer\" ], completion = LazyCompletion )\n- if \"message\" in attributes and attributes[ \"message\" ] is not None:\n+ if \"message\" in attributes and attributes[ \"message\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"message\" ], ( str, unicode ) )\n self.__message = attributes[ \"message\" ]\n- if \"parents\" in attributes and attributes[ \"parents\" ] is not None:\n+ if \"parents\" in attributes and attributes[ \"parents\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"parents\" ], list ) and ( len( attributes[ \"parents\" ] ) == 0 or isinstance( attributes[ \"parents\" ][ 0 ], dict ) )\n self.__parents = [\n GitCommit( self.__requester, element, completion = LazyCompletion )\n for element in attributes[ \"parents\" ]\n ]\n- if \"sha\" in attributes and attributes[ \"sha\" ] is not None:\n+ if \"sha\" in attributes and attributes[ \"sha\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"sha\" ], ( str, unicode ) )\n self.__sha = attributes[ \"sha\" ]\n- if \"tree\" in attributes and attributes[ \"tree\" ] is not None:\n+ if \"tree\" in attributes and attributes[ \"tree\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"tree\" ], dict )\n self.__tree = GitTree.GitTree( self.__requester, attributes[ \"tree\" ], completion = LazyCompletion )\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"url\" ], ( str, unicode ) )\n self.__url = attributes[ \"url\" ]","additions":7,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":6,"deletions":3,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GitObject.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GitObject.py","filename":"src/github/GitObject.py","patch":"@@ -32,12 +32,12 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"sha\", \"type\", \"url\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"sha\" in attributes and attributes[ \"sha\" ] is not None:\n+ if \"sha\" in attributes and attributes[ \"sha\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"sha\" ], ( str, unicode ) )\n self.__sha = attributes[ \"sha\" ]\n- if \"type\" in attributes and attributes[ \"type\" ] is not None:\n+ if \"type\" in attributes and attributes[ \"type\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"type\" ], ( str, unicode ) )\n self.__type = attributes[ \"type\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"url\" ], ( str, unicode ) )\n self.__url = attributes[ \"url\" ]","additions":3,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":6,"deletions":3,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GitRef.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GitRef.py","filename":"src/github/GitRef.py","patch":"@@ -55,12 +55,12 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"object\", \"ref\", \"url\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"object\" in attributes and attributes[ \"object\" ] is not None:\n+ if \"object\" in attributes and attributes[ \"object\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"object\" ], dict )\n self.__object = GitObject.GitObject( self.__requester, attributes[ \"object\" ], completion = LazyCompletion )\n- if \"ref\" in attributes and attributes[ \"ref\" ] is not None:\n+ if \"ref\" in attributes and attributes[ \"ref\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"ref\" ], ( str, unicode ) )\n self.__ref = attributes[ \"ref\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"url\" ], ( str, unicode ) )\n self.__url = attributes[ \"url\" ]","additions":3,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":12,"deletions":6,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GitTag.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GitTag.py","filename":"src/github/GitTag.py","patch":"@@ -49,21 +49,21 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"message\", \"object\", \"sha\", \"tag\", \"tagger\", \"url\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"message\" in attributes and attributes[ \"message\" ] is not None:\n+ if \"message\" in attributes and attributes[ \"message\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"message\" ], ( str, unicode ) )\n self.__message = attributes[ \"message\" ]\n- if \"object\" in attributes and attributes[ \"object\" ] is not None:\n+ if \"object\" in attributes and attributes[ \"object\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"object\" ], dict )\n self.__object = GitObject.GitObject( self.__requester, attributes[ \"object\" ], completion = LazyCompletion )\n- if \"sha\" in attributes and attributes[ \"sha\" ] is not None:\n+ if \"sha\" in attributes and attributes[ \"sha\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"sha\" ], ( str, unicode ) )\n self.__sha = attributes[ \"sha\" ]\n- if \"tag\" in attributes and attributes[ \"tag\" ] is not None:\n+ if \"tag\" in attributes and attributes[ \"tag\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"tag\" ], ( str, unicode ) )\n self.__tag = attributes[ \"tag\" ]\n- if \"tagger\" in attributes and attributes[ \"tagger\" ] is not None:\n+ if \"tagger\" in attributes and attributes[ \"tagger\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"tagger\" ], dict )\n self.__tagger = GitAuthor.GitAuthor( self.__requester, attributes[ \"tagger\" ], completion = LazyCompletion )\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"url\" ], ( str, unicode ) )\n self.__url = attributes[ \"url\" ]","additions":6,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":6,"deletions":3,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GitTree.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GitTree.py","filename":"src/github/GitTree.py","patch":"@@ -33,15 +33,15 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"sha\", \"tree\", \"url\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"sha\" in attributes and attributes[ \"sha\" ] is not None:\n+ if \"sha\" in attributes and attributes[ \"sha\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"sha\" ], ( str, unicode ) )\n self.__sha = attributes[ \"sha\" ]\n- if \"tree\" in attributes and attributes[ \"tree\" ] is not None:\n+ if \"tree\" in attributes and attributes[ \"tree\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"tree\" ], list ) and ( len( attributes[ \"tree\" ] ) == 0 or isinstance( attributes[ \"tree\" ][ 0 ], dict ) )\n self.__tree = [\n GitTreeElement.GitTreeElement( self.__requester, element, completion = LazyCompletion )\n for element in attributes[ \"tree\" ]\n ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"url\" ], ( str, unicode ) )\n self.__url = attributes[ \"url\" ]","additions":3,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":12,"deletions":6,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GitTreeElement.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/GitTreeElement.py","filename":"src/github/GitTreeElement.py","patch":"@@ -47,21 +47,21 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"mode\", \"path\", \"sha\", \"size\", \"type\", \"url\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"mode\" in attributes and attributes[ \"mode\" ] is not None:\n+ if \"mode\" in attributes and attributes[ \"mode\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"mode\" ], ( str, unicode ) )\n self.__mode = attributes[ \"mode\" ]\n- if \"path\" in attributes and attributes[ \"path\" ] is not None:\n+ if \"path\" in attributes and attributes[ \"path\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"path\" ], ( str, unicode ) )\n self.__path = attributes[ \"path\" ]\n- if \"sha\" in attributes and attributes[ \"sha\" ] is not None:\n+ if \"sha\" in attributes and attributes[ \"sha\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"sha\" ], ( str, unicode ) )\n self.__sha = attributes[ \"sha\" ]\n- if \"size\" in attributes and attributes[ \"size\" ] is not None:\n+ if \"size\" in attributes and attributes[ \"size\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"size\" ], int )\n self.__size = attributes[ \"size\" ]\n- if \"type\" in attributes and attributes[ \"type\" ] is not None:\n+ if \"type\" in attributes and attributes[ \"type\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"type\" ], ( str, unicode ) )\n self.__type = attributes[ \"type\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"url\" ], ( str, unicode ) )\n self.__url = attributes[ \"url\" ]","additions":6,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":18,"deletions":9,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Hook.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Hook.py","filename":"src/github/Hook.py","patch":"@@ -99,21 +99,21 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"active\", \"config\", \"created_at\", \"events\", \"id\", \"last_response\", \"name\", \"updated_at\", \"url\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"active\" in attributes and attributes[ \"active\" ] is not None:\n+ if \"active\" in attributes and attributes[ \"active\" ] is not None: # pragma no branch\n self.__active = attributes[ \"active\" ]\n- if \"config\" in attributes and attributes[ \"config\" ] is not None:\n+ if \"config\" in attributes and attributes[ \"config\" ] is not None: # pragma no branch\n self.__config = attributes[ \"config\" ]\n- if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None:\n+ if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None: # pragma no branch\n self.__created_at = attributes[ \"created_at\" ]\n- if \"events\" in attributes and attributes[ \"events\" ] is not None:\n+ if \"events\" in attributes and attributes[ \"events\" ] is not None: # pragma no branch\n self.__events = attributes[ \"events\" ]\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n self.__id = attributes[ \"id\" ]\n- if \"last_response\" in attributes and attributes[ \"last_response\" ] is not None:\n+ if \"last_response\" in attributes and attributes[ \"last_response\" ] is not None: # pragma no branch\n self.__last_response = attributes[ \"last_response\" ]\n- if \"name\" in attributes and attributes[ \"name\" ] is not None:\n+ if \"name\" in attributes and attributes[ \"name\" ] is not None: # pragma no branch\n self.__name = attributes[ \"name\" ]\n- if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None:\n+ if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None: # pragma no branch\n self.__updated_at = attributes[ \"updated_at\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n self.__url = attributes[ \"url\" ]","additions":9,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":53,"deletions":21,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Issue.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Issue.py","filename":"src/github/Issue.py","patch":"@@ -110,7 +110,7 @@ def user( self ):\n return self.__user\n \n def add_to_labels( self, *labels ):\n- post_parameters = labels\n+ post_parameters = [ label.name for label in labels ]\n status, headers, data = self.__requester.request(\n \"POST\",\n str( self.url ) + \"/labels\",\n@@ -131,7 +131,12 @@ def create_comment( self, body ):\n return IssueComment.IssueComment( self.__requester, data, completion = NoCompletion )\n \n def delete_labels( self ):\n- pass\n+ status, headers, data = self.__requester.request(\n+ \"DELETE\",\n+ str( self.url ) + \"/labels\",\n+ None,\n+ None\n+ )\n \n def edit( self, title = DefaultValueForOptionalParameters, body = DefaultValueForOptionalParameters, assignee = DefaultValueForOptionalParameters, state = DefaultValueForOptionalParameters, milestone = DefaultValueForOptionalParameters, labels = DefaultValueForOptionalParameters ):\n post_parameters = {\n@@ -216,7 +221,13 @@ def remove_from_labels( self, label ):\n )\n \n def set_labels( self, *labels ):\n- pass\n+ post_parameters = [ label.name for label in labels ]\n+ status, headers, data = self.__requester.request(\n+ \"PUT\",\n+ str( self.url ) + \"/labels\",\n+ None,\n+ post_parameters\n+ )\n \n def __initAttributes( self ):\n self.__assignee = None\n@@ -257,59 +268,59 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"assignee\", \"body\", \"closed_at\", \"closed_by\", \"comments\", \"created_at\", \"html_url\", \"id\", \"labels\", \"milestone\", \"number\", \"pull_request\", \"repository\", \"state\", \"title\", \"updated_at\", \"url\", \"user\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"assignee\" in attributes and attributes[ \"assignee\" ] is not None:\n+ if \"assignee\" in attributes and attributes[ \"assignee\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"assignee\" ], dict )\n self.__assignee = NamedUser.NamedUser( self.__requester, attributes[ \"assignee\" ], completion = LazyCompletion )\n- if \"body\" in attributes and attributes[ \"body\" ] is not None:\n+ if \"body\" in attributes and attributes[ \"body\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"body\" ], ( str, unicode ) )\n self.__body = attributes[ \"body\" ]\n- if \"closed_at\" in attributes and attributes[ \"closed_at\" ] is not None:\n+ if \"closed_at\" in attributes and attributes[ \"closed_at\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"closed_at\" ], ( str, unicode ) )\n self.__closed_at = attributes[ \"closed_at\" ]\n- if \"closed_by\" in attributes and attributes[ \"closed_by\" ] is not None:\n+ if \"closed_by\" in attributes and attributes[ \"closed_by\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"closed_by\" ], dict )\n self.__closed_by = NamedUser.NamedUser( self.__requester, attributes[ \"closed_by\" ], completion = LazyCompletion )\n- if \"comments\" in attributes and attributes[ \"comments\" ] is not None:\n+ if \"comments\" in attributes and attributes[ \"comments\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"comments\" ], int )\n self.__comments = attributes[ \"comments\" ]\n- if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None:\n+ if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"created_at\" ], ( str, unicode ) )\n self.__created_at = attributes[ \"created_at\" ]\n- if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None:\n+ if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"html_url\" ], ( str, unicode ) )\n self.__html_url = attributes[ \"html_url\" ]\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"id\" ], int )\n self.__id = attributes[ \"id\" ]\n- if \"labels\" in attributes and attributes[ \"labels\" ] is not None:\n+ if \"labels\" in attributes and attributes[ \"labels\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"labels\" ], list ) and ( len( attributes[ \"labels\" ] ) == 0 or isinstance( attributes[ \"labels\" ][ 0 ], dict ) )\n self.__labels = [\n Label.Label( self.__requester, element, completion = LazyCompletion )\n for element in attributes[ \"labels\" ]\n ]\n- if \"milestone\" in attributes and attributes[ \"milestone\" ] is not None:\n+ if \"milestone\" in attributes and attributes[ \"milestone\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"milestone\" ], dict )\n self.__milestone = Milestone.Milestone( self.__requester, attributes[ \"milestone\" ], completion = LazyCompletion )\n- if \"number\" in attributes and attributes[ \"number\" ] is not None:\n+ if \"number\" in attributes and attributes[ \"number\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"number\" ], int )\n self.__number = attributes[ \"number\" ]\n- if \"pull_request\" in attributes and attributes[ \"pull_request\" ] is not None:\n+ if \"pull_request\" in attributes and attributes[ \"pull_request\" ] is not None: # pragma no branch\n self.__pull_request = attributes[ \"pull_request\" ]\n- if \"repository\" in attributes and attributes[ \"repository\" ] is not None:\n+ if \"repository\" in attributes and attributes[ \"repository\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"repository\" ], dict )\n self.__repository = Repository.Repository( self.__requester, attributes[ \"repository\" ], completion = LazyCompletion )\n- if \"state\" in attributes and attributes[ \"state\" ] is not None:\n+ if \"state\" in attributes and attributes[ \"state\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"state\" ], ( str, unicode ) )\n self.__state = attributes[ \"state\" ]\n- if \"title\" in attributes and attributes[ \"title\" ] is not None:\n+ if \"title\" in attributes and attributes[ \"title\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"title\" ], ( str, unicode ) )\n self.__title = attributes[ \"title\" ]\n- if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None:\n+ if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"updated_at\" ], ( str, unicode ) )\n self.__updated_at = attributes[ \"updated_at\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"url\" ], ( str, unicode ) )\n self.__url = attributes[ \"url\" ]\n- if \"user\" in attributes and attributes[ \"user\" ] is not None:\n+ if \"user\" in attributes and attributes[ \"user\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"user\" ], dict )\n self.__user = NamedUser.NamedUser( self.__requester, attributes[ \"user\" ], completion = LazyCompletion )","additions":32,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":12,"deletions":6,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/IssueComment.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/IssueComment.py","filename":"src/github/IssueComment.py","patch":"@@ -68,16 +68,16 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"body\", \"created_at\", \"id\", \"updated_at\", \"url\", \"user\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"body\" in attributes and attributes[ \"body\" ] is not None:\n+ if \"body\" in attributes and attributes[ \"body\" ] is not None: # pragma no branch\n self.__body = attributes[ \"body\" ]\n- if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None:\n+ if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None: # pragma no branch\n self.__created_at = attributes[ \"created_at\" ]\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n self.__id = attributes[ \"id\" ]\n- if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None:\n+ if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None: # pragma no branch\n self.__updated_at = attributes[ \"updated_at\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n self.__url = attributes[ \"url\" ]\n- if \"user\" in attributes and attributes[ \"user\" ] is not None:\n+ if \"user\" in attributes and attributes[ \"user\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"user\" ], dict )\n self.__user = NamedUser.NamedUser( self.__requester, attributes[ \"user\" ], completion = LazyCompletion )","additions":6,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":14,"deletions":7,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/IssueEvent.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/IssueEvent.py","filename":"src/github/IssueEvent.py","patch":"@@ -78,24 +78,24 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"actor\", \"commit_id\", \"created_at\", \"event\", \"id\", \"issue\", \"url\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"actor\" in attributes and attributes[ \"actor\" ] is not None:\n+ if \"actor\" in attributes and attributes[ \"actor\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"actor\" ], dict )\n self.__actor = NamedUser.NamedUser( self.__requester, attributes[ \"actor\" ], completion = LazyCompletion )\n- if \"commit_id\" in attributes and attributes[ \"commit_id\" ] is not None:\n+ if \"commit_id\" in attributes and attributes[ \"commit_id\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"commit_id\" ], ( str, unicode ) )\n self.__commit_id = attributes[ \"commit_id\" ]\n- if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None:\n+ if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"created_at\" ], ( str, unicode ) )\n self.__created_at = attributes[ \"created_at\" ]\n- if \"event\" in attributes and attributes[ \"event\" ] is not None:\n+ if \"event\" in attributes and attributes[ \"event\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"event\" ], ( str, unicode ) )\n self.__event = attributes[ \"event\" ]\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"id\" ], int )\n self.__id = attributes[ \"id\" ]\n- if \"issue\" in attributes and attributes[ \"issue\" ] is not None:\n+ if \"issue\" in attributes and attributes[ \"issue\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"issue\" ], dict )\n self.__issue = Issue.Issue( self.__requester, attributes[ \"issue\" ], completion = LazyCompletion )\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"url\" ], ( str, unicode ) )\n self.__url = attributes[ \"url\" ]","additions":7,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":13,"deletions":3,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Label.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Label.py","filename":"src/github/Label.py","patch":"@@ -1,6 +1,8 @@\n # WARNING: this file is generated automaticaly.\n # Do not modify it manually, your work would be lost.\n \n+import urllib\n+\n import PaginatedList\n from GithubObject import *\n \n@@ -43,6 +45,11 @@ def edit( self, name, color ):\n )\n self.__useAttributes( data )\n \n+ # @toto Remove '_identity' from the normalized json description\n+ @property\n+ def _identity( self ):\n+ return urllib.quote( self.name )\n+\n def __initAttributes( self ):\n self.__color = None\n self.__name = None\n@@ -53,9 +60,9 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"color\", \"name\", \"url\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"color\" in attributes and attributes[ \"color\" ] is not None:\n+ if \"color\" in attributes and attributes[ \"color\" ] is not None: # pragma no branch\n self.__color = attributes[ \"color\" ]\n- if \"name\" in attributes and attributes[ \"name\" ] is not None:\n+ if \"name\" in attributes and attributes[ \"name\" ] is not None: # pragma no branch\n self.__name = attributes[ \"name\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n self.__url = attributes[ \"url\" ]","additions":10,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":22,"deletions":11,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Milestone.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Milestone.py","filename":"src/github/Milestone.py","patch":"@@ -114,36 +114,36 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"closed_issues\", \"created_at\", \"creator\", \"description\", \"due_on\", \"id\", \"number\", \"open_issues\", \"state\", \"title\", \"url\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"closed_issues\" in attributes and attributes[ \"closed_issues\" ] is not None:\n+ if \"closed_issues\" in attributes and attributes[ \"closed_issues\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"closed_issues\" ], int )\n self.__closed_issues = attributes[ \"closed_issues\" ]\n- if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None:\n+ if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"created_at\" ], ( str, unicode ) )\n self.__created_at = attributes[ \"created_at\" ]\n- if \"creator\" in attributes and attributes[ \"creator\" ] is not None:\n+ if \"creator\" in attributes and attributes[ \"creator\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"creator\" ], dict )\n self.__creator = NamedUser.NamedUser( self.__requester, attributes[ \"creator\" ], completion = LazyCompletion )\n- if \"description\" in attributes and attributes[ \"description\" ] is not None:\n+ if \"description\" in attributes and attributes[ \"description\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"description\" ], ( str, unicode ) )\n self.__description = attributes[ \"description\" ]\n- if \"due_on\" in attributes and attributes[ \"due_on\" ] is not None:\n+ if \"due_on\" in attributes and attributes[ \"due_on\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"due_on\" ], ( str, unicode ) )\n self.__due_on = attributes[ \"due_on\" ]\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"id\" ], int )\n self.__id = attributes[ \"id\" ]\n- if \"number\" in attributes and attributes[ \"number\" ] is not None:\n+ if \"number\" in attributes and attributes[ \"number\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"number\" ], int )\n self.__number = attributes[ \"number\" ]\n- if \"open_issues\" in attributes and attributes[ \"open_issues\" ] is not None:\n+ if \"open_issues\" in attributes and attributes[ \"open_issues\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"open_issues\" ], int )\n self.__open_issues = attributes[ \"open_issues\" ]\n- if \"state\" in attributes and attributes[ \"state\" ] is not None:\n+ if \"state\" in attributes and attributes[ \"state\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"state\" ], ( str, unicode ) )\n self.__state = attributes[ \"state\" ]\n- if \"title\" in attributes and attributes[ \"title\" ] is not None:\n+ if \"title\" in attributes and attributes[ \"title\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"title\" ], ( str, unicode ) )\n self.__title = attributes[ \"title\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"url\" ], ( str, unicode ) )\n self.__url = attributes[ \"url\" ]","additions":11,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":52,"deletions":26,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/NamedUser.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/NamedUser.py","filename":"src/github/NamedUser.py","patch":"@@ -365,81 +365,81 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"avatar_url\", \"bio\", \"blog\", \"collaborators\", \"company\", \"contributions\", \"created_at\", \"disk_usage\", \"email\", \"followers\", \"following\", \"gravatar_id\", \"hireable\", \"html_url\", \"id\", \"location\", \"login\", \"name\", \"owned_private_repos\", \"plan\", \"private_gists\", \"public_gists\", \"public_repos\", \"total_private_repos\", \"type\", \"url\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"avatar_url\" in attributes and attributes[ \"avatar_url\" ] is not None:\n+ if \"avatar_url\" in attributes and attributes[ \"avatar_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"avatar_url\" ], ( str, unicode ) )\n self.__avatar_url = attributes[ \"avatar_url\" ]\n- if \"bio\" in attributes and attributes[ \"bio\" ] is not None:\n+ if \"bio\" in attributes and attributes[ \"bio\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"bio\" ], ( str, unicode ) )\n self.__bio = attributes[ \"bio\" ]\n- if \"blog\" in attributes and attributes[ \"blog\" ] is not None:\n+ if \"blog\" in attributes and attributes[ \"blog\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"blog\" ], ( str, unicode ) )\n self.__blog = attributes[ \"blog\" ]\n- if \"collaborators\" in attributes and attributes[ \"collaborators\" ] is not None:\n+ if \"collaborators\" in attributes and attributes[ \"collaborators\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"collaborators\" ], int )\n self.__collaborators = attributes[ \"collaborators\" ]\n- if \"company\" in attributes and attributes[ \"company\" ] is not None:\n+ if \"company\" in attributes and attributes[ \"company\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"company\" ], ( str, unicode ) )\n self.__company = attributes[ \"company\" ]\n- if \"contributions\" in attributes and attributes[ \"contributions\" ] is not None:\n+ if \"contributions\" in attributes and attributes[ \"contributions\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"contributions\" ], int )\n self.__contributions = attributes[ \"contributions\" ]\n- if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None:\n+ if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"created_at\" ], ( str, unicode ) )\n self.__created_at = attributes[ \"created_at\" ]\n- if \"disk_usage\" in attributes and attributes[ \"disk_usage\" ] is not None:\n+ if \"disk_usage\" in attributes and attributes[ \"disk_usage\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"disk_usage\" ], int )\n self.__disk_usage = attributes[ \"disk_usage\" ]\n- if \"email\" in attributes and attributes[ \"email\" ] is not None:\n+ if \"email\" in attributes and attributes[ \"email\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"email\" ], ( str, unicode ) )\n self.__email = attributes[ \"email\" ]\n- if \"followers\" in attributes and attributes[ \"followers\" ] is not None:\n+ if \"followers\" in attributes and attributes[ \"followers\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"followers\" ], int )\n self.__followers = attributes[ \"followers\" ]\n- if \"following\" in attributes and attributes[ \"following\" ] is not None:\n+ if \"following\" in attributes and attributes[ \"following\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"following\" ], int )\n self.__following = attributes[ \"following\" ]\n- if \"gravatar_id\" in attributes and attributes[ \"gravatar_id\" ] is not None:\n+ if \"gravatar_id\" in attributes and attributes[ \"gravatar_id\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"gravatar_id\" ], ( str, unicode ) )\n self.__gravatar_id = attributes[ \"gravatar_id\" ]\n- if \"hireable\" in attributes and attributes[ \"hireable\" ] is not None:\n+ if \"hireable\" in attributes and attributes[ \"hireable\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"hireable\" ], bool )\n self.__hireable = attributes[ \"hireable\" ]\n- if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None:\n+ if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"html_url\" ], ( str, unicode ) )\n self.__html_url = attributes[ \"html_url\" ]\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"id\" ], int )\n self.__id = attributes[ \"id\" ]\n- if \"location\" in attributes and attributes[ \"location\" ] is not None:\n+ if \"location\" in attributes and attributes[ \"location\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"location\" ], ( str, unicode ) )\n self.__location = attributes[ \"location\" ]\n- if \"login\" in attributes and attributes[ \"login\" ] is not None:\n+ if \"login\" in attributes and attributes[ \"login\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"login\" ], ( str, unicode ) )\n self.__login = attributes[ \"login\" ]\n- if \"name\" in attributes and attributes[ \"name\" ] is not None:\n+ if \"name\" in attributes and attributes[ \"name\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"name\" ], ( str, unicode ) )\n self.__name = attributes[ \"name\" ]\n- if \"owned_private_repos\" in attributes and attributes[ \"owned_private_repos\" ] is not None:\n+ if \"owned_private_repos\" in attributes and attributes[ \"owned_private_repos\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"owned_private_repos\" ], int )\n self.__owned_private_repos = attributes[ \"owned_private_repos\" ]\n- if \"plan\" in attributes and attributes[ \"plan\" ] is not None:\n+ if \"plan\" in attributes and attributes[ \"plan\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"plan\" ], dict )\n self.__plan = Plan.Plan( self.__requester, attributes[ \"plan\" ], completion = LazyCompletion )\n- if \"private_gists\" in attributes and attributes[ \"private_gists\" ] is not None:\n+ if \"private_gists\" in attributes and attributes[ \"private_gists\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"private_gists\" ], int )\n self.__private_gists = attributes[ \"private_gists\" ]\n- if \"public_gists\" in attributes and attributes[ \"public_gists\" ] is not None:\n+ if \"public_gists\" in attributes and attributes[ \"public_gists\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"public_gists\" ], int )\n self.__public_gists = attributes[ \"public_gists\" ]\n- if \"public_repos\" in attributes and attributes[ \"public_repos\" ] is not None:\n+ if \"public_repos\" in attributes and attributes[ \"public_repos\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"public_repos\" ], int )\n self.__public_repos = attributes[ \"public_repos\" ]\n- if \"total_private_repos\" in attributes and attributes[ \"total_private_repos\" ] is not None:\n+ if \"total_private_repos\" in attributes and attributes[ \"total_private_repos\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"total_private_repos\" ], int )\n self.__total_private_repos = attributes[ \"total_private_repos\" ]\n- if \"type\" in attributes and attributes[ \"type\" ] is not None:\n+ if \"type\" in attributes and attributes[ \"type\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"type\" ], ( str, unicode ) )\n self.__type = attributes[ \"type\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"url\" ], ( str, unicode ) )\n self.__url = attributes[ \"url\" ]","additions":26,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":48,"deletions":24,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Organization.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Organization.py","filename":"src/github/Organization.py","patch":"@@ -390,75 +390,75 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"avatar_url\", \"billing_email\", \"blog\", \"collaborators\", \"company\", \"created_at\", \"disk_usage\", \"email\", \"followers\", \"following\", \"gravatar_id\", \"html_url\", \"id\", \"location\", \"login\", \"name\", \"owned_private_repos\", \"plan\", \"private_gists\", \"public_gists\", \"public_repos\", \"total_private_repos\", \"type\", \"url\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"avatar_url\" in attributes and attributes[ \"avatar_url\" ] is not None:\n+ if \"avatar_url\" in attributes and attributes[ \"avatar_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"avatar_url\" ], ( str, unicode ) )\n self.__avatar_url = attributes[ \"avatar_url\" ]\n- if \"billing_email\" in attributes and attributes[ \"billing_email\" ] is not None:\n+ if \"billing_email\" in attributes and attributes[ \"billing_email\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"billing_email\" ], ( str, unicode ) )\n self.__billing_email = attributes[ \"billing_email\" ]\n- if \"blog\" in attributes and attributes[ \"blog\" ] is not None:\n+ if \"blog\" in attributes and attributes[ \"blog\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"blog\" ], ( str, unicode ) )\n self.__blog = attributes[ \"blog\" ]\n- if \"collaborators\" in attributes and attributes[ \"collaborators\" ] is not None:\n+ if \"collaborators\" in attributes and attributes[ \"collaborators\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"collaborators\" ], int )\n self.__collaborators = attributes[ \"collaborators\" ]\n- if \"company\" in attributes and attributes[ \"company\" ] is not None:\n+ if \"company\" in attributes and attributes[ \"company\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"company\" ], ( str, unicode ) )\n self.__company = attributes[ \"company\" ]\n- if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None:\n+ if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"created_at\" ], ( str, unicode ) )\n self.__created_at = attributes[ \"created_at\" ]\n- if \"disk_usage\" in attributes and attributes[ \"disk_usage\" ] is not None:\n+ if \"disk_usage\" in attributes and attributes[ \"disk_usage\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"disk_usage\" ], int )\n self.__disk_usage = attributes[ \"disk_usage\" ]\n- if \"email\" in attributes and attributes[ \"email\" ] is not None:\n+ if \"email\" in attributes and attributes[ \"email\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"email\" ], ( str, unicode ) )\n self.__email = attributes[ \"email\" ]\n- if \"followers\" in attributes and attributes[ \"followers\" ] is not None:\n+ if \"followers\" in attributes and attributes[ \"followers\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"followers\" ], int )\n self.__followers = attributes[ \"followers\" ]\n- if \"following\" in attributes and attributes[ \"following\" ] is not None:\n+ if \"following\" in attributes and attributes[ \"following\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"following\" ], int )\n self.__following = attributes[ \"following\" ]\n- if \"gravatar_id\" in attributes and attributes[ \"gravatar_id\" ] is not None:\n+ if \"gravatar_id\" in attributes and attributes[ \"gravatar_id\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"gravatar_id\" ], ( str, unicode ) )\n self.__gravatar_id = attributes[ \"gravatar_id\" ]\n- if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None:\n+ if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"html_url\" ], ( str, unicode ) )\n self.__html_url = attributes[ \"html_url\" ]\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"id\" ], int )\n self.__id = attributes[ \"id\" ]\n- if \"location\" in attributes and attributes[ \"location\" ] is not None:\n+ if \"location\" in attributes and attributes[ \"location\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"location\" ], ( str, unicode ) )\n self.__location = attributes[ \"location\" ]\n- if \"login\" in attributes and attributes[ \"login\" ] is not None:\n+ if \"login\" in attributes and attributes[ \"login\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"login\" ], ( str, unicode ) )\n self.__login = attributes[ \"login\" ]\n- if \"name\" in attributes and attributes[ \"name\" ] is not None:\n+ if \"name\" in attributes and attributes[ \"name\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"name\" ], ( str, unicode ) )\n self.__name = attributes[ \"name\" ]\n- if \"owned_private_repos\" in attributes and attributes[ \"owned_private_repos\" ] is not None:\n+ if \"owned_private_repos\" in attributes and attributes[ \"owned_private_repos\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"owned_private_repos\" ], int )\n self.__owned_private_repos = attributes[ \"owned_private_repos\" ]\n- if \"plan\" in attributes and attributes[ \"plan\" ] is not None:\n+ if \"plan\" in attributes and attributes[ \"plan\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"plan\" ], dict )\n self.__plan = Plan.Plan( self.__requester, attributes[ \"plan\" ], completion = LazyCompletion )\n- if \"private_gists\" in attributes and attributes[ \"private_gists\" ] is not None:\n+ if \"private_gists\" in attributes and attributes[ \"private_gists\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"private_gists\" ], int )\n self.__private_gists = attributes[ \"private_gists\" ]\n- if \"public_gists\" in attributes and attributes[ \"public_gists\" ] is not None:\n+ if \"public_gists\" in attributes and attributes[ \"public_gists\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"public_gists\" ], int )\n self.__public_gists = attributes[ \"public_gists\" ]\n- if \"public_repos\" in attributes and attributes[ \"public_repos\" ] is not None:\n+ if \"public_repos\" in attributes and attributes[ \"public_repos\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"public_repos\" ], int )\n self.__public_repos = attributes[ \"public_repos\" ]\n- if \"total_private_repos\" in attributes and attributes[ \"total_private_repos\" ] is not None:\n+ if \"total_private_repos\" in attributes and attributes[ \"total_private_repos\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"total_private_repos\" ], int )\n self.__total_private_repos = attributes[ \"total_private_repos\" ]\n- if \"type\" in attributes and attributes[ \"type\" ] is not None:\n+ if \"type\" in attributes and attributes[ \"type\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"type\" ], ( str, unicode ) )\n self.__type = attributes[ \"type\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"url\" ], ( str, unicode ) )\n self.__url = attributes[ \"url\" ]","additions":24,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":6,"deletions":3,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Permissions.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Permissions.py","filename":"src/github/Permissions.py","patch":"@@ -32,12 +32,12 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"admin\", \"pull\", \"push\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"admin\" in attributes and attributes[ \"admin\" ] is not None:\n+ if \"admin\" in attributes and attributes[ \"admin\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"admin\" ], bool )\n self.__admin = attributes[ \"admin\" ]\n- if \"pull\" in attributes and attributes[ \"pull\" ] is not None:\n+ if \"pull\" in attributes and attributes[ \"pull\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"pull\" ], bool )\n self.__pull = attributes[ \"pull\" ]\n- if \"push\" in attributes and attributes[ \"push\" ] is not None:\n+ if \"push\" in attributes and attributes[ \"push\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"push\" ], bool )\n self.__push = attributes[ \"push\" ]","additions":3,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":8,"deletions":4,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Plan.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Plan.py","filename":"src/github/Plan.py","patch":"@@ -37,15 +37,15 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"collaborators\", \"name\", \"private_repos\", \"space\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"collaborators\" in attributes and attributes[ \"collaborators\" ] is not None:\n+ if \"collaborators\" in attributes and attributes[ \"collaborators\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"collaborators\" ], int )\n self.__collaborators = attributes[ \"collaborators\" ]\n- if \"name\" in attributes and attributes[ \"name\" ] is not None:\n+ if \"name\" in attributes and attributes[ \"name\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"name\" ], ( str, unicode ) )\n self.__name = attributes[ \"name\" ]\n- if \"private_repos\" in attributes and attributes[ \"private_repos\" ] is not None:\n+ if \"private_repos\" in attributes and attributes[ \"private_repos\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"private_repos\" ], int )\n self.__private_repos = attributes[ \"private_repos\" ]\n- if \"space\" in attributes and attributes[ \"space\" ] is not None:\n+ if \"space\" in attributes and attributes[ \"space\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"space\" ], int )\n self.__space = attributes[ \"space\" ]","additions":4,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":52,"deletions":26,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/PullRequest.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/PullRequest.py","filename":"src/github/PullRequest.py","patch":"@@ -279,56 +279,56 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"additions\", \"base\", \"body\", \"changed_files\", \"closed_at\", \"comments\", \"commits\", \"created_at\", \"deletions\", \"diff_url\", \"head\", \"html_url\", \"id\", \"issue_url\", \"mergeable\", \"merged\", \"merged_at\", \"merged_by\", \"number\", \"patch_url\", \"review_comments\", \"state\", \"title\", \"updated_at\", \"url\", \"user\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"additions\" in attributes and attributes[ \"additions\" ] is not None:\n+ if \"additions\" in attributes and attributes[ \"additions\" ] is not None: # pragma no branch\n self.__additions = attributes[ \"additions\" ]\n- if \"base\" in attributes and attributes[ \"base\" ] is not None:\n+ if \"base\" in attributes and attributes[ \"base\" ] is not None: # pragma no branch\n self.__base = attributes[ \"base\" ]\n- if \"body\" in attributes and attributes[ \"body\" ] is not None:\n+ if \"body\" in attributes and attributes[ \"body\" ] is not None: # pragma no branch\n self.__body = attributes[ \"body\" ]\n- if \"changed_files\" in attributes and attributes[ \"changed_files\" ] is not None:\n+ if \"changed_files\" in attributes and attributes[ \"changed_files\" ] is not None: # pragma no branch\n self.__changed_files = attributes[ \"changed_files\" ]\n- if \"closed_at\" in attributes and attributes[ \"closed_at\" ] is not None:\n+ if \"closed_at\" in attributes and attributes[ \"closed_at\" ] is not None: # pragma no branch\n self.__closed_at = attributes[ \"closed_at\" ]\n- if \"comments\" in attributes and attributes[ \"comments\" ] is not None:\n+ if \"comments\" in attributes and attributes[ \"comments\" ] is not None: # pragma no branch\n self.__comments = attributes[ \"comments\" ]\n- if \"commits\" in attributes and attributes[ \"commits\" ] is not None:\n+ if \"commits\" in attributes and attributes[ \"commits\" ] is not None: # pragma no branch\n self.__commits = attributes[ \"commits\" ]\n- if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None:\n+ if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None: # pragma no branch\n self.__created_at = attributes[ \"created_at\" ]\n- if \"deletions\" in attributes and attributes[ \"deletions\" ] is not None:\n+ if \"deletions\" in attributes and attributes[ \"deletions\" ] is not None: # pragma no branch\n self.__deletions = attributes[ \"deletions\" ]\n- if \"diff_url\" in attributes and attributes[ \"diff_url\" ] is not None:\n+ if \"diff_url\" in attributes and attributes[ \"diff_url\" ] is not None: # pragma no branch\n self.__diff_url = attributes[ \"diff_url\" ]\n- if \"head\" in attributes and attributes[ \"head\" ] is not None:\n+ if \"head\" in attributes and attributes[ \"head\" ] is not None: # pragma no branch\n self.__head = attributes[ \"head\" ]\n- if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None:\n+ if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None: # pragma no branch\n self.__html_url = attributes[ \"html_url\" ]\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n self.__id = attributes[ \"id\" ]\n- if \"issue_url\" in attributes and attributes[ \"issue_url\" ] is not None:\n+ if \"issue_url\" in attributes and attributes[ \"issue_url\" ] is not None: # pragma no branch\n self.__issue_url = attributes[ \"issue_url\" ]\n- if \"mergeable\" in attributes and attributes[ \"mergeable\" ] is not None:\n+ if \"mergeable\" in attributes and attributes[ \"mergeable\" ] is not None: # pragma no branch\n self.__mergeable = attributes[ \"mergeable\" ]\n- if \"merged\" in attributes and attributes[ \"merged\" ] is not None:\n+ if \"merged\" in attributes and attributes[ \"merged\" ] is not None: # pragma no branch\n self.__merged = attributes[ \"merged\" ]\n- if \"merged_at\" in attributes and attributes[ \"merged_at\" ] is not None:\n+ if \"merged_at\" in attributes and attributes[ \"merged_at\" ] is not None: # pragma no branch\n self.__merged_at = attributes[ \"merged_at\" ]\n- if \"merged_by\" in attributes and attributes[ \"merged_by\" ] is not None:\n+ if \"merged_by\" in attributes and attributes[ \"merged_by\" ] is not None: # pragma no branch\n self.__merged_by = attributes[ \"merged_by\" ]\n- if \"number\" in attributes and attributes[ \"number\" ] is not None:\n+ if \"number\" in attributes and attributes[ \"number\" ] is not None: # pragma no branch\n self.__number = attributes[ \"number\" ]\n- if \"patch_url\" in attributes and attributes[ \"patch_url\" ] is not None:\n+ if \"patch_url\" in attributes and attributes[ \"patch_url\" ] is not None: # pragma no branch\n self.__patch_url = attributes[ \"patch_url\" ]\n- if \"review_comments\" in attributes and attributes[ \"review_comments\" ] is not None:\n+ if \"review_comments\" in attributes and attributes[ \"review_comments\" ] is not None: # pragma no branch\n self.__review_comments = attributes[ \"review_comments\" ]\n- if \"state\" in attributes and attributes[ \"state\" ] is not None:\n+ if \"state\" in attributes and attributes[ \"state\" ] is not None: # pragma no branch\n self.__state = attributes[ \"state\" ]\n- if \"title\" in attributes and attributes[ \"title\" ] is not None:\n+ if \"title\" in attributes and attributes[ \"title\" ] is not None: # pragma no branch\n self.__title = attributes[ \"title\" ]\n- if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None:\n+ if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None: # pragma no branch\n self.__updated_at = attributes[ \"updated_at\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n self.__url = attributes[ \"url\" ]\n- if \"user\" in attributes and attributes[ \"user\" ] is not None:\n+ if \"user\" in attributes and attributes[ \"user\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"user\" ], dict )\n self.__user = NamedUser.NamedUser( self.__requester, attributes[ \"user\" ], completion = LazyCompletion )","additions":26,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":22,"deletions":11,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/PullRequestComment.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/PullRequestComment.py","filename":"src/github/PullRequestComment.py","patch":"@@ -121,26 +121,26 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"body\", \"commit_id\", \"created_at\", \"html_url\", \"id\", \"line\", \"path\", \"position\", \"updated_at\", \"url\", \"user\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"body\" in attributes and attributes[ \"body\" ] is not None:\n+ if \"body\" in attributes and attributes[ \"body\" ] is not None: # pragma no branch\n self.__body = attributes[ \"body\" ]\n- if \"commit_id\" in attributes and attributes[ \"commit_id\" ] is not None:\n+ if \"commit_id\" in attributes and attributes[ \"commit_id\" ] is not None: # pragma no branch\n self.__commit_id = attributes[ \"commit_id\" ]\n- if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None:\n+ if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None: # pragma no branch\n self.__created_at = attributes[ \"created_at\" ]\n- if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None:\n+ if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None: # pragma no branch\n self.__html_url = attributes[ \"html_url\" ]\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n self.__id = attributes[ \"id\" ]\n- if \"line\" in attributes and attributes[ \"line\" ] is not None:\n+ if \"line\" in attributes and attributes[ \"line\" ] is not None: # pragma no branch\n self.__line = attributes[ \"line\" ]\n- if \"path\" in attributes and attributes[ \"path\" ] is not None:\n+ if \"path\" in attributes and attributes[ \"path\" ] is not None: # pragma no branch\n self.__path = attributes[ \"path\" ]\n- if \"position\" in attributes and attributes[ \"position\" ] is not None:\n+ if \"position\" in attributes and attributes[ \"position\" ] is not None: # pragma no branch\n self.__position = attributes[ \"position\" ]\n- if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None:\n+ if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None: # pragma no branch\n self.__updated_at = attributes[ \"updated_at\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n self.__url = attributes[ \"url\" ]\n- if \"user\" in attributes and attributes[ \"user\" ] is not None:\n+ if \"user\" in attributes and attributes[ \"user\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"user\" ], dict )\n self.__user = NamedUser.NamedUser( self.__requester, attributes[ \"user\" ], completion = LazyCompletion )","additions":11,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":18,"deletions":9,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/PullRequestFile.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/PullRequestFile.py","filename":"src/github/PullRequestFile.py","patch":"@@ -62,21 +62,21 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"additions\", \"blob_url\", \"changes\", \"deletions\", \"filename\", \"patch\", \"raw_url\", \"sha\", \"status\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"additions\" in attributes and attributes[ \"additions\" ] is not None:\n+ if \"additions\" in attributes and attributes[ \"additions\" ] is not None: # pragma no branch\n self.__additions = attributes[ \"additions\" ]\n- if \"blob_url\" in attributes and attributes[ \"blob_url\" ] is not None:\n+ if \"blob_url\" in attributes and attributes[ \"blob_url\" ] is not None: # pragma no branch\n self.__blob_url = attributes[ \"blob_url\" ]\n- if \"changes\" in attributes and attributes[ \"changes\" ] is not None:\n+ if \"changes\" in attributes and attributes[ \"changes\" ] is not None: # pragma no branch\n self.__changes = attributes[ \"changes\" ]\n- if \"deletions\" in attributes and attributes[ \"deletions\" ] is not None:\n+ if \"deletions\" in attributes and attributes[ \"deletions\" ] is not None: # pragma no branch\n self.__deletions = attributes[ \"deletions\" ]\n- if \"filename\" in attributes and attributes[ \"filename\" ] is not None:\n+ if \"filename\" in attributes and attributes[ \"filename\" ] is not None: # pragma no branch\n self.__filename = attributes[ \"filename\" ]\n- if \"patch\" in attributes and attributes[ \"patch\" ] is not None:\n+ if \"patch\" in attributes and attributes[ \"patch\" ] is not None: # pragma no branch\n self.__patch = attributes[ \"patch\" ]\n- if \"raw_url\" in attributes and attributes[ \"raw_url\" ] is not None:\n+ if \"raw_url\" in attributes and attributes[ \"raw_url\" ] is not None: # pragma no branch\n self.__raw_url = attributes[ \"raw_url\" ]\n- if \"sha\" in attributes and attributes[ \"sha\" ] is not None:\n+ if \"sha\" in attributes and attributes[ \"sha\" ] is not None: # pragma no branch\n self.__sha = attributes[ \"sha\" ]\n- if \"status\" in attributes and attributes[ \"status\" ] is not None:\n+ if \"status\" in attributes and attributes[ \"status\" ] is not None: # pragma no branch\n self.__status = attributes[ \"status\" ]","additions":9,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":62,"deletions":31,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Repository.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Repository.py","filename":"src/github/Repository.py","patch":"@@ -905,96 +905,96 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"clone_url\", \"created_at\", \"description\", \"fork\", \"forks\", \"full_name\", \"git_url\", \"has_downloads\", \"has_issues\", \"has_wiki\", \"homepage\", \"html_url\", \"id\", \"language\", \"master_branch\", \"mirror_url\", \"name\", \"open_issues\", \"organization\", \"owner\", \"parent\", \"permissions\", \"private\", \"pushed_at\", \"size\", \"source\", \"ssh_url\", \"svn_url\", \"updated_at\", \"url\", \"watchers\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"clone_url\" in attributes and attributes[ \"clone_url\" ] is not None:\n+ if \"clone_url\" in attributes and attributes[ \"clone_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"clone_url\" ], ( str, unicode ) )\n self.__clone_url = attributes[ \"clone_url\" ]\n- if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None:\n+ if \"created_at\" in attributes and attributes[ \"created_at\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"created_at\" ], ( str, unicode ) )\n self.__created_at = attributes[ \"created_at\" ]\n- if \"description\" in attributes and attributes[ \"description\" ] is not None:\n+ if \"description\" in attributes and attributes[ \"description\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"description\" ], ( str, unicode ) )\n self.__description = attributes[ \"description\" ]\n- if \"fork\" in attributes and attributes[ \"fork\" ] is not None:\n+ if \"fork\" in attributes and attributes[ \"fork\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"fork\" ], bool )\n self.__fork = attributes[ \"fork\" ]\n- if \"forks\" in attributes and attributes[ \"forks\" ] is not None:\n+ if \"forks\" in attributes and attributes[ \"forks\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"forks\" ], int )\n self.__forks = attributes[ \"forks\" ]\n- if \"full_name\" in attributes and attributes[ \"full_name\" ] is not None:\n+ if \"full_name\" in attributes and attributes[ \"full_name\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"full_name\" ], ( str, unicode ) )\n self.__full_name = attributes[ \"full_name\" ]\n- if \"git_url\" in attributes and attributes[ \"git_url\" ] is not None:\n+ if \"git_url\" in attributes and attributes[ \"git_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"git_url\" ], ( str, unicode ) )\n self.__git_url = attributes[ \"git_url\" ]\n- if \"has_downloads\" in attributes and attributes[ \"has_downloads\" ] is not None:\n+ if \"has_downloads\" in attributes and attributes[ \"has_downloads\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"has_downloads\" ], bool )\n self.__has_downloads = attributes[ \"has_downloads\" ]\n- if \"has_issues\" in attributes and attributes[ \"has_issues\" ] is not None:\n+ if \"has_issues\" in attributes and attributes[ \"has_issues\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"has_issues\" ], bool )\n self.__has_issues = attributes[ \"has_issues\" ]\n- if \"has_wiki\" in attributes and attributes[ \"has_wiki\" ] is not None:\n+ if \"has_wiki\" in attributes and attributes[ \"has_wiki\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"has_wiki\" ], bool )\n self.__has_wiki = attributes[ \"has_wiki\" ]\n- if \"homepage\" in attributes and attributes[ \"homepage\" ] is not None:\n+ if \"homepage\" in attributes and attributes[ \"homepage\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"homepage\" ], ( str, unicode ) )\n self.__homepage = attributes[ \"homepage\" ]\n- if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None:\n+ if \"html_url\" in attributes and attributes[ \"html_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"html_url\" ], ( str, unicode ) )\n self.__html_url = attributes[ \"html_url\" ]\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"id\" ], int )\n self.__id = attributes[ \"id\" ]\n- if \"language\" in attributes and attributes[ \"language\" ] is not None:\n+ if \"language\" in attributes and attributes[ \"language\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"language\" ], ( str, unicode ) )\n self.__language = attributes[ \"language\" ]\n- if \"master_branch\" in attributes and attributes[ \"master_branch\" ] is not None:\n+ if \"master_branch\" in attributes and attributes[ \"master_branch\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"master_branch\" ], ( str, unicode ) )\n self.__master_branch = attributes[ \"master_branch\" ]\n- if \"mirror_url\" in attributes and attributes[ \"mirror_url\" ] is not None:\n+ if \"mirror_url\" in attributes and attributes[ \"mirror_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"mirror_url\" ], ( str, unicode ) )\n self.__mirror_url = attributes[ \"mirror_url\" ]\n- if \"name\" in attributes and attributes[ \"name\" ] is not None:\n+ if \"name\" in attributes and attributes[ \"name\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"name\" ], ( str, unicode ) )\n self.__name = attributes[ \"name\" ]\n- if \"open_issues\" in attributes and attributes[ \"open_issues\" ] is not None:\n+ if \"open_issues\" in attributes and attributes[ \"open_issues\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"open_issues\" ], int )\n self.__open_issues = attributes[ \"open_issues\" ]\n- if \"organization\" in attributes and attributes[ \"organization\" ] is not None:\n+ if \"organization\" in attributes and attributes[ \"organization\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"organization\" ], dict )\n self.__organization = Organization.Organization( self.__requester, attributes[ \"organization\" ], completion = LazyCompletion )\n- if \"owner\" in attributes and attributes[ \"owner\" ] is not None:\n+ if \"owner\" in attributes and attributes[ \"owner\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"owner\" ], dict )\n self.__owner = NamedUser.NamedUser( self.__requester, attributes[ \"owner\" ], completion = LazyCompletion )\n- if \"parent\" in attributes and attributes[ \"parent\" ] is not None:\n+ if \"parent\" in attributes and attributes[ \"parent\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"parent\" ], dict )\n self.__parent = Repository( self.__requester, attributes[ \"parent\" ], completion = LazyCompletion )\n- if \"permissions\" in attributes and attributes[ \"permissions\" ] is not None:\n+ if \"permissions\" in attributes and attributes[ \"permissions\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"permissions\" ], dict )\n self.__permissions = Permissions.Permissions( self.__requester, attributes[ \"permissions\" ], completion = LazyCompletion )\n- if \"private\" in attributes and attributes[ \"private\" ] is not None:\n+ if \"private\" in attributes and attributes[ \"private\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"private\" ], bool )\n self.__private = attributes[ \"private\" ]\n- if \"pushed_at\" in attributes and attributes[ \"pushed_at\" ] is not None:\n+ if \"pushed_at\" in attributes and attributes[ \"pushed_at\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"pushed_at\" ], ( str, unicode ) )\n self.__pushed_at = attributes[ \"pushed_at\" ]\n- if \"size\" in attributes and attributes[ \"size\" ] is not None:\n+ if \"size\" in attributes and attributes[ \"size\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"size\" ], int )\n self.__size = attributes[ \"size\" ]\n- if \"source\" in attributes and attributes[ \"source\" ] is not None:\n+ if \"source\" in attributes and attributes[ \"source\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"source\" ], dict )\n self.__source = Repository( self.__requester, attributes[ \"source\" ], completion = LazyCompletion )\n- if \"ssh_url\" in attributes and attributes[ \"ssh_url\" ] is not None:\n+ if \"ssh_url\" in attributes and attributes[ \"ssh_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"ssh_url\" ], ( str, unicode ) )\n self.__ssh_url = attributes[ \"ssh_url\" ]\n- if \"svn_url\" in attributes and attributes[ \"svn_url\" ] is not None:\n+ if \"svn_url\" in attributes and attributes[ \"svn_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"svn_url\" ], ( str, unicode ) )\n self.__svn_url = attributes[ \"svn_url\" ]\n- if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None:\n+ if \"updated_at\" in attributes and attributes[ \"updated_at\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"updated_at\" ], ( str, unicode ) )\n self.__updated_at = attributes[ \"updated_at\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"url\" ], ( str, unicode ) )\n self.__url = attributes[ \"url\" ]\n- if \"watchers\" in attributes and attributes[ \"watchers\" ] is not None:\n+ if \"watchers\" in attributes and attributes[ \"watchers\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"watchers\" ], int )\n self.__watchers = attributes[ \"watchers\" ]","additions":31,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":10,"deletions":5,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/RepositoryKey.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/RepositoryKey.py","filename":"src/github/RepositoryKey.py","patch":"@@ -87,14 +87,14 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"id\", \"key\", \"title\", \"url\", \"verified\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n self.__id = attributes[ \"id\" ]\n- if \"key\" in attributes and attributes[ \"key\" ] is not None:\n+ if \"key\" in attributes and attributes[ \"key\" ] is not None: # pragma no branch\n self.__key = attributes[ \"key\" ]\n- if \"title\" in attributes and attributes[ \"title\" ] is not None:\n+ if \"title\" in attributes and attributes[ \"title\" ] is not None: # pragma no branch\n self.__title = attributes[ \"title\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n self.__url = attributes[ \"url\" ]\n- if \"verified\" in attributes and attributes[ \"verified\" ] is not None:\n+ if \"verified\" in attributes and attributes[ \"verified\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"verified\" ], bool )\n self.__verified = attributes[ \"verified\" ]","additions":5,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":8,"deletions":4,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Tag.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Tag.py","filename":"src/github/Tag.py","patch":"@@ -38,15 +38,15 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"commit\", \"name\", \"tarball_url\", \"zipball_url\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"commit\" in attributes and attributes[ \"commit\" ] is not None:\n+ if \"commit\" in attributes and attributes[ \"commit\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"commit\" ], dict )\n self.__commit = Commit.Commit( self.__requester, attributes[ \"commit\" ], completion = LazyCompletion )\n- if \"name\" in attributes and attributes[ \"name\" ] is not None:\n+ if \"name\" in attributes and attributes[ \"name\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"name\" ], ( str, unicode ) )\n self.__name = attributes[ \"name\" ]\n- if \"tarball_url\" in attributes and attributes[ \"tarball_url\" ] is not None:\n+ if \"tarball_url\" in attributes and attributes[ \"tarball_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"tarball_url\" ], ( str, unicode ) )\n self.__tarball_url = attributes[ \"tarball_url\" ]\n- if \"zipball_url\" in attributes and attributes[ \"zipball_url\" ] is not None:\n+ if \"zipball_url\" in attributes and attributes[ \"zipball_url\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"zipball_url\" ], ( str, unicode ) )\n self.__zipball_url = attributes[ \"zipball_url\" ]","additions":4,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":12,"deletions":6,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Team.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/Team.py","filename":"src/github/Team.py","patch":"@@ -172,15 +172,15 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"id\", \"members_count\", \"name\", \"permission\", \"repos_count\", \"url\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n self.__id = attributes[ \"id\" ]\n- if \"members_count\" in attributes and attributes[ \"members_count\" ] is not None:\n+ if \"members_count\" in attributes and attributes[ \"members_count\" ] is not None: # pragma no branch\n self.__members_count = attributes[ \"members_count\" ]\n- if \"name\" in attributes and attributes[ \"name\" ] is not None:\n+ if \"name\" in attributes and attributes[ \"name\" ] is not None: # pragma no branch\n self.__name = attributes[ \"name\" ]\n- if \"permission\" in attributes and attributes[ \"permission\" ] is not None:\n+ if \"permission\" in attributes and attributes[ \"permission\" ] is not None: # pragma no branch\n self.__permission = attributes[ \"permission\" ]\n- if \"repos_count\" in attributes and attributes[ \"repos_count\" ] is not None:\n+ if \"repos_count\" in attributes and attributes[ \"repos_count\" ] is not None: # pragma no branch\n self.__repos_count = attributes[ \"repos_count\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n self.__url = attributes[ \"url\" ]","additions":6,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":10,"deletions":5,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/UserKey.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/src/github/UserKey.py","filename":"src/github/UserKey.py","patch":"@@ -87,14 +87,14 @@ def __useAttributes( self, attributes ):\n for attribute in attributes:\n assert attribute in [ \"id\", \"key\", \"title\", \"url\", \"verified\", ], attribute\n # @toto No need to check if attribute is in attributes when attribute is mandatory\n- if \"id\" in attributes and attributes[ \"id\" ] is not None:\n+ if \"id\" in attributes and attributes[ \"id\" ] is not None: # pragma no branch\n self.__id = attributes[ \"id\" ]\n- if \"key\" in attributes and attributes[ \"key\" ] is not None:\n+ if \"key\" in attributes and attributes[ \"key\" ] is not None: # pragma no branch\n self.__key = attributes[ \"key\" ]\n- if \"title\" in attributes and attributes[ \"title\" ] is not None:\n+ if \"title\" in attributes and attributes[ \"title\" ] is not None: # pragma no branch\n self.__title = attributes[ \"title\" ]\n- if \"url\" in attributes and attributes[ \"url\" ] is not None:\n+ if \"url\" in attributes and attributes[ \"url\" ] is not None: # pragma no branch\n self.__url = attributes[ \"url\" ]\n- if \"verified\" in attributes and attributes[ \"verified\" ] is not None:\n+ if \"verified\" in attributes and attributes[ \"verified\" ] is not None: # pragma no branch\n assert isinstance( attributes[ \"verified\" ], bool )\n self.__verified = attributes[ \"verified\" ]","additions":5,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":26,"deletions":1,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/test/Issue.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/test/Issue.py","filename":"test/Issue.py","patch":"@@ -3,7 +3,8 @@\n class Issue( Framework.TestCase ):\r\n def setUp( self ):\r\n Framework.TestCase.setUp( self )\r\n- self.issue = self.g.get_user().get_repo( \"PyGithub\" ).get_issue( 28 )\r\n+ self.repo = self.g.get_user().get_repo( \"PyGithub\" )\r\n+ self.issue = self.repo.get_issue( 28 )\r\n \r\n def testAttributes( self ):\r\n self.assertEqual( self.issue.assignee.login, \"jacquev6\" )\r\n@@ -47,3 +48,26 @@ def testGetComments( self ):\n \r\n def testGetEvents( self ):\r\n self.assertListKeyEqual( self.issue.get_events(), lambda e: e.id, [ 15819975, 15820048 ] )\r\n+\r\n+ def testGetLabels( self ):\r\n+ self.assertListKeyEqual( self.issue.get_labels(), lambda l: l.name, [ \"Bug\", \"Project management\", \"Question\" ] )\r\n+\r\n+ def testAddAndRemoveLabels( self ):\r\n+ bug = self.repo.get_label( \"Bug\" )\r\n+ question = self.repo.get_label( \"Question\" )\r\n+ self.assertListKeyEqual( self.issue.get_labels(), lambda l: l.name, [ \"Bug\", \"Project management\", \"Question\" ] )\r\n+ self.issue.remove_from_labels( bug )\r\n+ self.assertListKeyEqual( self.issue.get_labels(), lambda l: l.name, [ \"Project management\", \"Question\" ] )\r\n+ self.issue.remove_from_labels( question )\r\n+ self.assertListKeyEqual( self.issue.get_labels(), lambda l: l.name, [ \"Project management\" ] )\r\n+ self.issue.add_to_labels( bug, question )\r\n+ self.assertListKeyEqual( self.issue.get_labels(), lambda l: l.name, [ \"Bug\", \"Project management\", \"Question\" ] )\r\n+\r\n+ def testDeleteAndSetLabels( self ):\r\n+ bug = self.repo.get_label( \"Bug\" )\r\n+ question = self.repo.get_label( \"Question\" )\r\n+ self.assertListKeyEqual( self.issue.get_labels(), lambda l: l.name, [ \"Bug\", \"Project management\", \"Question\" ] )\r\n+ self.issue.delete_labels()\r\n+ self.assertListKeyEqual( self.issue.get_labels(), lambda l: l.name, [] )\r\n+ self.issue.set_labels( bug, question )\r\n+ self.assertListKeyEqual( self.issue.get_labels(), lambda l: l.name, [ \"Bug\", \"Question\" ] )\r","additions":25,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":14,"deletions":7,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/test/IssueEvent.py","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/test/IssueEvent.py","filename":"test/IssueEvent.py","patch":"@@ -3,13 +3,13 @@\n class IssueEvent( Framework.TestCase ):\r\n def setUp( self ):\r\n Framework.TestCase.setUp( self )\r\n- self.event = self.g.get_user().get_repo( \"PyGithub\" ).get_issues_event( 15819975 )\r\n+ self.event = self.g.get_user().get_repo( \"PyGithub\" ).get_issues_event( 16348656 )\r\n \r\n def testAttributes( self ):\r\n self.assertEqual( self.event.actor.login, \"jacquev6\" )\r\n- self.assertEqual( self.event.commit_id, None )\r\n- self.assertEqual( self.event.created_at, \"2012-05-19T10:38:23Z\" )\r\n- self.assertEqual( self.event.event, \"subscribed\" )\r\n- self.assertEqual( self.event.id, 15819975 )\r\n- self.assertEqual( self.event.issue.number, 28 )\r\n- self.assertEqual( self.event.url, \"https://api.github.com/repos/jacquev6/PyGithub/issues/events/15819975\" )\r\n+ self.assertEqual( self.event.commit_id, \"ed866fc43833802ab553e5ff8581c81bb00dd433\" )\r\n+ self.assertEqual( self.event.created_at, \"2012-05-27T07:29:25Z\" )\r\n+ self.assertEqual( self.event.event, \"referenced\" )\r\n+ self.assertEqual( self.event.id, 16348656 )\r\n+ self.assertEqual( self.event.issue.number, 30 )\r\n+ self.assertEqual( self.event.url, \"https://api.github.com/repos/jacquev6/PyGithub/issues/events/16348656\" )\r","additions":7,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"added","changes":45,"deletions":0,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/test/ReplayData/Issue.testAddAndRemoveLabels.txt","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/test/ReplayData/Issue.testAddAndRemoveLabels.txt","filename":"test/ReplayData/Issue.testAddAndRemoveLabels.txt","patch":"@@ -0,0 +1,45 @@\n+GET /repos/jacquev6/PyGithub/labels/Bug {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4992'), ('content-length', '97'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"569c414d87e8ec43ec269a9e28bc2982\"'), ('date', 'Sun, 27 May 2012 09:04:01 GMT'), ('content-type', 'application/json; charset=utf-8')]\n+{\"color\":\"e10c02\",\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug\",\"name\":\"Bug\"}\n+\n+GET /repos/jacquev6/PyGithub/labels/Question {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4991'), ('content-length', '107'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"b659c8dcc1212c71f826547c3cc7ae99\"'), ('date', 'Sun, 27 May 2012 09:04:02 GMT'), ('content-type', 'application/json; charset=utf-8')]\n+{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\",\"color\":\"02e10c\"}\n+\n+GET /repos/jacquev6/PyGithub/issues/28/labels {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4990'), ('content-length', '335'), ('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')]\n+[{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug\",\"name\":\"Bug\",\"color\":\"e10c02\"},{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Project+management\",\"name\":\"Project management\",\"color\":\"444444\"},{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\",\"color\":\"02e10c\"}]\n+\n+DELETE /repos/jacquev6/PyGithub/issues/28/labels/Bug {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4989'), ('content-length', '237'), ('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')]\n+[{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Project+management\",\"name\":\"Project management\",\"color\":\"444444\"},{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\",\"color\":\"02e10c\"}]\n+\n+GET /repos/jacquev6/PyGithub/issues/28/labels {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4988'), ('content-length', '237'), ('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')]\n+[{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Project+management\",\"name\":\"Project management\",\"color\":\"444444\"},{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\",\"color\":\"02e10c\"}]\n+\n+DELETE /repos/jacquev6/PyGithub/issues/28/labels/Question {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4987'), ('content-length', '129'), ('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')]\n+[{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Project+management\",\"name\":\"Project management\",\"color\":\"444444\"}]\n+\n+GET /repos/jacquev6/PyGithub/issues/28/labels {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4986'), ('content-length', '129'), ('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')]\n+[{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Project+management\",\"name\":\"Project management\",\"color\":\"444444\"}]\n+\n+POST /repos/jacquev6/PyGithub/issues/28/labels {'Authorization': 'Basic login_and_password_removed'} [\"Bug\", \"Question\"]\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4985'), ('content-length', '335'), ('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')]\n+[{\"color\":\"e10c02\",\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug\",\"name\":\"Bug\"},{\"color\":\"444444\",\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Project+management\",\"name\":\"Project management\"},{\"color\":\"02e10c\",\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\"}]\n+\n+GET /repos/jacquev6/PyGithub/issues/28/labels {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4984'), ('content-length', '335'), ('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')]\n+[{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug\",\"name\":\"Bug\",\"color\":\"e10c02\"},{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Project+management\",\"name\":\"Project management\",\"color\":\"444444\"},{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\",\"color\":\"02e10c\"}]\n+","additions":45,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"added","changes":35,"deletions":0,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/test/ReplayData/Issue.testDeleteAndSetLabels.txt","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/test/ReplayData/Issue.testDeleteAndSetLabels.txt","filename":"test/ReplayData/Issue.testDeleteAndSetLabels.txt","patch":"@@ -0,0 +1,35 @@\n+GET /repos/jacquev6/PyGithub/labels/Bug {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4974'), ('content-length', '97'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"fe2e942523eecb156d100829a6347516\"'), ('date', 'Sun, 27 May 2012 09:06:37 GMT'), ('content-type', 'application/json; charset=utf-8')]\n+{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug\",\"name\":\"Bug\",\"color\":\"e10c02\"}\n+\n+GET /repos/jacquev6/PyGithub/labels/Question {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4973'), ('content-length', '107'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"931e58d337b2290717303141eda89cd7\"'), ('date', 'Sun, 27 May 2012 09:06:38 GMT'), ('content-type', 'application/json; charset=utf-8')]\n+{\"color\":\"02e10c\",\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\"}\n+\n+GET /repos/jacquev6/PyGithub/issues/28/labels {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4972'), ('content-length', '335'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"d135d74d2ea2159d044676a220d41d3a\"'), ('date', 'Sun, 27 May 2012 09:06:39 GMT'), ('content-type', 'application/json; charset=utf-8')]\n+[{\"color\":\"e10c02\",\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug\",\"name\":\"Bug\"},{\"color\":\"444444\",\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Project+management\",\"name\":\"Project management\"},{\"color\":\"02e10c\",\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\"}]\n+\n+DELETE /repos/jacquev6/PyGithub/issues/28/labels {'Authorization': 'Basic login_and_password_removed'} null\n+204\n+[('status', '204 No Content'), ('x-ratelimit-remaining', '4971'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"d41d8cd98f00b204e9800998ecf8427e\"'), ('date', 'Sun, 27 May 2012 09:06:39 GMT')]\n+\n+\n+GET /repos/jacquev6/PyGithub/issues/28/labels {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4970'), ('content-length', '2'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"d751713988987e9331980363e24189ce\"'), ('date', 'Sun, 27 May 2012 09:06:40 GMT'), ('content-type', 'application/json; charset=utf-8')]\n+[]\n+\n+PUT /repos/jacquev6/PyGithub/issues/28/labels {'Authorization': 'Basic login_and_password_removed'} [\"Bug\", \"Question\"]\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4969'), ('content-length', '207'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"1a56634d9c1050a88592ff55ed8adc62\"'), ('date', 'Sun, 27 May 2012 09:06:40 GMT'), ('content-type', 'application/json; charset=utf-8')]\n+[{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug\",\"name\":\"Bug\",\"color\":\"e10c02\"},{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\",\"color\":\"02e10c\"}]\n+\n+GET /repos/jacquev6/PyGithub/issues/28/labels {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4968'), ('content-length', '207'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"1a56634d9c1050a88592ff55ed8adc62\"'), ('date', 'Sun, 27 May 2012 09:06:41 GMT'), ('content-type', 'application/json; charset=utf-8')]\n+[{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug\",\"name\":\"Bug\",\"color\":\"e10c02\"},{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\",\"color\":\"02e10c\"}]\n+","additions":35,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"added","changes":5,"deletions":0,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/test/ReplayData/Issue.testGetLabels.txt","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/test/ReplayData/Issue.testGetLabels.txt","filename":"test/ReplayData/Issue.testGetLabels.txt","patch":"@@ -0,0 +1,5 @@\n+GET /repos/jacquev6/PyGithub/issues/28/labels {'Authorization': 'Basic login_and_password_removed'} null\n+200\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4996'), ('content-length', '335'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"c9f9beccb03030beaf7b80927da6fef6\"'), ('date', 'Sun, 27 May 2012 08:56:31 GMT'), ('content-type', 'application/json; charset=utf-8')]\n+[{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug\",\"name\":\"Bug\",\"color\":\"e10c02\"},{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Project+management\",\"name\":\"Project management\",\"color\":\"444444\"},{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\",\"color\":\"02e10c\"}]\n+","additions":5,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},{"status":"modified","changes":14,"deletions":7,"raw_url":"https://github.com/jacquev6/PyGithub/raw/8a4f306d4b223682dd19410d4a9150636ebe4206/test/ReplayData/IssueEvent.setUp.txt","blob_url":"https://github.com/jacquev6/PyGithub/blob/8a4f306d4b223682dd19410d4a9150636ebe4206/test/ReplayData/IssueEvent.setUp.txt","filename":"test/ReplayData/IssueEvent.setUp.txt","patch":"@@ -1,15 +1,15 @@\n GET /user {'Authorization': 'Basic login_and_password_removed'} null\n 200\n-[('status', '200 OK'), ('x-ratelimit-remaining', '4907'), ('content-length', '801'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"99c9bfb75395b749e9913a4729126fb5\"'), ('date', 'Sun, 27 May 2012 07:19:30 GMT'), ('content-type', 'application/json; charset=utf-8')]\n-{\"private_gists\":5,\"type\":\"User\",\"company\":\"Criteo\",\"location\":\"Paris, France\",\"hireable\":false,\"gravatar_id\":\"b68de5ae38616c296fa345d2b9df2225\",\"bio\":\"\",\"following\":24,\"blog\":\"http://vincent-jacques.net\",\"avatar_url\":\"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png\",\"total_private_repos\":5,\"followers\":13,\"owned_private_repos\":5,\"disk_usage\":16976,\"collaborators\":0,\"html_url\":\"https://github.com/jacquev6\",\"url\":\"https://api.github.com/users/jacquev6\",\"name\":\"Vincent Jacques\",\"login\":\"jacquev6\",\"public_repos\":11,\"public_gists\":3,\"email\":\"vincent@vincent-jacques.net\",\"id\":327146,\"plan\":{\"private_repos\":5,\"collaborators\":1,\"name\":\"micro\",\"space\":614400},\"created_at\":\"2010-07-09T06:10:06Z\"}\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4996'), ('content-length', '801'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"8974bb1628a3e3a6d3eb3b08c1b5a46b\"'), ('date', 'Sun, 27 May 2012 07:32:54 GMT'), ('content-type', 'application/json; charset=utf-8')]\n+{\"type\":\"User\",\"bio\":\"\",\"disk_usage\":16976,\"total_private_repos\":5,\"url\":\"https://api.github.com/users/jacquev6\",\"avatar_url\":\"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png\",\"owned_private_repos\":5,\"collaborators\":0,\"plan\":{\"collaborators\":1,\"private_repos\":5,\"name\":\"micro\",\"space\":614400},\"company\":\"Criteo\",\"gravatar_id\":\"b68de5ae38616c296fa345d2b9df2225\",\"login\":\"jacquev6\",\"email\":\"vincent@vincent-jacques.net\",\"public_gists\":3,\"followers\":13,\"name\":\"Vincent Jacques\",\"created_at\":\"2010-07-09T06:10:06Z\",\"blog\":\"http://vincent-jacques.net\",\"location\":\"Paris, France\",\"hireable\":false,\"id\":327146,\"private_gists\":5,\"public_repos\":11,\"following\":24,\"html_url\":\"https://github.com/jacquev6\"}\n \n GET /repos/jacquev6/PyGithub {'Authorization': 'Basic login_and_password_removed'} null\n 200\n-[('status', '200 OK'), ('x-ratelimit-remaining', '4906'), ('content-length', '1129'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"4c20acf0b23f75bbf25106b1a04f65a5\"'), ('date', 'Sun, 27 May 2012 07:19:31 GMT'), ('content-type', 'application/json; charset=utf-8')]\n-{\"description\":\"Python library implementing the full Github API v3\",\"full_name\":\"jacquev6/PyGithub\",\"has_wiki\":false,\"has_issues\":true,\"updated_at\":\"2012-05-27T06:55:28Z\",\"forks\":3,\"mirror_url\":null,\"homepage\":\"http://vincent-jacques.net/PyGithub\",\"ssh_url\":\"git@github.com:jacquev6/PyGithub.git\",\"open_issues\":16,\"fork\":false,\"svn_url\":\"https://github.com/jacquev6/PyGithub\",\"pushed_at\":\"2012-05-27T06:00:28Z\",\"size\":308,\"html_url\":\"https://github.com/jacquev6/PyGithub\",\"private\":false,\"url\":\"https://api.github.com/repos/jacquev6/PyGithub\",\"clone_url\":\"https://github.com/jacquev6/PyGithub.git\",\"owner\":{\"gravatar_id\":\"b68de5ae38616c296fa345d2b9df2225\",\"avatar_url\":\"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png\",\"url\":\"https://api.github.com/users/jacquev6\",\"login\":\"jacquev6\",\"id\":327146},\"name\":\"PyGithub\",\"has_downloads\":true,\"language\":\"Python\",\"watchers\":15,\"git_url\":\"git://github.com/jacquev6/PyGithub.git\",\"id\":3544490,\"permissions\":{\"admin\":true,\"pull\":true,\"push\":true},\"created_at\":\"2012-02-25T12:53:47Z\"}\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4995'), ('content-length', '1129'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"f1e4eb3993a364b66b68ec9db42405bd\"'), ('date', 'Sun, 27 May 2012 07:32:55 GMT'), ('content-type', 'application/json; charset=utf-8')]\n+{\"clone_url\":\"https://github.com/jacquev6/PyGithub.git\",\"has_downloads\":true,\"watchers\":15,\"updated_at\":\"2012-05-27T07:29:24Z\",\"permissions\":{\"pull\":true,\"admin\":true,\"push\":true},\"homepage\":\"http://vincent-jacques.net/PyGithub\",\"url\":\"https://api.github.com/repos/jacquev6/PyGithub\",\"mirror_url\":null,\"has_wiki\":false,\"has_issues\":true,\"fork\":false,\"forks\":3,\"git_url\":\"git://github.com/jacquev6/PyGithub.git\",\"size\":308,\"private\":false,\"open_issues\":16,\"svn_url\":\"https://github.com/jacquev6/PyGithub\",\"owner\":{\"url\":\"https://api.github.com/users/jacquev6\",\"avatar_url\":\"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png\",\"gravatar_id\":\"b68de5ae38616c296fa345d2b9df2225\",\"login\":\"jacquev6\",\"id\":327146},\"name\":\"PyGithub\",\"language\":\"Python\",\"description\":\"Python library implementing the full Github API v3\",\"ssh_url\":\"git@github.com:jacquev6/PyGithub.git\",\"pushed_at\":\"2012-05-27T07:29:24Z\",\"created_at\":\"2012-02-25T12:53:47Z\",\"id\":3544490,\"html_url\":\"https://github.com/jacquev6/PyGithub\",\"full_name\":\"jacquev6/PyGithub\"}\n \n-GET /repos/jacquev6/PyGithub/issues/events/15819975 {'Authorization': 'Basic login_and_password_removed'} null\n+GET /repos/jacquev6/PyGithub/issues/events/16348656 {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} null\n 200\n-[('status', '200 OK'), ('x-ratelimit-remaining', '4905'), ('content-length', '2430'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"a3d244842d23f92f69a23e21626fad11\"'), ('date', 'Sun, 27 May 2012 07:19:31 GMT'), ('content-type', 'application/json; charset=utf-8')]\n-{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/issues/events/15819975\",\"issue\":{\"updated_at\":\"2012-05-26T14:59:33Z\",\"body\":\"Body edited by PyGithub\",\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/issues/28\",\"comments\":0,\"milestone\":{\"creator\":{\"url\":\"https://api.github.com/users/jacquev6\",\"avatar_url\":\"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png\",\"gravatar_id\":\"b68de5ae38616c296fa345d2b9df2225\",\"login\":\"jacquev6\",\"id\":327146},\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/milestones/1\",\"number\":1,\"title\":\"Version 0.4\",\"due_on\":\"2012-03-13T07:00:00Z\",\"closed_issues\":3,\"open_issues\":0,\"created_at\":\"2012-03-08T12:22:10Z\",\"state\":\"closed\",\"description\":\"\",\"id\":93546},\"number\":28,\"assignee\":{\"url\":\"https://api.github.com/users/jacquev6\",\"avatar_url\":\"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png\",\"gravatar_id\":\"b68de5ae38616c296fa345d2b9df2225\",\"login\":\"jacquev6\",\"id\":327146},\"closed_at\":\"2012-05-26T14:59:33Z\",\"title\":\"Issue created by PyGithub\",\"labels\":[{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug\",\"name\":\"Bug\",\"color\":\"e10c02\"},{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Project+management\",\"name\":\"Project management\",\"color\":\"444444\"},{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\",\"color\":\"02e10c\"}],\"created_at\":\"2012-05-19T10:38:23Z\",\"state\":\"closed\",\"user\":{\"url\":\"https://api.github.com/users/jacquev6\",\"avatar_url\":\"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png\",\"gravatar_id\":\"b68de5ae38616c296fa345d2b9df2225\",\"login\":\"jacquev6\",\"id\":327146},\"id\":4653757,\"pull_request\":{\"diff_url\":null,\"patch_url\":null,\"html_url\":null},\"html_url\":\"https://github.com/jacquev6/PyGithub/issues/28\"},\"commit_id\":null,\"created_at\":\"2012-05-19T10:38:23Z\",\"event\":\"subscribed\",\"id\":15819975,\"actor\":{\"url\":\"https://api.github.com/users/jacquev6\",\"avatar_url\":\"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png\",\"gravatar_id\":\"b68de5ae38616c296fa345d2b9df2225\",\"login\":\"jacquev6\",\"id\":327146}}\n+[('status', '200 OK'), ('x-ratelimit-remaining', '4994'), ('content-length', '1384'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '\"fefecab09e7355d4ef9875677c2631da\"'), ('date', 'Sun, 27 May 2012 07:32:56 GMT'), ('content-type', 'application/json; charset=utf-8')]\n+{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/issues/events/16348656\",\"issue\":{\"updated_at\":\"2012-05-27T07:27:51Z\",\"body\":\"Body created by PyGithub\",\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/issues/30\",\"comments\":0,\"milestone\":null,\"number\":30,\"assignee\":null,\"closed_at\":null,\"title\":\"Issue also created by PyGithub\",\"labels\":[{\"url\":\"https://api.github.com/repos/jacquev6/PyGithub/labels/Question\",\"name\":\"Question\",\"color\":\"02e10c\"}],\"created_at\":\"2012-05-27T05:40:15Z\",\"state\":\"open\",\"user\":{\"url\":\"https://api.github.com/users/jacquev6\",\"gravatar_id\":\"b68de5ae38616c296fa345d2b9df2225\",\"login\":\"jacquev6\",\"id\":327146,\"avatar_url\":\"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png\"},\"id\":4769659,\"pull_request\":{\"patch_url\":null,\"diff_url\":null,\"html_url\":null},\"html_url\":\"https://github.com/jacquev6/PyGithub/issues/30\"},\"commit_id\":\"ed866fc43833802ab553e5ff8581c81bb00dd433\",\"created_at\":\"2012-05-27T07:29:25Z\",\"event\":\"referenced\",\"id\":16348656,\"actor\":{\"url\":\"https://api.github.com/users/jacquev6\",\"gravatar_id\":\"b68de5ae38616c296fa345d2b9df2225\",\"login\":\"jacquev6\",\"id\":327146,\"avatar_url\":\"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png\"}}\n ","additions":7,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"}] diff --git a/github/tests/ReplayData/Repository.testCreateDownloadWithAllArguments.txt b/github/tests/ReplayData/Repository.testCreateDownloadWithAllArguments.txt index 38d224a9..7f529416 100644 --- a/github/tests/ReplayData/Repository.testCreateDownloadWithAllArguments.txt +++ b/github/tests/ReplayData/Repository.testCreateDownloadWithAllArguments.txt @@ -1,4 +1,4 @@ -https POST api.github.com None /repos/jacquev6/PyGithub/downloads {'Authorization': 'Basic login_and_password_removed'} {"description": "Download created by PyGithub", "name": "Foobar.txt", "content_type": "text/richtext", "size": 1024} +https POST api.github.com None /repos/jacquev6/PyGithub/downloads {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"description": "Download created by PyGithub", "name": "Foobar.txt", "content_type": "text/richtext", "size": 1024} 201 [('status', '201 Created'), ('x-ratelimit-remaining', '4957'), ('content-length', '1172'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"dec219bef9e193a28a08c8f5643c0ac3"'), ('date', 'Tue, 22 May 2012 19:11:49 GMT'), ('content-type', 'application/json; charset=utf-8'), ('location', 'https://api.github.com/repos/jacquev6/PyGithub/downloads/242556')] {"description":"Download created by PyGithub","acl":"public-read","accesskeyid":"1DWESVTPGHQVTX38V182","bucket":"github","content_type":"text/richtext","x-amz-meta-content-disposition":"attachment; filename=Foobar.txt","redirect":false,"expirationdate":"2112-05-22T19:11:49.000Z","policy":"ewogICAgJ2V4cGlyYXRpb24nOiAnMjExMi0wNS0yMlQxOToxMTo0OS4wMDBaJywKICAgICdjb25kaXRpb25zJzogWwogICAgICAgIHsnYnVja2V0JzogJ2dpdGh1Yid9LAogICAgICAgIHsna2V5JzogJ2Rvd25sb2Fkcy9qYWNxdWV2Ni9QeUdpdGh1Yi9Gb29iYXIudHh0J30sCiAgICAgICAgeydhY2wnOiAncHVibGljLXJlYWQnfSwKICAgICAgICB7J3N1Y2Nlc3NfYWN0aW9uX3N0YXR1cyc6ICcyMDEnfSwKICAgICAgICBbJ3N0YXJ0cy13aXRoJywgJyRGaWxlbmFtZScsICcnXSwKICAgICAgICBbJ3N0YXJ0cy13aXRoJywgJyRDb250ZW50LVR5cGUnLCAnJ10KICAgIF0KfQ==","s3_url":"https://github.s3.amazonaws.com/","html_url":"https://github.com/downloads/jacquev6/PyGithub/Foobar.txt","mime_type":"text/richtext","size":1024,"url":"https://api.github.com/repos/jacquev6/PyGithub/downloads/242556","download_count":0,"name":"Foobar.txt","prefix":"downloads/jacquev6/PyGithub","path":"downloads/jacquev6/PyGithub/Foobar.txt","id":242556,"signature":"8FCU/4rgT3ohXfE9N6HO7JgbuK4=","created_at":"2012-05-22T19:11:49Z"} diff --git a/github/tests/ReplayData/Repository.testCreateDownloadWithMinimalArguments.txt b/github/tests/ReplayData/Repository.testCreateDownloadWithMinimalArguments.txt index 981cfc45..e981fc8a 100644 --- a/github/tests/ReplayData/Repository.testCreateDownloadWithMinimalArguments.txt +++ b/github/tests/ReplayData/Repository.testCreateDownloadWithMinimalArguments.txt @@ -1,4 +1,4 @@ -https POST api.github.com None /repos/jacquev6/PyGithub/downloads {'Authorization': 'Basic login_and_password_removed'} {"name": "Foobar.txt", "size": 1024} +https POST api.github.com None /repos/jacquev6/PyGithub/downloads {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"name": "Foobar.txt", "size": 1024} 201 [('status', '201 Created'), ('x-ratelimit-remaining', '4954'), ('content-length', '1140'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"14a91323a46cfdfd53dfacffa96ab6a0"'), ('date', 'Tue, 22 May 2012 19:15:29 GMT'), ('content-type', 'application/json; charset=utf-8'), ('location', 'https://api.github.com/repos/jacquev6/PyGithub/downloads/242562')] {"accesskeyid":"1DWESVTPGHQVTX38V182","bucket":"github","content_type":"text/plain","download_count":0,"redirect":false,"mime_type":"text/plain","prefix":"downloads/jacquev6/PyGithub","expirationdate":"2112-05-22T19:15:29.000Z","url":"https://api.github.com/repos/jacquev6/PyGithub/downloads/242562","x-amz-meta-content-disposition":"attachment; filename=Foobar.txt","acl":"public-read","s3_url":"https://github.s3.amazonaws.com/","policy":"ewogICAgJ2V4cGlyYXRpb24nOiAnMjExMi0wNS0yMlQxOToxNToyOS4wMDBaJywKICAgICdjb25kaXRpb25zJzogWwogICAgICAgIHsnYnVja2V0JzogJ2dpdGh1Yid9LAogICAgICAgIHsna2V5JzogJ2Rvd25sb2Fkcy9qYWNxdWV2Ni9QeUdpdGh1Yi9Gb29iYXIudHh0J30sCiAgICAgICAgeydhY2wnOiAncHVibGljLXJlYWQnfSwKICAgICAgICB7J3N1Y2Nlc3NfYWN0aW9uX3N0YXR1cyc6ICcyMDEnfSwKICAgICAgICBbJ3N0YXJ0cy13aXRoJywgJyRGaWxlbmFtZScsICcnXSwKICAgICAgICBbJ3N0YXJ0cy13aXRoJywgJyRDb250ZW50LVR5cGUnLCAnJ10KICAgIF0KfQ==","size":1024,"signature":"Z2VR9HhhJdWkmhyoSZF+TT6hqIs=","name":"Foobar.txt","path":"downloads/jacquev6/PyGithub/Foobar.txt","created_at":"2012-05-22T19:15:29Z","description":null,"html_url":"https://github.com/downloads/jacquev6/PyGithub/Foobar.txt","id":242562} diff --git a/github/tests/ReplayData/Repository.testCreateGitBlob.txt b/github/tests/ReplayData/Repository.testCreateGitBlob.txt index 16850739..1fcaf00f 100644 --- a/github/tests/ReplayData/Repository.testCreateGitBlob.txt +++ b/github/tests/ReplayData/Repository.testCreateGitBlob.txt @@ -1,4 +1,4 @@ -https POST api.github.com None /repos/jacquev6/PyGithub/git/blobs {'Authorization': 'Basic login_and_password_removed'} {"content": "Blob created by PyGithub", "encoding": "latin1"} +https POST api.github.com None /repos/jacquev6/PyGithub/git/blobs {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"content": "Blob created by PyGithub", "encoding": "latin1"} 201 [('status', '201 Created'), ('x-ratelimit-remaining', '4997'), ('content-length', '156'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"f5cc2fa3ba4de95ac0eb8c2ca47350c0"'), ('date', 'Fri, 11 May 2012 11:43:09 GMT'), ('content-type', 'application/json; charset=utf-8'), ('location', 'https://api.github.com/repos/jacquev6/PyGithub/git/blobs/5dd930f591cd5188e9ea7200e308ad355182a1d8')] {"url":"https://api.github.com/repos/jacquev6/PyGithub/git/blobs/5dd930f591cd5188e9ea7200e308ad355182a1d8","sha":"5dd930f591cd5188e9ea7200e308ad355182a1d8"} diff --git a/github/tests/ReplayData/Repository.testCreateGitCommit.txt b/github/tests/ReplayData/Repository.testCreateGitCommit.txt index aa483291..4afdc13d 100644 --- a/github/tests/ReplayData/Repository.testCreateGitCommit.txt +++ b/github/tests/ReplayData/Repository.testCreateGitCommit.txt @@ -3,7 +3,7 @@ https GET api.github.com None /repos/jacquev6/PyGithub/git/trees/107139a922f33ba [('status', '200 OK'), ('x-ratelimit-remaining', '4994'), ('content-length', '381'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"f33782d7031ff19c5301bb52068533cf"'), ('date', 'Fri, 01 Jun 2012 20:02:40 GMT'), ('content-type', 'application/json; charset=utf-8')] {"url":"https://api.github.com/repos/jacquev6/PyGithub/git/trees/107139a922f33bab6fbeb9f9eb8787e7f19e0528","sha":"107139a922f33bab6fbeb9f9eb8787e7f19e0528","tree":[{"type":"blob","url":"https://api.github.com/repos/jacquev6/PyGithub/git/blobs/5dd930f591cd5188e9ea7200e308ad355182a1d8","sha":"5dd930f591cd5188e9ea7200e308ad355182a1d8","size":0,"path":"Barbaz.txt","mode":"100644"}]} -https POST api.github.com None /repos/jacquev6/PyGithub/git/commits {'Authorization': 'Basic login_and_password_removed'} {"parents": [], "message": "Commit created by PyGithub", "tree": "107139a922f33bab6fbeb9f9eb8787e7f19e0528"} +https POST api.github.com None /repos/jacquev6/PyGithub/git/commits {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"parents": [], "message": "Commit created by PyGithub", "tree": "107139a922f33bab6fbeb9f9eb8787e7f19e0528"} 201 [('status', '201 Created'), ('x-ratelimit-remaining', '4931'), ('content-length', '601'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"7719e5a3f5b064dc0871853dba33302b"'), ('date', 'Sun, 27 May 2012 05:50:59 GMT'), ('content-type', 'application/json; charset=utf-8'), ('location', 'https://api.github.com/repos/jacquev6/PyGithub/git/commits/0b820628236ab8bab3890860fc414fa757ca15f4')] {"author":{"email":"github.com@vincent-jacques.net","name":"Vincent Jacques","date":"2012-05-26T22:50:59-07:00"},"url":"https://api.github.com/repos/jacquev6/PyGithub/git/commits/0b820628236ab8bab3890860fc414fa757ca15f4","message":"Commit created by PyGithub","committer":{"email":"github.com@vincent-jacques.net","name":"Vincent Jacques","date":"2012-05-26T22:50:59-07:00"},"sha":"0b820628236ab8bab3890860fc414fa757ca15f4","parents":[],"tree":{"url":"https://api.github.com/repos/jacquev6/PyGithub/git/trees/107139a922f33bab6fbeb9f9eb8787e7f19e0528","sha":"107139a922f33bab6fbeb9f9eb8787e7f19e0528"}} diff --git a/github/tests/ReplayData/Repository.testCreateGitCommitWithAllArguments.txt b/github/tests/ReplayData/Repository.testCreateGitCommitWithAllArguments.txt index 226001f5..66e149ca 100644 --- a/github/tests/ReplayData/Repository.testCreateGitCommitWithAllArguments.txt +++ b/github/tests/ReplayData/Repository.testCreateGitCommitWithAllArguments.txt @@ -3,7 +3,7 @@ https GET api.github.com None /repos/jacquev6/PyGithub/git/trees/107139a922f33ba [('status', '200 OK'), ('x-ratelimit-remaining', '4994'), ('content-length', '381'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"f33782d7031ff19c5301bb52068533cf"'), ('date', 'Fri, 01 Jun 2012 20:02:40 GMT'), ('content-type', 'application/json; charset=utf-8')] {"url":"https://api.github.com/repos/jacquev6/PyGithub/git/trees/107139a922f33bab6fbeb9f9eb8787e7f19e0528","sha":"107139a922f33bab6fbeb9f9eb8787e7f19e0528","tree":[{"type":"blob","url":"https://api.github.com/repos/jacquev6/PyGithub/git/blobs/5dd930f591cd5188e9ea7200e308ad355182a1d8","sha":"5dd930f591cd5188e9ea7200e308ad355182a1d8","size":0,"path":"Barbaz.txt","mode":"100644"}]} -https POST api.github.com None /repos/jacquev6/PyGithub/git/commits {'Authorization': 'Basic login_and_password_removed'} {"parents": [], "message": "Commit created by PyGithub", "tree": "107139a922f33bab6fbeb9f9eb8787e7f19e0528", "committer": {"date": "2008-07-09T16:13:30+12:00", "name": "John Doe", "email": "j.doe@vincent-jacques.net"}, "author": {"date": "2008-07-09T16:13:30+12:00", "name": "John Doe", "email": "j.doe@vincent-jacques.net"}} +https POST api.github.com None /repos/jacquev6/PyGithub/git/commits {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"parents": [], "message": "Commit created by PyGithub", "tree": "107139a922f33bab6fbeb9f9eb8787e7f19e0528", "committer": {"date": "2008-07-09T16:13:30+12:00", "name": "John Doe", "email": "j.doe@vincent-jacques.net"}, "author": {"date": "2008-07-09T16:13:30+12:00", "name": "John Doe", "email": "j.doe@vincent-jacques.net"}} 201 [('status', '201 Created'), ('x-ratelimit-remaining', '4928'), ('content-length', '577'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"660cc851cdd42a2caa7241cd96db0d01"'), ('date', 'Sun, 27 May 2012 05:53:47 GMT'), ('content-type', 'application/json; charset=utf-8'), ('location', 'https://api.github.com/repos/jacquev6/PyGithub/git/commits/526946197ae9da59c6507cacd13ad6f1cfb686ea')] {"author":{"email":"j.doe@vincent-jacques.net","name":"John Doe","date":"2008-07-08T21:13:30-07:00"},"url":"https://api.github.com/repos/jacquev6/PyGithub/git/commits/526946197ae9da59c6507cacd13ad6f1cfb686ea","message":"Commit created by PyGithub","committer":{"email":"j.doe@vincent-jacques.net","name":"John Doe","date":"2008-07-08T21:13:30-07:00"},"sha":"526946197ae9da59c6507cacd13ad6f1cfb686ea","parents":[],"tree":{"url":"https://api.github.com/repos/jacquev6/PyGithub/git/trees/107139a922f33bab6fbeb9f9eb8787e7f19e0528","sha":"107139a922f33bab6fbeb9f9eb8787e7f19e0528"}} diff --git a/github/tests/ReplayData/Repository.testCreateGitCommitWithParents.txt b/github/tests/ReplayData/Repository.testCreateGitCommitWithParents.txt index 626bef18..ab5f8fc6 100644 --- a/github/tests/ReplayData/Repository.testCreateGitCommitWithParents.txt +++ b/github/tests/ReplayData/Repository.testCreateGitCommitWithParents.txt @@ -13,7 +13,7 @@ https GET api.github.com None /repos/jacquev6/PyGithub/git/trees/fae707821159639 [('status', '200 OK'), ('x-ratelimit-remaining', '4994'), ('content-length', '381'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"f33782d7031ff19c5301bb52068533cf"'), ('date', 'Fri, 01 Jun 2012 20:02:40 GMT'), ('content-type', 'application/json; charset=utf-8')] {"url":"https://api.github.com/repos/jacquev6/PyGithub/git/trees/fae707821159639589bf94f3fb0a7154ec5d441b","sha":"fae707821159639589bf94f3fb0a7154ec5d441b","tree":[{"type":"blob","url":"https://api.github.com/repos/jacquev6/PyGithub/git/blobs/5dd930f591cd5188e9ea7200e308ad355182a1d8","sha":"5dd930f591cd5188e9ea7200e308ad355182a1d8","size":0,"path":"Barbaz.txt","mode":"100644"}]} -https POST api.github.com None /repos/jacquev6/PyGithub/git/commits {'Authorization': 'Basic login_and_password_removed'} {"parents": ["7248e66831d4ffe09ef1f30a1df59ec0a9331ece", "12d427464f8d91c8e981043a86ba8a2a9e7319ea"], "message": "Commit created by PyGithub", "tree": "fae707821159639589bf94f3fb0a7154ec5d441b"} +https POST api.github.com None /repos/jacquev6/PyGithub/git/commits {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"parents": ["7248e66831d4ffe09ef1f30a1df59ec0a9331ece", "12d427464f8d91c8e981043a86ba8a2a9e7319ea"], "message": "Commit created by PyGithub", "tree": "fae707821159639589bf94f3fb0a7154ec5d441b"} 201 [('status', '201 Created'), ('x-ratelimit-remaining', '4965'), ('content-length', '918'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"1ada1e7861f74fa4fefa922bf03e891e"'), ('date', 'Fri, 01 Jun 2012 18:39:31 GMT'), ('content-type', 'application/json; charset=utf-8'), ('location', 'https://api.github.com/repos/jacquev6/PyGithub/git/commits/6adf9ea25ff8a8f2a42bcb1c09e42526339037cd')] {"committer":{"email":"github.com@vincent-jacques.net","date":"2012-06-01T11:39:31-07:00","name":"Vincent Jacques"},"message":"Commit created by PyGithub","url":"https://api.github.com/repos/jacquev6/PyGithub/git/commits/6adf9ea25ff8a8f2a42bcb1c09e42526339037cd","sha":"6adf9ea25ff8a8f2a42bcb1c09e42526339037cd","parents":[{"url":"https://api.github.com/repos/jacquev6/PyGithub/git/commits/7248e66831d4ffe09ef1f30a1df59ec0a9331ece","sha":"7248e66831d4ffe09ef1f30a1df59ec0a9331ece"},{"url":"https://api.github.com/repos/jacquev6/PyGithub/git/commits/12d427464f8d91c8e981043a86ba8a2a9e7319ea","sha":"12d427464f8d91c8e981043a86ba8a2a9e7319ea"}],"tree":{"url":"https://api.github.com/repos/jacquev6/PyGithub/git/trees/fae707821159639589bf94f3fb0a7154ec5d441b","sha":"fae707821159639589bf94f3fb0a7154ec5d441b"},"author":{"email":"github.com@vincent-jacques.net","date":"2012-06-01T11:39:31-07:00","name":"Vincent Jacques"}} diff --git a/github/tests/ReplayData/Repository.testCreateGitRef.txt b/github/tests/ReplayData/Repository.testCreateGitRef.txt index 7dcf0c6c..389b67d2 100644 --- a/github/tests/ReplayData/Repository.testCreateGitRef.txt +++ b/github/tests/ReplayData/Repository.testCreateGitRef.txt @@ -1,4 +1,4 @@ -https POST api.github.com None /repos/jacquev6/PyGithub/git/refs {'Authorization': 'Basic login_and_password_removed'} {"sha": "4303c5b90e2216d927155e9609436ccb8984c495", "ref": "refs/heads/BranchCreatedByPyGithub"} +https POST api.github.com None /repos/jacquev6/PyGithub/git/refs {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"sha": "4303c5b90e2216d927155e9609436ccb8984c495", "ref": "refs/heads/BranchCreatedByPyGithub"} 201 [('status', '201 Created'), ('x-ratelimit-remaining', '4987'), ('content-length', '322'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"0302e489fc6bd534afa44cdbec1227e7"'), ('date', 'Thu, 10 May 2012 18:49:19 GMT'), ('content-type', 'application/json; charset=utf-8'), ('location', 'https://api.github.com/repos/jacquev6/PyGithub/git/refs/heads/BranchCreatedByPyGithub')] {"object":{"type":"commit","sha":"4303c5b90e2216d927155e9609436ccb8984c495","url":"https://api.github.com/repos/jacquev6/PyGithub/git/commits/4303c5b90e2216d927155e9609436ccb8984c495"},"ref":"refs/heads/BranchCreatedByPyGithub","url":"https://api.github.com/repos/jacquev6/PyGithub/git/refs/heads/BranchCreatedByPyGithub"} diff --git a/github/tests/ReplayData/Repository.testCreateGitTag.txt b/github/tests/ReplayData/Repository.testCreateGitTag.txt index 391c81b6..33cbe891 100644 --- a/github/tests/ReplayData/Repository.testCreateGitTag.txt +++ b/github/tests/ReplayData/Repository.testCreateGitTag.txt @@ -1,4 +1,4 @@ -https POST api.github.com None /repos/jacquev6/PyGithub/git/tags {'Authorization': 'Basic login_and_password_removed'} {"message": "Tag created by PyGithub", "tag": "TaggedByPyGithub", "type": "commit", "object": "0b820628236ab8bab3890860fc414fa757ca15f4"} +https POST api.github.com None /repos/jacquev6/PyGithub/git/tags {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"message": "Tag created by PyGithub", "tag": "TaggedByPyGithub", "type": "commit", "object": "0b820628236ab8bab3890860fc414fa757ca15f4"} 201 [('status', '201 Created'), ('x-ratelimit-remaining', '4925'), ('content-length', '512'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"9a9c1f293329ee4c63e8cfb08772e3a1"'), ('date', 'Sun, 27 May 2012 05:56:08 GMT'), ('content-type', 'application/json; charset=utf-8'), ('location', 'https://api.github.com/repos/jacquev6/PyGithub/git/tags/5ba561eaa2b7ca9015662510157b15d8f3b0232a')] {"url":"https://api.github.com/repos/jacquev6/PyGithub/git/tags/5ba561eaa2b7ca9015662510157b15d8f3b0232a","message":"Tag created by PyGithub","tag":"TaggedByPyGithub","object":{"type":"commit","url":"https://api.github.com/repos/jacquev6/PyGithub/git/commits/0b820628236ab8bab3890860fc414fa757ca15f4","sha":"0b820628236ab8bab3890860fc414fa757ca15f4"},"tagger":{"email":"github.com@vincent-jacques.net","name":"Vincent Jacques","date":"2012-05-26T22:56:07-07:00"},"sha":"5ba561eaa2b7ca9015662510157b15d8f3b0232a"} diff --git a/github/tests/ReplayData/Repository.testCreateGitTagWithAllArguments.txt b/github/tests/ReplayData/Repository.testCreateGitTagWithAllArguments.txt index b4c2028d..a6deecf0 100644 --- a/github/tests/ReplayData/Repository.testCreateGitTagWithAllArguments.txt +++ b/github/tests/ReplayData/Repository.testCreateGitTagWithAllArguments.txt @@ -1,4 +1,4 @@ -https POST api.github.com None /repos/jacquev6/PyGithub/git/tags {'Authorization': 'Basic login_and_password_removed'} {"tagger": {"date": "2008-07-09T16:13:30+12:00", "name": "John Doe", "email": "j.doe@vincent-jacques.net"}, "message": "Tag also created by PyGithub", "tag": "TaggedByPyGithub2", "type": "commit", "object": "526946197ae9da59c6507cacd13ad6f1cfb686ea"} +https POST api.github.com None /repos/jacquev6/PyGithub/git/tags {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"tagger": {"date": "2008-07-09T16:13:30+12:00", "name": "John Doe", "email": "j.doe@vincent-jacques.net"}, "message": "Tag also created by PyGithub", "tag": "TaggedByPyGithub2", "type": "commit", "object": "526946197ae9da59c6507cacd13ad6f1cfb686ea"} 201 [('status', '201 Created'), ('x-ratelimit-remaining', '4922'), ('content-length', '506'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"a7e5d9e4342e323fa513f880968b80f4"'), ('date', 'Sun, 27 May 2012 05:57:03 GMT'), ('content-type', 'application/json; charset=utf-8'), ('location', 'https://api.github.com/repos/jacquev6/PyGithub/git/tags/f0e99a8335fbc84c53366c4a681118468f266625')] {"url":"https://api.github.com/repos/jacquev6/PyGithub/git/tags/f0e99a8335fbc84c53366c4a681118468f266625","message":"Tag also created by PyGithub","tag":"TaggedByPyGithub2","object":{"type":"commit","url":"https://api.github.com/repos/jacquev6/PyGithub/git/commits/526946197ae9da59c6507cacd13ad6f1cfb686ea","sha":"526946197ae9da59c6507cacd13ad6f1cfb686ea"},"tagger":{"email":"j.doe@vincent-jacques.net","name":"John Doe","date":"2008-07-08T21:13:30-07:00"},"sha":"f0e99a8335fbc84c53366c4a681118468f266625"} diff --git a/github/tests/ReplayData/Repository.testCreateGitTree.txt b/github/tests/ReplayData/Repository.testCreateGitTree.txt index 69c4adfe..d1febca8 100644 --- a/github/tests/ReplayData/Repository.testCreateGitTree.txt +++ b/github/tests/ReplayData/Repository.testCreateGitTree.txt @@ -1,4 +1,4 @@ -https POST api.github.com None /repos/jacquev6/PyGithub/git/trees {'Authorization': 'Basic login_and_password_removed'} {"tree": [{"content": "File created by PyGithub", "path": "Foobar.txt", "type": "blob", "mode": "100644"}]} +https POST api.github.com None /repos/jacquev6/PyGithub/git/trees {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"tree": [{"content": "File created by PyGithub", "path": "Foobar.txt", "type": "blob", "mode": "100644"}]} 201 [('status', '201 Created'), ('x-ratelimit-remaining', '4937'), ('content-length', '382'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"0446b5f676814b5801ab6744ef9b59f7"'), ('date', 'Sun, 27 May 2012 05:48:14 GMT'), ('content-type', 'application/json; charset=utf-8'), ('location', 'https://api.github.com/repos/jacquev6/PyGithub/git/trees/41cf8c178c636a018d537cb20daae09391efd70b')] {"url":"https://api.github.com/repos/jacquev6/PyGithub/git/trees/41cf8c178c636a018d537cb20daae09391efd70b","sha":"41cf8c178c636a018d537cb20daae09391efd70b","tree":[{"type":"blob","url":"https://api.github.com/repos/jacquev6/PyGithub/git/blobs/73a1c7f17aa0ad5d7cbb5a8ca033ce47d3d23197","size":24,"path":"Foobar.txt","sha":"73a1c7f17aa0ad5d7cbb5a8ca033ce47d3d23197","mode":"100644"}]} diff --git a/github/tests/ReplayData/Repository.testCreateGitTreeWithBaseTree.txt b/github/tests/ReplayData/Repository.testCreateGitTreeWithBaseTree.txt index cb0e69e4..dcc55f7d 100644 --- a/github/tests/ReplayData/Repository.testCreateGitTreeWithBaseTree.txt +++ b/github/tests/ReplayData/Repository.testCreateGitTreeWithBaseTree.txt @@ -3,7 +3,7 @@ https GET api.github.com None /repos/jacquev6/PyGithub/git/trees/41cf8c178c636a0 [('status', '200 OK'), ('x-ratelimit-remaining', '4994'), ('content-length', '381'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"f33782d7031ff19c5301bb52068533cf"'), ('date', 'Fri, 01 Jun 2012 20:02:40 GMT'), ('content-type', 'application/json; charset=utf-8')] {"url":"https://api.github.com/repos/jacquev6/PyGithub/git/trees/41cf8c178c636a018d537cb20daae09391efd70b","sha":"41cf8c178c636a018d537cb20daae09391efd70b","tree":[{"type":"blob","url":"https://api.github.com/repos/jacquev6/PyGithub/git/blobs/5dd930f591cd5188e9ea7200e308ad355182a1d8","sha":"5dd930f591cd5188e9ea7200e308ad355182a1d8","size":0,"path":"Barbaz.txt","mode":"100644"}]} -https POST api.github.com None /repos/jacquev6/PyGithub/git/trees {'Authorization': 'Basic login_and_password_removed'} {"tree": [{"content": "File also created by PyGithub", "path": "Barbaz.txt", "type": "blob", "mode": "100644"}], "base_tree": "41cf8c178c636a018d537cb20daae09391efd70b"} +https POST api.github.com None /repos/jacquev6/PyGithub/git/trees {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"tree": [{"content": "File also created by PyGithub", "path": "Barbaz.txt", "type": "blob", "mode": "100644"}], "base_tree": "41cf8c178c636a018d537cb20daae09391efd70b"} 201 [('status', '201 Created'), ('x-ratelimit-remaining', '4934'), ('content-length', '599'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"f04d90b327eaf7b7600bc22fd11a41a4"'), ('date', 'Sun, 27 May 2012 05:49:48 GMT'), ('content-type', 'application/json; charset=utf-8'), ('location', 'https://api.github.com/repos/jacquev6/PyGithub/git/trees/107139a922f33bab6fbeb9f9eb8787e7f19e0528')] {"tree":[{"type":"blob","sha":"92be1df4e473d2541c5c166ad145a39d0324de8b","url":"https://api.github.com/repos/jacquev6/PyGithub/git/blobs/92be1df4e473d2541c5c166ad145a39d0324de8b","size":29,"path":"Barbaz.txt","mode":"100644"},{"type":"blob","sha":"73a1c7f17aa0ad5d7cbb5a8ca033ce47d3d23197","url":"https://api.github.com/repos/jacquev6/PyGithub/git/blobs/73a1c7f17aa0ad5d7cbb5a8ca033ce47d3d23197","size":24,"path":"Foobar.txt","mode":"100644"}],"sha":"107139a922f33bab6fbeb9f9eb8787e7f19e0528","url":"https://api.github.com/repos/jacquev6/PyGithub/git/trees/107139a922f33bab6fbeb9f9eb8787e7f19e0528"} diff --git a/github/tests/ReplayData/Repository.testCreateGitTreeWithSha.txt b/github/tests/ReplayData/Repository.testCreateGitTreeWithSha.txt index cb02f1ca..06583904 100644 --- a/github/tests/ReplayData/Repository.testCreateGitTreeWithSha.txt +++ b/github/tests/ReplayData/Repository.testCreateGitTreeWithSha.txt @@ -1,4 +1,4 @@ -https POST api.github.com None /repos/jacquev6/PyGithub/git/trees {'Authorization': 'Basic login_and_password_removed'} {"tree": [{"path": "Barbaz.txt", "type": "blob", "mode": "100644", "sha": "5dd930f591cd5188e9ea7200e308ad355182a1d8"}]} +https POST api.github.com None /repos/jacquev6/PyGithub/git/trees {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"tree": [{"path": "Barbaz.txt", "type": "blob", "mode": "100644", "sha": "5dd930f591cd5188e9ea7200e308ad355182a1d8"}]} 201 [('status', '201 Created'), ('x-ratelimit-remaining', '4997'), ('content-length', '381'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"f33782d7031ff19c5301bb52068533cf"'), ('date', 'Fri, 01 Jun 2012 17:51:04 GMT'), ('content-type', 'application/json; charset=utf-8'), ('location', 'https://api.github.com/repos/jacquev6/PyGithub/git/trees/fae707821159639589bf94f3fb0a7154ec5d441b')] {"url":"https://api.github.com/repos/jacquev6/PyGithub/git/trees/fae707821159639589bf94f3fb0a7154ec5d441b","sha":"fae707821159639589bf94f3fb0a7154ec5d441b","tree":[{"type":"blob","url":"https://api.github.com/repos/jacquev6/PyGithub/git/blobs/5dd930f591cd5188e9ea7200e308ad355182a1d8","sha":"5dd930f591cd5188e9ea7200e308ad355182a1d8","size":0,"path":"Barbaz.txt","mode":"100644"}]} diff --git a/github/tests/ReplayData/Repository.testCreateHookWithAllParameters.txt b/github/tests/ReplayData/Repository.testCreateHookWithAllParameters.txt index 55de5ad5..cf44a174 100644 --- a/github/tests/ReplayData/Repository.testCreateHookWithAllParameters.txt +++ b/github/tests/ReplayData/Repository.testCreateHookWithAllParameters.txt @@ -1,4 +1,4 @@ -https POST api.github.com None /repos/jacquev6/PyGithub/hooks {'Authorization': 'Basic login_and_password_removed'} {"active": false, "config": {"url": "http://foobar.com"}, "name": "web", "events": ["fork"]} +https POST api.github.com None /repos/jacquev6/PyGithub/hooks {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"active": false, "config": {"url": "http://foobar.com"}, "name": "web", "events": ["fork"]} 201 [('status', '201 Created'), ('x-ratelimit-remaining', '4997'), ('content-length', '298'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"c3b371e4de1a0ec350b3fcc0c458e0f9"'), ('date', 'Sat, 19 May 2012 06:01:45 GMT'), ('content-type', 'application/json; charset=utf-8'), ('location', 'https://api.github.com/repos/jacquev6/PyGithub/hooks/257993')] {"updated_at":"2012-05-19T06:01:45Z","last_response":{"status":"unused","message":null,"code":null},"events":["fork"],"url":"https://api.github.com/repos/jacquev6/PyGithub/hooks/257993","active":true,"name":"web","config":{"url":"http://foobar.com"},"id":257993,"created_at":"2012-05-19T06:01:45Z"} diff --git a/github/tests/ReplayData/Repository.testCreateHookWithMinimalParameters.txt b/github/tests/ReplayData/Repository.testCreateHookWithMinimalParameters.txt index c3c57001..31b9a132 100644 --- a/github/tests/ReplayData/Repository.testCreateHookWithMinimalParameters.txt +++ b/github/tests/ReplayData/Repository.testCreateHookWithMinimalParameters.txt @@ -1,4 +1,4 @@ -https POST api.github.com None /repos/jacquev6/PyGithub/hooks {'Authorization': 'Basic login_and_password_removed'} {"config": {"url": "http://foobar.com"}, "name": "web"} +https POST api.github.com None /repos/jacquev6/PyGithub/hooks {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"config": {"url": "http://foobar.com"}, "name": "web"} 201 [('status', '201 Created'), ('x-ratelimit-remaining', '4994'), ('content-length', '298'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"276d18854081948260c44cf645c54bd0"'), ('date', 'Sat, 19 May 2012 05:03:14 GMT'), ('content-type', 'application/json; charset=utf-8'), ('location', 'https://api.github.com/repos/jacquev6/PyGithub/hooks/257967')] {"updated_at":"2012-05-19T05:03:14Z","url":"https://api.github.com/repos/jacquev6/PyGithub/hooks/257967","config":{"url":"http://foobar.com"},"last_response":{"status":"unused","message":null,"code":null},"active":true,"events":["push"],"name":"web","created_at":"2012-05-19T05:03:14Z","id":257967} diff --git a/github/tests/ReplayData/Repository.testCreateIssue.txt b/github/tests/ReplayData/Repository.testCreateIssue.txt index 7cc9214c..1812b9e4 100644 --- a/github/tests/ReplayData/Repository.testCreateIssue.txt +++ b/github/tests/ReplayData/Repository.testCreateIssue.txt @@ -1,4 +1,4 @@ -https POST api.github.com None /repos/jacquev6/PyGithub/issues {'Authorization': 'Basic login_and_password_removed'} {"title": "Issue created by PyGithub"} +https POST api.github.com None /repos/jacquev6/PyGithub/issues {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"title": "Issue created by PyGithub"} 201 [('status', '201 Created'), ('x-ratelimit-remaining', '4935'), ('content-length', '748'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"26e2222fe8411843d3fd2b024d50c567"'), ('date', 'Sat, 19 May 2012 10:38:24 GMT'), ('content-type', 'application/json; charset=utf-8'), ('location', 'https://api.github.com/repos/jacquev6/PyGithub/issues/28')] {"closed_by":null,"state":"open","user":{"url":"https://api.github.com/users/jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146},"title":"Issue created by PyGithub","comments":0,"updated_at":"2012-05-19T10:38:23Z","pull_request":{"diff_url":null,"patch_url":null,"html_url":null},"closed_at":null,"body":null,"number":28,"milestone":null,"url":"https://api.github.com/repos/jacquev6/PyGithub/issues/28","assignee":null,"labels":[],"id":4653757,"html_url":"https://github.com/jacquev6/PyGithub/issues/28","created_at":"2012-05-19T10:38:23Z"} diff --git a/github/tests/ReplayData/Repository.testCreateIssueWithAllArguments.txt b/github/tests/ReplayData/Repository.testCreateIssueWithAllArguments.txt index 79542403..4ea467c1 100644 --- a/github/tests/ReplayData/Repository.testCreateIssueWithAllArguments.txt +++ b/github/tests/ReplayData/Repository.testCreateIssueWithAllArguments.txt @@ -13,7 +13,7 @@ https GET api.github.com None /repos/jacquev6/PyGithub/labels/Question {'Authori [('status', '200 OK'), ('x-ratelimit-remaining', '4989'), ('content-length', '107'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"931e58d337b2290717303141eda89cd7"'), ('date', 'Fri, 01 Jun 2012 20:09:25 GMT'), ('content-type', 'application/json; charset=utf-8')] {"color":"02e10c","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Question","name":"Question"} -https POST api.github.com None /repos/jacquev6/PyGithub/issues {'Authorization': 'Basic login_and_password_removed'} {"body": "Body created by PyGithub", "assignee": "jacquev6", "labels": ["Question"], "milestone": 2, "title": "Issue also created by PyGithub"} +https POST api.github.com None /repos/jacquev6/PyGithub/issues {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"body": "Body created by PyGithub", "assignee": "jacquev6", "labels": ["Question"], "milestone": 2, "title": "Issue also created by PyGithub"} 201 [('status', '201 Created'), ('x-ratelimit-remaining', '4943'), ('content-length', '2069'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"d131a11b793937127bf7d0ce56e2805e"'), ('date', 'Sun, 27 May 2012 05:40:15 GMT'), ('content-type', 'application/json; charset=utf-8'), ('location', 'https://api.github.com/repos/jacquev6/PyGithub/issues/30')] {"updated_at":"2012-05-27T05:40:15Z","body":"Body created by PyGithub","url":"https://api.github.com/repos/jacquev6/PyGithub/issues/30","comments":0,"milestone":{"creator":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146,"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"url":"https://api.github.com/repos/jacquev6/PyGithub/milestones/2","number":2,"title":"Version 1.0: coherent public interface","due_on":"2012-06-04T07:00:00Z","open_issues":10,"created_at":"2012-03-08T12:22:28Z","state":"open","description":"Heavy rewrite to have:\r\n* a fully coherent public interface\r\n* usable stack-traces in case of exception\r\n* more explicit exceptions\r\n* more readable code (for library exploration, auto-completion in IDEs, etc.)\r\n\r\nSee working branch https://github.com/jacquev6/PyGithub/tree/topic/RewriteWithGeneratedCode","id":93547,"closed_issues":2},"number":30,"closed_by":null,"assignee":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146,"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"closed_at":null,"title":"Issue also created by PyGithub","labels":[{"url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Question","name":"Question","color":"02e10c"}],"created_at":"2012-05-27T05:40:15Z","state":"open","user":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146,"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"id":4769659,"pull_request":{"patch_url":null,"diff_url":null,"html_url":null},"html_url":"https://github.com/jacquev6/PyGithub/issues/30"} diff --git a/github/tests/ReplayData/Repository.testCreateKey.txt b/github/tests/ReplayData/Repository.testCreateKey.txt index bb612d89..460f12bb 100644 --- a/github/tests/ReplayData/Repository.testCreateKey.txt +++ b/github/tests/ReplayData/Repository.testCreateKey.txt @@ -1,4 +1,4 @@ -https POST api.github.com None /repos/jacquev6/PyGithub/keys {'Authorization': 'Basic login_and_password_removed'} {"key": "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA2Mm0RjTNAYFfSCtUpO54usdseroUSIYg5KX4JoseTpqyiB/hqewjYLAdUq/tNIQzrkoEJWSyZrQt0ma7/YCyMYuNGd3DU6q6ZAyBeY3E9RyCiKjO3aTL2VKQGFvBVVmGdxGVSCITRphAcsKc/PF35/fg9XP9S0anMXcEFtdfMHz41SSw+XtE+Vc+6cX9FuI5qUfLGbkv8L1v3g4uw9VXlzq4GfTA+1S7D6mcoGHopAIXFlVr+2RfDKdSURMcB22z41fljO1MW4+zUS/4FyUTpL991es5fcwKXYoiE+x06VJeJJ1Krwx+DZj45uweV6cHXt2JwJEI9fWB6WyBlDejWw== vincent@IDEE", "title": "Key added through PyGithub"} +https POST api.github.com None /repos/jacquev6/PyGithub/keys {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"key": "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA2Mm0RjTNAYFfSCtUpO54usdseroUSIYg5KX4JoseTpqyiB/hqewjYLAdUq/tNIQzrkoEJWSyZrQt0ma7/YCyMYuNGd3DU6q6ZAyBeY3E9RyCiKjO3aTL2VKQGFvBVVmGdxGVSCITRphAcsKc/PF35/fg9XP9S0anMXcEFtdfMHz41SSw+XtE+Vc+6cX9FuI5qUfLGbkv8L1v3g4uw9VXlzq4GfTA+1S7D6mcoGHopAIXFlVr+2RfDKdSURMcB22z41fljO1MW4+zUS/4FyUTpL991es5fcwKXYoiE+x06VJeJJ1Krwx+DZj45uweV6cHXt2JwJEI9fWB6WyBlDejWw== vincent@IDEE", "title": "Key added through PyGithub"} 201 [('status', '201 Created'), ('x-ratelimit-remaining', '4955'), ('content-length', '505'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"0eb643b648f2ef29f38c2bcbce872e09"'), ('date', 'Sat, 26 May 2012 20:28:37 GMT'), ('content-type', 'application/json; charset=utf-8'), ('location', 'https://api.github.com/user/keys/2626761')] {"url":"https://api.github.com/user/keys/2626761","key":"ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA2Mm0RjTNAYFfSCtUpO54usdseroUSIYg5KX4JoseTpqyiB/hqewjYLAdUq/tNIQzrkoEJWSyZrQt0ma7/YCyMYuNGd3DU6q6ZAyBeY3E9RyCiKjO3aTL2VKQGFvBVVmGdxGVSCITRphAcsKc/PF35/fg9XP9S0anMXcEFtdfMHz41SSw+XtE+Vc+6cX9FuI5qUfLGbkv8L1v3g4uw9VXlzq4GfTA+1S7D6mcoGHopAIXFlVr+2RfDKdSURMcB22z41fljO1MW4+zUS/4FyUTpL991es5fcwKXYoiE+x06VJeJJ1Krwx+DZj45uweV6cHXt2JwJEI9fWB6WyBlDejWw==","verified":true,"title":"Key added through PyGithub","id":2626761} diff --git a/github/tests/ReplayData/Repository.testCreateLabel.txt b/github/tests/ReplayData/Repository.testCreateLabel.txt index a0b0d76a..20b80f6a 100644 --- a/github/tests/ReplayData/Repository.testCreateLabel.txt +++ b/github/tests/ReplayData/Repository.testCreateLabel.txt @@ -1,4 +1,4 @@ -https POST api.github.com None /repos/jacquev6/PyGithub/labels {'Authorization': 'Basic login_and_password_removed'} {"color": "00ff00", "name": "Label with silly name % * + created by PyGithub"} +https POST api.github.com None /repos/jacquev6/PyGithub/labels {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"color": "00ff00", "name": "Label with silly name % * + created by PyGithub"} 201 [('status', '201 Created'), ('x-ratelimit-remaining', '4969'), ('content-length', '191'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"92b623552b1bac3f019d03c920305acd"'), ('date', 'Sat, 19 May 2012 10:17:36 GMT'), ('content-type', 'application/json; charset=utf-8'), ('location', 'https://api.github.com/repos/jacquev6/PyGithub/labels/Label+with+silly+name+%25+%2A+%2B+created+by+PyGithub')] {"url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Label+with+silly+name+%25+%2A+%2B+created+by+PyGithub","name":"Label with silly name % * + created by PyGithub","color":"00ff00"} diff --git a/github/tests/ReplayData/Repository.testCreateMilestone.txt b/github/tests/ReplayData/Repository.testCreateMilestone.txt index 373adef1..ac505a49 100644 --- a/github/tests/ReplayData/Repository.testCreateMilestone.txt +++ b/github/tests/ReplayData/Repository.testCreateMilestone.txt @@ -1,4 +1,4 @@ -https POST api.github.com None /repos/jacquev6/PyGithub/milestones {'Authorization': 'Basic login_and_password_removed'} {"due_on": "2012-06-15", "state": "open", "description": "Description created by PyGithub", "title": "Milestone created by PyGithub"} +https POST api.github.com None /repos/jacquev6/PyGithub/milestones {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"due_on": "2012-06-15", "state": "open", "description": "Description created by PyGithub", "title": "Milestone created by PyGithub"} 201 [('status', '201 Created'), ('x-ratelimit-remaining', '4958'), ('content-length', '604'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"bb5eb08c923020c102396cd0c9bfdbc5"'), ('date', 'Sat, 19 May 2012 10:24:13 GMT'), ('content-type', 'application/json; charset=utf-8'), ('location', 'https://api.github.com/repos/jacquev6/PyGithub/milestones/5')] {"closed_issues":0,"url":"https://api.github.com/repos/jacquev6/PyGithub/milestones/5","due_on":"2012-06-15T07:00:00Z","creator":{"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146},"number":5,"open_issues":0,"title":"Milestone created by PyGithub","created_at":"2012-05-19T10:24:13Z","state":"open","description":"Description created by PyGithub","id":121463} diff --git a/github/tests/ReplayData/Repository.testCreateMilestoneWithMinimalArguments.txt b/github/tests/ReplayData/Repository.testCreateMilestoneWithMinimalArguments.txt index 5271d8be..14d4007b 100644 --- a/github/tests/ReplayData/Repository.testCreateMilestoneWithMinimalArguments.txt +++ b/github/tests/ReplayData/Repository.testCreateMilestoneWithMinimalArguments.txt @@ -1,4 +1,4 @@ -https POST api.github.com None /repos/jacquev6/PyGithub/milestones {'Authorization': 'Basic login_and_password_removed'} {"title": "Milestone also created by PyGithub"} +https POST api.github.com None /repos/jacquev6/PyGithub/milestones {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"title": "Milestone also created by PyGithub"} 201 [('status', '201 Created'), ('x-ratelimit-remaining', '4940'), ('content-length', '562'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"575796ba6077c16fdc79f4d38885aa5f"'), ('date', 'Sun, 27 May 2012 05:41:34 GMT'), ('content-type', 'application/json; charset=utf-8'), ('location', 'https://api.github.com/repos/jacquev6/PyGithub/milestones/6')] {"creator":{"url":"https://api.github.com/users/jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146},"closed_issues":0,"url":"https://api.github.com/repos/jacquev6/PyGithub/milestones/6","number":6,"title":"Milestone also created by PyGithub","due_on":null,"open_issues":0,"created_at":"2012-05-27T05:41:34Z","state":"open","description":null,"id":124480} diff --git a/github/tests/ReplayData/Repository.testCreatePull.txt b/github/tests/ReplayData/Repository.testCreatePull.txt index 37f37b1e..00375304 100644 --- a/github/tests/ReplayData/Repository.testCreatePull.txt +++ b/github/tests/ReplayData/Repository.testCreatePull.txt @@ -1,4 +1,4 @@ -https POST api.github.com None /repos/jacquev6/PyGithub/pulls {'Authorization': 'Basic login_and_password_removed'} {"body": "Body of the pull request", "head": "BeaverSoftware:master", "base": "topic/RewriteWithGeneratedCode", "title": "Pull request created by PyGithub"} +https POST api.github.com None /repos/jacquev6/PyGithub/pulls {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"body": "Body of the pull request", "head": "BeaverSoftware:master", "base": "topic/RewriteWithGeneratedCode", "title": "Pull request created by PyGithub"} 201 [('status', '201 Created'), ('x-ratelimit-remaining', '4963'), ('content-length', '4486'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"1e069be7c3e3eb8b12afb1e1f5343dc9"'), ('date', 'Sun, 27 May 2012 09:25:37 GMT'), ('content-type', 'application/json; charset=utf-8'), ('location', 'https://api.github.com/repos/jacquev6/PyGithub/pulls/31')] {"merged":false,"patch_url":"https://github.com/jacquev6/PyGithub/pull/31.patch","mergeable":null,"head":{"ref":"master","label":"BeaverSoftware:master","repo":{"clone_url":"https://github.com/BeaverSoftware/PyGithub.git","has_downloads":true,"watchers":1,"updated_at":"2012-05-27T09:09:17Z","homepage":"http://vincent-jacques.net/PyGithub","url":"https://api.github.com/repos/BeaverSoftware/PyGithub","mirror_url":null,"has_wiki":false,"has_issues":false,"fork":true,"forks":0,"size":176,"private":false,"open_issues":0,"svn_url":"https://github.com/BeaverSoftware/PyGithub","owner":{"url":"https://api.github.com/users/BeaverSoftware","gravatar_id":"d563e337cac2fdc644e2aaaad1e23266","login":"BeaverSoftware","id":1424031,"avatar_url":"https://secure.gravatar.com/avatar/d563e337cac2fdc644e2aaaad1e23266?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png"},"name":"PyGithub","language":"Python","description":"Python library implementing the full Github API v3","ssh_url":"git@github.com:BeaverSoftware/PyGithub.git","pushed_at":"2012-05-27T09:09:17Z","created_at":"2012-05-27T08:50:04Z","id":4460787,"git_url":"git://github.com/BeaverSoftware/PyGithub.git","html_url":"https://github.com/BeaverSoftware/PyGithub","full_name":"BeaverSoftware/PyGithub"},"user":{"url":"https://api.github.com/users/BeaverSoftware","gravatar_id":"d563e337cac2fdc644e2aaaad1e23266","login":"BeaverSoftware","id":1424031,"avatar_url":"https://secure.gravatar.com/avatar/d563e337cac2fdc644e2aaaad1e23266?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png"},"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},"updated_at":"2012-05-27T09:25:36Z","issue_url":"https://github.com/jacquev6/PyGithub/issues/31","body":"Body of the pull request","url":"https://api.github.com/repos/jacquev6/PyGithub/pulls/31","comments":0,"base":{"ref":"topic/RewriteWithGeneratedCode","label":"jacquev6:topic/RewriteWithGeneratedCode","repo":{"clone_url":"https://github.com/jacquev6/PyGithub.git","has_downloads":true,"watchers":15,"updated_at":"2012-05-27T08:50:04Z","homepage":"http://vincent-jacques.net/PyGithub","url":"https://api.github.com/repos/jacquev6/PyGithub","mirror_url":null,"has_wiki":false,"has_issues":true,"fork":false,"forks":3,"size":308,"private":false,"open_issues":16,"svn_url":"https://github.com/jacquev6/PyGithub","owner":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146,"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"name":"PyGithub","language":"Python","description":"Python library implementing the full Github API v3","ssh_url":"git@github.com:jacquev6/PyGithub.git","pushed_at":"2012-05-27T07:29:24Z","created_at":"2012-02-25T12:53:47Z","id":3544490,"git_url":"git://github.com/jacquev6/PyGithub.git","html_url":"https://github.com/jacquev6/PyGithub","full_name":"jacquev6/PyGithub"},"user":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146,"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"sha":"ed866fc43833802ab553e5ff8581c81bb00dd433"},"number":31,"merged_by":null,"closed_at":null,"title":"Pull request created by PyGithub","deletions":384,"merged_at":null,"diff_url":"https://github.com/jacquev6/PyGithub/pull/31.diff","additions":511,"_links":{"self":{"href":"https://api.github.com/repos/jacquev6/PyGithub/pulls/31"},"comments":{"href":"https://api.github.com/repos/jacquev6/PyGithub/issues/31/comments"},"issue":{"href":"https://api.github.com/repos/jacquev6/PyGithub/issues/31"},"html":{"href":"https://github.com/jacquev6/PyGithub/pull/31"},"review_comments":{"href":"https://api.github.com/repos/jacquev6/PyGithub/pulls/31/comments"}},"created_at":"2012-05-27T09:25:36Z","user":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146,"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"state":"open","id":1436215,"review_comments":0,"commits":3,"changed_files":45,"html_url":"https://github.com/jacquev6/PyGithub/pull/31"} diff --git a/github/tests/ReplayData/Repository.testCreatePullFromIssue.txt b/github/tests/ReplayData/Repository.testCreatePullFromIssue.txt index 9f242aee..8bcad9e9 100644 --- a/github/tests/ReplayData/Repository.testCreatePullFromIssue.txt +++ b/github/tests/ReplayData/Repository.testCreatePullFromIssue.txt @@ -3,7 +3,7 @@ https GET api.github.com None /repos/jacquev6/PyGithub/issues/32 {'Authorization [('status', '200 OK'), ('x-ratelimit-remaining', '4986'), ('content-length', '2141'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"f88aca2b371ce28f651166ed9c5a2525"'), ('date', 'Fri, 01 Jun 2012 20:10:41 GMT'), ('content-type', 'application/json; charset=utf-8')] {"title":"Creation of a pull request from an issue is not covered by integration tests","pull_request":{"diff_url":"https://github.com/jacquev6/PyGithub/pull/32.diff","patch_url":"https://github.com/jacquev6/PyGithub/pull/32.patch","html_url":"https://github.com/jacquev6/PyGithub/pull/32"},"labels":[],"created_at":"2012-05-27T10:55:12Z","state":"closed","user":{"gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","url":"https://api.github.com/users/jacquev6","id":327146,"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"url":"https://api.github.com/repos/jacquev6/PyGithub/issues/32","assignee":null,"closed_at":"2012-05-27T11:03:53Z","updated_at":"2012-05-27T11:03:53Z","body":"","comments":0,"number":32,"id":4770481,"html_url":"https://github.com/jacquev6/PyGithub/issues/32","closed_by":{"gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","url":"https://api.github.com/users/jacquev6","id":327146,"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"milestone":{"title":"Version 1.0: coherent public interface","creator":{"gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","url":"https://api.github.com/users/jacquev6","id":327146,"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"created_at":"2012-03-08T12:22:28Z","state":"open","description":"Heavy rewrite to have:\r\n* a fully coherent public interface\r\n* usable stack-traces in case of exception\r\n* more explicit exceptions\r\n* more readable code (for library exploration, auto-completion in IDEs, etc.)\r\n\r\nSee working branch https://github.com/jacquev6/PyGithub/tree/topic/RewriteWithGeneratedCode","url":"https://api.github.com/repos/jacquev6/PyGithub/milestones/2","closed_issues":13,"due_on":"2012-06-04T07:00:00Z","open_issues":6,"number":2,"id":93547}} -https POST api.github.com None /repos/jacquev6/PyGithub/pulls {'Authorization': 'Basic login_and_password_removed'} {"head": "BeaverSoftware:master", "base": "topic/RewriteWithGeneratedCode", "issue": 32} +https POST api.github.com None /repos/jacquev6/PyGithub/pulls {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"head": "BeaverSoftware:master", "base": "topic/RewriteWithGeneratedCode", "issue": 32} 201 [('status', '201 Created'), ('x-ratelimit-remaining', '4933'), ('content-length', '4501'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"2b035f5260fe63dd611156fea3049af0"'), ('date', 'Sun, 27 May 2012 10:58:42 GMT'), ('content-type', 'application/json; charset=utf-8'), ('location', 'https://api.github.com/repos/jacquev6/PyGithub/pulls/32')] {"merged":false,"patch_url":"https://github.com/jacquev6/PyGithub/pull/32.patch","mergeable":null,"head":{"ref":"master","label":"BeaverSoftware:master","repo":{"clone_url":"https://github.com/BeaverSoftware/PyGithub.git","has_downloads":true,"watchers":1,"updated_at":"2012-05-27T10:58:08Z","homepage":"http://vincent-jacques.net/PyGithub","url":"https://api.github.com/repos/BeaverSoftware/PyGithub","mirror_url":null,"has_wiki":false,"has_issues":false,"fork":true,"forks":0,"size":176,"private":false,"open_issues":0,"svn_url":"https://github.com/BeaverSoftware/PyGithub","owner":{"url":"https://api.github.com/users/BeaverSoftware","gravatar_id":"d563e337cac2fdc644e2aaaad1e23266","login":"BeaverSoftware","id":1424031,"avatar_url":"https://secure.gravatar.com/avatar/d563e337cac2fdc644e2aaaad1e23266?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png"},"name":"PyGithub","language":"Python","description":"Python library implementing the full Github API v3","ssh_url":"git@github.com:BeaverSoftware/PyGithub.git","pushed_at":"2012-05-27T10:58:08Z","created_at":"2012-05-27T08:50:04Z","id":4460787,"git_url":"git://github.com/BeaverSoftware/PyGithub.git","html_url":"https://github.com/BeaverSoftware/PyGithub","full_name":"BeaverSoftware/PyGithub"},"user":{"url":"https://api.github.com/users/BeaverSoftware","gravatar_id":"d563e337cac2fdc644e2aaaad1e23266","login":"BeaverSoftware","id":1424031,"avatar_url":"https://secure.gravatar.com/avatar/d563e337cac2fdc644e2aaaad1e23266?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png"},"sha":"aff8a573a19f0a42380e1c0cbbc63b6dc719f38e"},"updated_at":"2012-05-27T10:58:41Z","issue_url":"https://github.com/jacquev6/PyGithub/issues/32","body":"","url":"https://api.github.com/repos/jacquev6/PyGithub/pulls/32","comments":0,"base":{"ref":"topic/RewriteWithGeneratedCode","label":"jacquev6:topic/RewriteWithGeneratedCode","repo":{"clone_url":"https://github.com/jacquev6/PyGithub.git","has_downloads":true,"watchers":15,"updated_at":"2012-05-27T10:54:09Z","homepage":"http://vincent-jacques.net/PyGithub","url":"https://api.github.com/repos/jacquev6/PyGithub","mirror_url":null,"has_wiki":false,"has_issues":true,"fork":false,"forks":3,"size":188,"private":false,"open_issues":17,"svn_url":"https://github.com/jacquev6/PyGithub","owner":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146,"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"name":"PyGithub","language":"Python","description":"Python library implementing the full Github API v3","ssh_url":"git@github.com:jacquev6/PyGithub.git","pushed_at":"2012-05-27T10:54:09Z","created_at":"2012-02-25T12:53:47Z","id":3544490,"git_url":"git://github.com/jacquev6/PyGithub.git","html_url":"https://github.com/jacquev6/PyGithub","full_name":"jacquev6/PyGithub"},"user":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146,"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"sha":"7ec473e793c0b63092d938707632639a41fd4369"},"number":32,"merged_by":null,"closed_at":null,"title":"Creation of a pull request from an issue is not covered by integration tests","deletions":0,"merged_at":null,"diff_url":"https://github.com/jacquev6/PyGithub/pull/32.diff","additions":0,"_links":{"self":{"href":"https://api.github.com/repos/jacquev6/PyGithub/pulls/32"},"comments":{"href":"https://api.github.com/repos/jacquev6/PyGithub/issues/32/comments"},"issue":{"href":"https://api.github.com/repos/jacquev6/PyGithub/issues/32"},"html":{"href":"https://github.com/jacquev6/PyGithub/pull/32"},"review_comments":{"href":"https://api.github.com/repos/jacquev6/PyGithub/pulls/32/comments"}},"created_at":"2012-05-27T10:58:41Z","user":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146,"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"state":"open","id":1436310,"review_comments":0,"commits":1,"changed_files":0,"html_url":"https://github.com/jacquev6/PyGithub/pull/32"} diff --git a/github/tests/ReplayData/Repository.testEditWithAllArguments.txt b/github/tests/ReplayData/Repository.testEditWithAllArguments.txt index 9c0d0862..509906c3 100644 --- a/github/tests/ReplayData/Repository.testEditWithAllArguments.txt +++ b/github/tests/ReplayData/Repository.testEditWithAllArguments.txt @@ -1,9 +1,9 @@ -https PATCH api.github.com None /repos/jacquev6/PyGithub {'Authorization': 'Basic login_and_password_removed'} {"has_wiki": false, "name": "PyGithub", "has_downloads": true, "has_issues": true, "homepage": "http://vincent-jacques.net/PyGithub", "public": true, "description": "Description edited by PyGithub"} +https PATCH api.github.com None /repos/jacquev6/PyGithub {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"has_wiki": false, "name": "PyGithub", "has_downloads": true, "has_issues": true, "homepage": "http://vincent-jacques.net/PyGithub", "public": true, "description": "Description edited by PyGithub"} 200 [('status', '200 OK'), ('x-ratelimit-remaining', '4953'), ('content-length', '1109'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"749313ec2d171323deb61f9f4c85e84f"'), ('date', 'Sat, 26 May 2012 11:22:13 GMT'), ('content-type', 'application/json; charset=utf-8')] {"clone_url":"https://github.com/jacquev6/PyGithub.git","has_downloads":true,"watchers":13,"updated_at":"2012-05-26T11:22:13Z","permissions":{"pull":true,"admin":true,"push":true},"homepage":"http://vincent-jacques.net/PyGithub","url":"https://api.github.com/repos/jacquev6/PyGithub","has_wiki":false,"has_issues":true,"fork":false,"forks":2,"size":412,"git_url":"git://github.com/jacquev6/PyGithub.git","private":false,"open_issues":16,"mirror_url":null,"svn_url":"https://github.com/jacquev6/PyGithub","owner":{"url":"https://api.github.com/users/jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146},"name":"PyGithub","language":"Python","description":"Description edited by PyGithub","ssh_url":"git@github.com:jacquev6/PyGithub.git","pushed_at":"2012-05-26T10:01:38Z","created_at":"2012-02-25T12:53:47Z","id":3544490,"html_url":"https://github.com/jacquev6/PyGithub","full_name":"jacquev6/PyGithub"} -https PATCH api.github.com None /repos/jacquev6/PyGithub {'Authorization': 'Basic login_and_password_removed'} {"name": "PyGithub", "description": "Python library implementing the full Github API v3"} +https PATCH api.github.com None /repos/jacquev6/PyGithub {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"name": "PyGithub", "description": "Python library implementing the full Github API v3"} 200 [('status', '200 OK'), ('x-ratelimit-remaining', '4952'), ('content-length', '1129'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"c1328d95af7d85267acb5754968b2c0b"'), ('date', 'Sat, 26 May 2012 11:22:13 GMT'), ('content-type', 'application/json; charset=utf-8')] {"clone_url":"https://github.com/jacquev6/PyGithub.git","has_downloads":true,"watchers":13,"updated_at":"2012-05-26T11:22:13Z","permissions":{"pull":true,"admin":true,"push":true},"homepage":"http://vincent-jacques.net/PyGithub","url":"https://api.github.com/repos/jacquev6/PyGithub","mirror_url":null,"has_wiki":false,"has_issues":true,"fork":false,"forks":2,"size":412,"private":false,"open_issues":16,"svn_url":"https://github.com/jacquev6/PyGithub","owner":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146,"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"name":"PyGithub","language":"Python","description":"Python library implementing the full Github API v3","ssh_url":"git@github.com:jacquev6/PyGithub.git","pushed_at":"2012-05-26T10:01:38Z","created_at":"2012-02-25T12:53:47Z","id":3544490,"git_url":"git://github.com/jacquev6/PyGithub.git","html_url":"https://github.com/jacquev6/PyGithub","full_name":"jacquev6/PyGithub"} diff --git a/github/tests/ReplayData/Repository.testEditWithoutArguments.txt b/github/tests/ReplayData/Repository.testEditWithoutArguments.txt index 2c5a36db..6387b110 100644 --- a/github/tests/ReplayData/Repository.testEditWithoutArguments.txt +++ b/github/tests/ReplayData/Repository.testEditWithoutArguments.txt @@ -1,4 +1,4 @@ -https PATCH api.github.com None /repos/jacquev6/PyGithub {'Authorization': 'Basic login_and_password_removed'} {"name": "PyGithub"} +https PATCH api.github.com None /repos/jacquev6/PyGithub {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"name": "PyGithub"} 200 [('status', '200 OK'), ('x-ratelimit-remaining', '4956'), ('content-length', '1129'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"97977b426859a02f4d2a3fa4764b1a8e"'), ('date', 'Sat, 26 May 2012 11:21:43 GMT'), ('content-type', 'application/json; charset=utf-8')] {"description":"Python library implementing the full Github API v3","full_name":"jacquev6/PyGithub","has_wiki":false,"has_issues":true,"updated_at":"2012-05-26T10:01:38Z","forks":2,"mirror_url":null,"homepage":"http://vincent-jacques.net/PyGithub","ssh_url":"git@github.com:jacquev6/PyGithub.git","open_issues":16,"fork":false,"svn_url":"https://github.com/jacquev6/PyGithub","pushed_at":"2012-05-26T10:01:38Z","size":412,"html_url":"https://github.com/jacquev6/PyGithub","private":false,"url":"https://api.github.com/repos/jacquev6/PyGithub","clone_url":"https://github.com/jacquev6/PyGithub.git","owner":{"gravatar_id":"b68de5ae38616c296fa345d2b9df2225","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/jacquev6","login":"jacquev6","id":327146},"name":"PyGithub","has_downloads":true,"language":"Python","watchers":13,"git_url":"git://github.com/jacquev6/PyGithub.git","id":3544490,"permissions":{"admin":true,"pull":true,"push":true},"created_at":"2012-02-25T12:53:47Z"} diff --git a/github/tests/ReplayData/Repository.testMergeWithConflict.txt b/github/tests/ReplayData/Repository.testMergeWithConflict.txt index 8ae52174..b4515e25 100644 --- a/github/tests/ReplayData/Repository.testMergeWithConflict.txt +++ b/github/tests/ReplayData/Repository.testMergeWithConflict.txt @@ -1,4 +1,4 @@ -https POST api.github.com None /repos/jacquev6/PyGithub/merges {'Authorization': 'Basic login_and_password_removed'} {"head": "branchForHead", "base": "branchForBase"} +https POST api.github.com None /repos/jacquev6/PyGithub/merges {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"head": "branchForHead", "base": "branchForBase"} 409 [('status', '409 Conflict'), ('content-length', '28'), ('x-github-media-type', 'github.beta; format=json'), ('x-content-type-options', 'nosniff'), ('x-ratelimit-remaining', '4980'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('cache-control', ''), ('date', 'Sat, 08 Sep 2012 12:29:28 GMT'), ('content-type', 'application/json; charset=utf-8')] {"message":"Merge conflict"} diff --git a/github/tests/ReplayData/Repository.testMergeWithMessage.txt b/github/tests/ReplayData/Repository.testMergeWithMessage.txt index 9420c78c..ff0e02ca 100644 --- a/github/tests/ReplayData/Repository.testMergeWithMessage.txt +++ b/github/tests/ReplayData/Repository.testMergeWithMessage.txt @@ -1,4 +1,4 @@ -https POST api.github.com None /repos/jacquev6/PyGithub/merges {'Authorization': 'Basic login_and_password_removed'} {"commit_message": "Commit message created by PyGithub", "head": "branchForHead", "base": "branchForBase"} +https POST api.github.com None /repos/jacquev6/PyGithub/merges {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"commit_message": "Commit message created by PyGithub", "head": "branchForHead", "base": "branchForBase"} 201 [('status', '201 Created'), ('x-ratelimit-remaining', '4988'), ('x-github-media-type', 'github.beta; format=json'), ('x-content-type-options', 'nosniff'), ('x-ratelimit-limit', '5000'), ('content-length', '1670'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('etag', '"f31a393604d4a8295a461319eb518495"'), ('location', 'https://api.github.com/repos/jacquev6/PyGithub/commits/231ab813ab5ccbdc102ee12e663c491794ccc32f'), ('cache-control', 'max-age=0, private, must-revalidate'), ('date', 'Sat, 08 Sep 2012 12:21:08 GMT'), ('content-type', 'application/json; charset=utf-8')] {"sha":"231ab813ab5ccbdc102ee12e663c491794ccc32f","author":{"gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","url":"https://api.github.com/users/jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png","id":327146},"commit":{"message":"Commit message created by PyGithub","author":{"email":"vincent@vincent-jacques.net","name":"Vincent Jacques","date":"2012-09-08T05:21:08-07:00"},"comment_count":0,"url":"https://api.github.com/repos/jacquev6/PyGithub/git/commits/231ab813ab5ccbdc102ee12e663c491794ccc32f","tree":{"sha":"97223b0c33ab29dd9aa038248dc982354f7d69a1","url":"https://api.github.com/repos/jacquev6/PyGithub/git/trees/97223b0c33ab29dd9aa038248dc982354f7d69a1"},"committer":{"email":"vincent@vincent-jacques.net","name":"Vincent Jacques","date":"2012-09-08T05:21:08-07:00"}},"url":"https://api.github.com/repos/jacquev6/PyGithub/commits/231ab813ab5ccbdc102ee12e663c491794ccc32f","parents":[{"sha":"3be2e82b400f3398c05b68f00a4427604e74c7c5","url":"https://api.github.com/repos/jacquev6/PyGithub/commits/3be2e82b400f3398c05b68f00a4427604e74c7c5"},{"sha":"7a19732ca92cd80fd9da31fa590d67729d6b44df","url":"https://api.github.com/repos/jacquev6/PyGithub/commits/7a19732ca92cd80fd9da31fa590d67729d6b44df"}],"committer":{"gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","url":"https://api.github.com/users/jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png","id":327146}} diff --git a/github/tests/ReplayData/Repository.testMergeWithNothingToDo.txt b/github/tests/ReplayData/Repository.testMergeWithNothingToDo.txt index 977cae04..0f11312a 100644 --- a/github/tests/ReplayData/Repository.testMergeWithNothingToDo.txt +++ b/github/tests/ReplayData/Repository.testMergeWithNothingToDo.txt @@ -1,4 +1,4 @@ -https POST api.github.com None /repos/jacquev6/PyGithub/merges {'Authorization': 'Basic login_and_password_removed'} {"commit_message": "Commit message created by PyGithub", "head": "branchForHead", "base": "branchForBase"} +https POST api.github.com None /repos/jacquev6/PyGithub/merges {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"commit_message": "Commit message created by PyGithub", "head": "branchForHead", "base": "branchForBase"} 204 [('status', '204 No Content'), ('x-ratelimit-remaining', '4985'), ('x-github-media-type', 'github.beta; format=json'), ('x-content-type-options', 'nosniff'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('cache-control', ''), ('date', 'Sat, 08 Sep 2012 12:22:53 GMT')] diff --git a/github/tests/ReplayData/Repository.testMergeWithoutMessage.txt b/github/tests/ReplayData/Repository.testMergeWithoutMessage.txt index 94b604ec..64c0a548 100644 --- a/github/tests/ReplayData/Repository.testMergeWithoutMessage.txt +++ b/github/tests/ReplayData/Repository.testMergeWithoutMessage.txt @@ -1,4 +1,4 @@ -https POST api.github.com None /repos/jacquev6/PyGithub/merges {'Authorization': 'Basic login_and_password_removed'} {"head": "branchForHead", "base": "branchForBase"} +https POST api.github.com None /repos/jacquev6/PyGithub/merges {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"head": "branchForHead", "base": "branchForBase"} 201 [('status', '201 Created'), ('x-ratelimit-remaining', '4991'), ('x-ratelimit-limit', '5000'), ('x-content-type-options', 'nosniff'), ('content-length', '1674'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('etag', '"9a4000ce96f4c4d47922c7c8896d894f"'), ('location', 'https://api.github.com/repos/jacquev6/PyGithub/commits/a01fa060858e3aced1fe4ad74798295376e76fd4'), ('cache-control', 'max-age=0, private, must-revalidate'), ('date', 'Sat, 08 Sep 2012 12:19:40 GMT'), ('x-github-media-type', 'github.beta; format=json'), ('content-type', 'application/json; charset=utf-8')] {"sha":"a01fa060858e3aced1fe4ad74798295376e76fd4","committer":{"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","url":"https://api.github.com/users/jacquev6","login":"jacquev6","id":327146},"author":{"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","url":"https://api.github.com/users/jacquev6","login":"jacquev6","id":327146},"parents":[{"sha":"3be2e82b400f3398c05b68f00a4427604e74c7c5","url":"https://api.github.com/repos/jacquev6/PyGithub/commits/3be2e82b400f3398c05b68f00a4427604e74c7c5"},{"sha":"7a19732ca92cd80fd9da31fa590d67729d6b44df","url":"https://api.github.com/repos/jacquev6/PyGithub/commits/7a19732ca92cd80fd9da31fa590d67729d6b44df"}],"url":"https://api.github.com/repos/jacquev6/PyGithub/commits/a01fa060858e3aced1fe4ad74798295376e76fd4","commit":{"committer":{"email":"vincent@vincent-jacques.net","date":"2012-09-08T05:19:40-07:00","name":"Vincent Jacques"},"author":{"email":"vincent@vincent-jacques.net","date":"2012-09-08T05:19:40-07:00","name":"Vincent Jacques"},"message":"Merge branchForHead into branchForBase","tree":{"sha":"97223b0c33ab29dd9aa038248dc982354f7d69a1","url":"https://api.github.com/repos/jacquev6/PyGithub/git/trees/97223b0c33ab29dd9aa038248dc982354f7d69a1"},"url":"https://api.github.com/repos/jacquev6/PyGithub/git/commits/a01fa060858e3aced1fe4ad74798295376e76fd4","comment_count":0}} diff --git a/github/tests/ReplayData/RepositoryKey.testEdit.txt b/github/tests/ReplayData/RepositoryKey.testEdit.txt index e9332172..7794f464 100644 --- a/github/tests/ReplayData/RepositoryKey.testEdit.txt +++ b/github/tests/ReplayData/RepositoryKey.testEdit.txt @@ -1,4 +1,4 @@ -https PATCH api.github.com None /repos/jacquev6/PyGithub/keys/2626761 {'Authorization': 'Basic login_and_password_removed'} {"key": "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA5Q58YmzZjU64prR5Pk91MfeHezOTgLqDYmepYbv3qjguiHtPai1vSai5WvUv3hgf9DArXsXE5CV6yoBIhAdGtpJKExHuQ2m4XTFCdbrgfQ3ypcSdgzEiQemyTA6TWwhbuwjJ1IqJMYOVLH+FBCkD8pyIpUDO7v3vaR2TCEuNwOS7lbsRsW3OkGYnUKjaPaCTe/inrqb7I3OE8cPhWJ3dM/zzzBj22J4LCNKhjKua8TFS74xGm3lNDZ6/twQl4n4xmrH/3tG+WOJicNO3JohNHqK9T0pILnr3epEyfdkBjcG0qXApqWvH2WipJhaH6of8Gdr0Z/K/7p8QFddmwNgdPQ==", "title": "Title edited by PyGithub"} +https PATCH api.github.com None /repos/jacquev6/PyGithub/keys/2626761 {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"key": "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA5Q58YmzZjU64prR5Pk91MfeHezOTgLqDYmepYbv3qjguiHtPai1vSai5WvUv3hgf9DArXsXE5CV6yoBIhAdGtpJKExHuQ2m4XTFCdbrgfQ3ypcSdgzEiQemyTA6TWwhbuwjJ1IqJMYOVLH+FBCkD8pyIpUDO7v3vaR2TCEuNwOS7lbsRsW3OkGYnUKjaPaCTe/inrqb7I3OE8cPhWJ3dM/zzzBj22J4LCNKhjKua8TFS74xGm3lNDZ6/twQl4n4xmrH/3tG+WOJicNO3JohNHqK9T0pILnr3epEyfdkBjcG0qXApqWvH2WipJhaH6of8Gdr0Z/K/7p8QFddmwNgdPQ==", "title": "Title edited by PyGithub"} 200 [('status', '200 OK'), ('x-ratelimit-remaining', '4989'), ('content-length', '503'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"0e3fe92d1dde4f1bca0df384528bf1e2"'), ('date', 'Sun, 27 May 2012 11:06:26 GMT'), ('content-type', 'application/json; charset=utf-8')] {"url":"https://api.github.com/user/keys/2626761","verified":true,"key":"ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA5Q58YmzZjU64prR5Pk91MfeHezOTgLqDYmepYbv3qjguiHtPai1vSai5WvUv3hgf9DArXsXE5CV6yoBIhAdGtpJKExHuQ2m4XTFCdbrgfQ3ypcSdgzEiQemyTA6TWwhbuwjJ1IqJMYOVLH+FBCkD8pyIpUDO7v3vaR2TCEuNwOS7lbsRsW3OkGYnUKjaPaCTe/inrqb7I3OE8cPhWJ3dM/zzzBj22J4LCNKhjKua8TFS74xGm3lNDZ6/twQl4n4xmrH/3tG+WOJicNO3JohNHqK9T0pILnr3epEyfdkBjcG0qXApqWvH2WipJhaH6of8Gdr0Z/K/7p8QFddmwNgdPQ==","title":"Title edited by PyGithub","id":2626761} diff --git a/github/tests/ReplayData/RepositoryKey.testEditWithoutParameters.txt b/github/tests/ReplayData/RepositoryKey.testEditWithoutParameters.txt index 90e79296..86c9806a 100644 --- a/github/tests/ReplayData/RepositoryKey.testEditWithoutParameters.txt +++ b/github/tests/ReplayData/RepositoryKey.testEditWithoutParameters.txt @@ -1,4 +1,4 @@ -https PATCH api.github.com None /repos/jacquev6/PyGithub/keys/2626761 {'Authorization': 'Basic login_and_password_removed'} {} +https PATCH api.github.com None /repos/jacquev6/PyGithub/keys/2626761 {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {} 200 [('status', '200 OK'), ('x-ratelimit-remaining', '4985'), ('content-length', '503'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"ee6bf384c86aa3147ffa7fcde628072e"'), ('date', 'Sun, 27 May 2012 11:07:43 GMT'), ('content-type', 'application/json; charset=utf-8')] {"url":"https://api.github.com/user/keys/2626761","key":"ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA5Q58YmzZjU64prR5Pk91MfeHezOTgLqDYmepYbv3qjguiHtPai1vSai5WvUv3hgf9DArXsXE5CV6yoBIhAdGtpJKExHuQ2m4XTFCdbrgfQ3ypcSdgzEiQemyTA6TWwhbuwjJ1IqJMYOVLH+FBCkD8pyIpUDO7v3vaR2TCEuNwOS7lbsRsW3OkGYnUKjaPaCTe/inrqb7I3OE8cPhWJ3dM/zzzBj22J4LCNKhjKua8TFS74xGm3lNDZ6/twQl4n4xmrH/3tG+WOJicNO3JohNHqK9T0pILnr3epEyfdkBjcG0qXApqWvH2WipJhaH6of8Gdr0Z/K/7p8QFddmwNgdPQ==","verified":true,"title":"Title edited by PyGithub","id":2626761} diff --git a/github/tests/ReplayData/Team.testEditWithAllArguments.txt b/github/tests/ReplayData/Team.testEditWithAllArguments.txt index a416132b..6a9946e8 100644 --- a/github/tests/ReplayData/Team.testEditWithAllArguments.txt +++ b/github/tests/ReplayData/Team.testEditWithAllArguments.txt @@ -1,4 +1,4 @@ -https PATCH api.github.com None /teams/189850 {'Authorization': 'Basic login_and_password_removed'} {"name": "Name edited twice by PyGithub", "permission": "admin"} +https PATCH api.github.com None /teams/189850 {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"name": "Name edited twice by PyGithub", "permission": "admin"} 200 [('status', '200 OK'), ('x-ratelimit-remaining', '4949'), ('content-length', '151'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"8856425cedbdf3075576e823f39fc3d6"'), ('date', 'Sat, 26 May 2012 21:14:46 GMT'), ('content-type', 'application/json; charset=utf-8')] {"permission":"admin","members_count":0,"url":"https://api.github.com/teams/189850","repos_count":0,"name":"Name edited twice by PyGithub","id":189850} diff --git a/github/tests/ReplayData/Team.testEditWithoutArguments.txt b/github/tests/ReplayData/Team.testEditWithoutArguments.txt index 413e5cd0..80d3d39f 100644 --- a/github/tests/ReplayData/Team.testEditWithoutArguments.txt +++ b/github/tests/ReplayData/Team.testEditWithoutArguments.txt @@ -1,4 +1,4 @@ -https PATCH api.github.com None /teams/189850 {'Authorization': 'Basic login_and_password_removed'} {"name": "Name edited by PyGithub"} +https PATCH api.github.com None /teams/189850 {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"name": "Name edited by PyGithub"} 200 [('status', '200 OK'), ('x-ratelimit-remaining', '4952'), ('content-length', '144'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"843001aba6d35f27320c0788c9ff64b1"'), ('date', 'Sat, 26 May 2012 21:14:39 GMT'), ('content-type', 'application/json; charset=utf-8')] {"permission":"pull","members_count":0,"url":"https://api.github.com/teams/189850","repos_count":0,"name":"Name edited by PyGithub","id":189850} diff --git a/github/tests/ReplayData/UserKey.testEditWithAllArguments.txt b/github/tests/ReplayData/UserKey.testEditWithAllArguments.txt index 61a50779..f8653d87 100644 --- a/github/tests/ReplayData/UserKey.testEditWithAllArguments.txt +++ b/github/tests/ReplayData/UserKey.testEditWithAllArguments.txt @@ -1,4 +1,4 @@ -https PATCH api.github.com None /user/keys/2626650 {'Authorization': 'Basic login_and_password_removed'} {"key": "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA5Q58YmzZjU64prR5Pk91MfeHezOTgLqDYmepYbv3qjguiHtPai1vSai5WvUv3hgf9DArXsXE5CV6yoBIhAdGtpJKExHuQ2m4XTFCdbrgfQ3ypcSdgzEiQemyTA6TWwhbuwjJ1IqJMYOVLH+FBCkD8pyIpUDO7v3vaR2TCEuNwOS7lbsRsW3OkGYnUKjaPaCTe/inrqb7I3OE8cPhWJ3dM/zzzBj22J4LCNKhjKua8TFS74xGm3lNDZ6/twQl4n4xmrH/3tG+WOJicNO3JohNHqK9T0pILnr3epEyfdkBjcG0qXApqWvH2WipJhaH6of8Gdr0Z/K/7p8QFddmwNgdPQ==", "title": "Title edited by PyGithub"} +https PATCH api.github.com None /user/keys/2626650 {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"key": "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA5Q58YmzZjU64prR5Pk91MfeHezOTgLqDYmepYbv3qjguiHtPai1vSai5WvUv3hgf9DArXsXE5CV6yoBIhAdGtpJKExHuQ2m4XTFCdbrgfQ3ypcSdgzEiQemyTA6TWwhbuwjJ1IqJMYOVLH+FBCkD8pyIpUDO7v3vaR2TCEuNwOS7lbsRsW3OkGYnUKjaPaCTe/inrqb7I3OE8cPhWJ3dM/zzzBj22J4LCNKhjKua8TFS74xGm3lNDZ6/twQl4n4xmrH/3tG+WOJicNO3JohNHqK9T0pILnr3epEyfdkBjcG0qXApqWvH2WipJhaH6of8Gdr0Z/K/7p8QFddmwNgdPQ==", "title": "Title edited by PyGithub"} 200 [('status', '200 OK'), ('x-ratelimit-remaining', '4979'), ('content-length', '503'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"b3e0d8e43865724d6f36f15753984816"'), ('date', 'Sat, 26 May 2012 19:57:25 GMT'), ('content-type', 'application/json; charset=utf-8')] {"url":"https://api.github.com/user/keys/2626650","verified":true,"key":"ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA5Q58YmzZjU64prR5Pk91MfeHezOTgLqDYmepYbv3qjguiHtPai1vSai5WvUv3hgf9DArXsXE5CV6yoBIhAdGtpJKExHuQ2m4XTFCdbrgfQ3ypcSdgzEiQemyTA6TWwhbuwjJ1IqJMYOVLH+FBCkD8pyIpUDO7v3vaR2TCEuNwOS7lbsRsW3OkGYnUKjaPaCTe/inrqb7I3OE8cPhWJ3dM/zzzBj22J4LCNKhjKua8TFS74xGm3lNDZ6/twQl4n4xmrH/3tG+WOJicNO3JohNHqK9T0pILnr3epEyfdkBjcG0qXApqWvH2WipJhaH6of8Gdr0Z/K/7p8QFddmwNgdPQ==","title":"Title edited by PyGithub","id":2626650} diff --git a/github/tests/ReplayData/UserKey.testEditWithoutArguments.txt b/github/tests/ReplayData/UserKey.testEditWithoutArguments.txt index 17f92822..d0a3a5de 100644 --- a/github/tests/ReplayData/UserKey.testEditWithoutArguments.txt +++ b/github/tests/ReplayData/UserKey.testEditWithoutArguments.txt @@ -1,4 +1,4 @@ -https PATCH api.github.com None /user/keys/2626650 {'Authorization': 'Basic login_and_password_removed'} {} +https PATCH api.github.com None /user/keys/2626650 {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {} 200 [('status', '200 OK'), ('x-ratelimit-remaining', '4981'), ('content-length', '505'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"7261ec55c886d6bf42e48d5bf9544586"'), ('date', 'Sat, 26 May 2012 19:57:18 GMT'), ('content-type', 'application/json; charset=utf-8')] {"url":"https://api.github.com/user/keys/2626650","key":"ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA2Mm0RjTNAYFfSCtUpO54usdseroUSIYg5KX4JoseTpqyiB/hqewjYLAdUq/tNIQzrkoEJWSyZrQt0ma7/YCyMYuNGd3DU6q6ZAyBeY3E9RyCiKjO3aTL2VKQGFvBVVmGdxGVSCITRphAcsKc/PF35/fg9XP9S0anMXcEFtdfMHz41SSw+XtE+Vc+6cX9FuI5qUfLGbkv8L1v3g4uw9VXlzq4GfTA+1S7D6mcoGHopAIXFlVr+2RfDKdSURMcB22z41fljO1MW4+zUS/4FyUTpL991es5fcwKXYoiE+x06VJeJJ1Krwx+DZj45uweV6cHXt2JwJEI9fWB6WyBlDejWw==","verified":true,"title":"Key added through PyGithub","id":2626650} From a13ce33beb005802fb433724db3ef959259e9b6b Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Tue, 25 Sep 2012 22:56:43 +0200 Subject: [PATCH 14/62] Improve logging (related to #88) --- github/Logging.py | 5 --- github/Requester.py | 32 ++++++++++++------- github/__init__.py | 8 ++++- github/tests/Logging.py | 30 ++++++++++++----- .../Logging.testLoggingWithBaseUrl.txt | 5 +++ ...ng.testLoggingWithBasicAuthentication.txt} | 0 ...ing.testLoggingWithOAuthAuthentication.txt | 5 +++ ...gging.testLoggingWithoutAuthentication.txt | 5 +++ 8 files changed, 64 insertions(+), 26 deletions(-) delete mode 100644 github/Logging.py create mode 100644 github/tests/ReplayData/Logging.testLoggingWithBaseUrl.txt rename github/tests/ReplayData/{Logging.testLogging.txt => Logging.testLoggingWithBasicAuthentication.txt} (100%) create mode 100644 github/tests/ReplayData/Logging.testLoggingWithOAuthAuthentication.txt create mode 100644 github/tests/ReplayData/Logging.testLoggingWithoutAuthentication.txt diff --git a/github/Logging.py b/github/Logging.py deleted file mode 100644 index 284ccba5..00000000 --- a/github/Logging.py +++ /dev/null @@ -1,5 +0,0 @@ -import logging - - -def get_logger(): - return logging.getLogger('github') diff --git a/github/Requester.py b/github/Requester.py index a97ff019..aad22e57 100644 --- a/github/Requester.py +++ b/github/Requester.py @@ -26,7 +26,6 @@ else: # pragma no cover import simplejson as json # pragma no cover import GithubException -import Logging class Requester: @@ -86,12 +85,13 @@ class Requester: url = o.path if o.query != "": url += "?" + o.query + url = self.__completeUrl(url, parameters) - headers = dict() + requestHeaders = dict() if input is not None: - headers["Content-Type"] = "application/json" + requestHeaders["Content-Type"] = "application/json" if self.__authorizationHeader is not None: - headers["Authorization"] = self.__authorizationHeader + requestHeaders["Authorization"] = self.__authorizationHeader if atLeastPython26: cnx = self.__connectionClass(host=self.__hostname, port=self.__port, strict=True, timeout=self.__timeout) @@ -99,25 +99,33 @@ class Requester: cnx = self.__connectionClass(host=self.__hostname, port=self.__port, strict=True) # pragma no cover cnx.request( verb, - self.__completeUrl(url, parameters), + url, json.dumps(input), - headers + requestHeaders ) response = cnx.getresponse() status = response.status - headers = dict(response.getheaders()) + responseHeaders = dict(response.getheaders()) output = response.read() cnx.close() - if "x-ratelimit-remaining" in headers and "x-ratelimit-limit" in headers: - self.rate_limiting = (int(headers["x-ratelimit-remaining"]), int(headers["x-ratelimit-limit"])) + if "x-ratelimit-remaining" in responseHeaders and "x-ratelimit-limit" in responseHeaders: + self.rate_limiting = (int(responseHeaders["x-ratelimit-remaining"]), int(responseHeaders["x-ratelimit-limit"])) - logger = Logging.get_logger() + logger = logging.getLogger(__name__) if logger.isEnabledFor(logging.DEBUG): - logger.debug(' '.join(map(str, [verb, self.__base_url + url, parameters, input, "==>", status, str(headers), str(output)]))) - return status, headers, output + if "Authorization" in requestHeaders: + if requestHeaders["Authorization"].startswith("Basic"): + requestHeaders["Authorization"] = "Basic (login and password removed)" + elif requestHeaders["Authorization"].startswith("token"): + requestHeaders["Authorization"] = "token (oauth token removed)" + else: + requestHeaders["Authorization"] = "Unknown authorization removed" + logger.debug("%s %s://%s%s %s %s ==> %i %s %s", str(verb), self.__scheme, self.__hostname, str(url), str(requestHeaders), str(input), status, str(responseHeaders), str(output)) + + return status, responseHeaders, output def __completeUrl(self, url, parameters): if parameters is None or len(parameters) == 0: diff --git a/github/__init__.py b/github/__init__.py index 91c2954c..02437110 100644 --- a/github/__init__.py +++ b/github/__init__.py @@ -11,9 +11,15 @@ # You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see . +import logging + from Github import Github from GithubException import GithubException from InputFileContent import InputFileContent from InputGitAuthor import InputGitAuthor from InputGitTreeElement import InputGitTreeElement -from Logging import get_logger + +def enable_console_debug_logging(): + logger = logging.getLogger("github") + logger.setLevel(logging.DEBUG) + logger.addHandler(logging.StreamHandler()) diff --git a/github/tests/Logging.py b/github/tests/Logging.py index f5ae745a..f0c09e87 100644 --- a/github/tests/Logging.py +++ b/github/tests/Logging.py @@ -18,7 +18,7 @@ import github import Framework -class Logging(Framework.TestCase): +class Logging(Framework.BasicTestCase): class MockHandler: def __init__(self): self.level = logging.DEBUG @@ -27,12 +27,26 @@ class Logging(Framework.TestCase): def handle(self, record): self.handled = record.getMessage() - def testLogging(self): - self.maxDiff = None - logger = github.get_logger() + def setUp( self ): + Framework.BasicTestCase.setUp(self) + logger = logging.getLogger("github") logger.setLevel(logging.DEBUG) - handler = self.MockHandler() - logger.addHandler(handler) + self.__handler = self.MockHandler() + logger.addHandler(self.__handler) - self.assertEqual(self.g.get_user().name, "Vincent Jacques") - self.assertEqual(handler.handled, u'GET https://api.github.com/user None None ==> 200 {\'status\': \'200 OK\', \'content-length\': \'806\', \'x-github-media-type\': \'github.beta; format=json\', \'x-content-type-options\': \'nosniff\', \'vary\': \'Accept, Authorization, Cookie\', \'x-ratelimit-remaining\': \'4993\', \'server\': \'nginx\', \'last-modified\': \'Fri, 14 Sep 2012 18:47:46 GMT\', \'connection\': \'keep-alive\', \'x-ratelimit-limit\': \'5000\', \'etag\': \'"434dfe5d3f50558fe3cea087cb95c401"\', \'cache-control\': \'private, s-maxage=60, max-age=60\', \'date\': \'Mon, 17 Sep 2012 17:12:32 GMT\', \'content-type\': \'application/json; charset=utf-8\'} {"owned_private_repos":3,"disk_usage":18612,"following":28,"type":"User","public_repos":13,"location":"Paris, France","company":"Criteo","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png","plan":{"space":614400,"private_repos":5,"name":"micro","collaborators":1},"blog":"http://vincent-jacques.net","login":"jacquev6","public_gists":3,"html_url":"https://github.com/jacquev6","hireable":false,"created_at":"2010-07-09T06:10:06Z","private_gists":5,"followers":13,"name":"Vincent Jacques","email":"vincent@vincent-jacques.net","bio":"","total_private_repos":3,"collaborators":0,"gravatar_id":"b68de5ae38616c296fa345d2b9df2225","id":327146,"url":"https://api.github.com/users/jacquev6"}') + def testLoggingWithBasicAuthentication(self): + self.assertEqual(github.Github(self.login, self.password).get_user().name, "Vincent Jacques") + self.assertEqual(self.__handler.handled, u'GET https://api.github.com/user {\'Authorization\': \'Basic (login and password removed)\'} None ==> 200 {\'status\': \'200 OK\', \'content-length\': \'806\', \'x-github-media-type\': \'github.beta; format=json\', \'x-content-type-options\': \'nosniff\', \'vary\': \'Accept, Authorization, Cookie\', \'x-ratelimit-remaining\': \'4993\', \'server\': \'nginx\', \'last-modified\': \'Fri, 14 Sep 2012 18:47:46 GMT\', \'connection\': \'keep-alive\', \'x-ratelimit-limit\': \'5000\', \'etag\': \'"434dfe5d3f50558fe3cea087cb95c401"\', \'cache-control\': \'private, s-maxage=60, max-age=60\', \'date\': \'Mon, 17 Sep 2012 17:12:32 GMT\', \'content-type\': \'application/json; charset=utf-8\'} {"owned_private_repos":3,"disk_usage":18612,"following":28,"type":"User","public_repos":13,"location":"Paris, France","company":"Criteo","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png","plan":{"space":614400,"private_repos":5,"name":"micro","collaborators":1},"blog":"http://vincent-jacques.net","login":"jacquev6","public_gists":3,"html_url":"https://github.com/jacquev6","hireable":false,"created_at":"2010-07-09T06:10:06Z","private_gists":5,"followers":13,"name":"Vincent Jacques","email":"vincent@vincent-jacques.net","bio":"","total_private_repos":3,"collaborators":0,"gravatar_id":"b68de5ae38616c296fa345d2b9df2225","id":327146,"url":"https://api.github.com/users/jacquev6"}') + + def testLoggingWithOAuthAuthentication(self): + self.assertEqual(github.Github(self.oauth_token).get_user().name, "Vincent Jacques") + self.assertEqual(self.__handler.handled, u'GET https://api.github.com/user {\'Authorization\': \'token (oauth token removed)\'} None ==> 200 {\'status\': \'200 OK\', \'x-ratelimit-remaining\': \'4993\', \'x-github-media-type\': \'github.beta; format=json\', \'x-content-type-options\': \'nosniff\', \'vary\': \'Accept, Authorization, Cookie\', \'content-length\': \'628\', \'server\': \'nginx\', \'last-modified\': \'Tue, 25 Sep 2012 07:42:42 GMT\', \'connection\': \'keep-alive\', \'x-ratelimit-limit\': \'5000\', \'etag\': \'"c23ad6b5815fc3d6ec6341c4a47afe85"\', \'cache-control\': \'private, max-age=60, s-maxage=60\', \'date\': \'Tue, 25 Sep 2012 20:36:54 GMT\', \'x-oauth-scopes\': \'\', \'content-type\': \'application/json; charset=utf-8\', \'x-accepted-oauth-scopes\': \'user\'} {"type":"User","bio":"","html_url":"https://github.com/jacquev6","login":"jacquev6","followers":14,"company":"Criteo","blog":"http://vincent-jacques.net","public_repos":13,"created_at":"2010-07-09T06:10:06Z","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png","email":"vincent@vincent-jacques.net","following":29,"name":"Vincent Jacques","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","hireable":false,"id":327146,"public_gists":3,"location":"Paris, France","url":"https://api.github.com/users/jacquev6"}') + + def testLoggingWithoutAuthentication(self): + self.assertEqual(github.Github().get_user("jacquev6").name, "Vincent Jacques") + self.assertEqual(self.__handler.handled, u'GET https://api.github.com/users/jacquev6 {} None ==> 200 {\'status\': \'200 OK\', \'content-length\': \'628\', \'x-github-media-type\': \'github.beta; format=json\', \'x-content-type-options\': \'nosniff\', \'vary\': \'Accept\', \'x-ratelimit-remaining\': \'4989\', \'server\': \'nginx\', \'last-modified\': \'Tue, 25 Sep 2012 07:42:42 GMT\', \'connection\': \'keep-alive\', \'x-ratelimit-limit\': \'5000\', \'etag\': \'"9bd085221a16b6d2ea95e72634c3c1ac"\', \'cache-control\': \'public, max-age=60, s-maxage=60\', \'date\': \'Tue, 25 Sep 2012 20:38:56 GMT\', \'content-type\': \'application/json; charset=utf-8\'} {"type":"User","html_url":"https://github.com/jacquev6","login":"jacquev6","followers":14,"company":"Criteo","created_at":"2010-07-09T06:10:06Z","email":"vincent@vincent-jacques.net","hireable":false,"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png","public_gists":3,"bio":"","following":29,"name":"Vincent Jacques","blog":"http://vincent-jacques.net","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","id":327146,"public_repos":13,"location":"Paris, France","url":"https://api.github.com/users/jacquev6"}') + + def testLoggingWithBaseUrl(self): + # ReplayData forged, not recorded + self.assertEqual(github.Github(base_url = "http://my.enterprise.com/my/prefix").get_user("jacquev6").name, "Vincent Jacques") + self.assertEqual(self.__handler.handled, u'GET http://my.enterprise.com/my/prefix/users/jacquev6 {} None ==> 200 {\'status\': \'200 OK\', \'content-length\': \'628\', \'x-github-media-type\': \'github.beta; format=json\', \'x-content-type-options\': \'nosniff\', \'vary\': \'Accept\', \'x-ratelimit-remaining\': \'4989\', \'server\': \'nginx\', \'last-modified\': \'Tue, 25 Sep 2012 07:42:42 GMT\', \'connection\': \'keep-alive\', \'x-ratelimit-limit\': \'5000\', \'etag\': \'"9bd085221a16b6d2ea95e72634c3c1ac"\', \'cache-control\': \'public, max-age=60, s-maxage=60\', \'date\': \'Tue, 25 Sep 2012 20:38:56 GMT\', \'content-type\': \'application/json; charset=utf-8\'} {"type":"User","html_url":"https://github.com/jacquev6","login":"jacquev6","followers":14,"company":"Criteo","created_at":"2010-07-09T06:10:06Z","email":"vincent@vincent-jacques.net","hireable":false,"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png","public_gists":3,"bio":"","following":29,"name":"Vincent Jacques","blog":"http://vincent-jacques.net","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","id":327146,"public_repos":13,"location":"Paris, France","url":"https://api.github.com/users/jacquev6"}') diff --git a/github/tests/ReplayData/Logging.testLoggingWithBaseUrl.txt b/github/tests/ReplayData/Logging.testLoggingWithBaseUrl.txt new file mode 100644 index 00000000..863d0aad --- /dev/null +++ b/github/tests/ReplayData/Logging.testLoggingWithBaseUrl.txt @@ -0,0 +1,5 @@ +http GET my.enterprise.com None /my/prefix/users/jacquev6 {} null +200 +[('status', '200 OK'), ('content-length', '628'), ('x-github-media-type', 'github.beta; format=json'), ('x-content-type-options', 'nosniff'), ('x-ratelimit-limit', '5000'), ('vary', 'Accept'), ('x-ratelimit-remaining', '4989'), ('server', 'nginx'), ('last-modified', 'Tue, 25 Sep 2012 07:42:42 GMT'), ('connection', 'keep-alive'), ('etag', '"9bd085221a16b6d2ea95e72634c3c1ac"'), ('cache-control', 'public, max-age=60, s-maxage=60'), ('date', 'Tue, 25 Sep 2012 20:38:56 GMT'), ('content-type', 'application/json; charset=utf-8')] +{"type":"User","html_url":"https://github.com/jacquev6","login":"jacquev6","followers":14,"company":"Criteo","created_at":"2010-07-09T06:10:06Z","email":"vincent@vincent-jacques.net","hireable":false,"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png","public_gists":3,"bio":"","following":29,"name":"Vincent Jacques","blog":"http://vincent-jacques.net","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","id":327146,"public_repos":13,"location":"Paris, France","url":"https://api.github.com/users/jacquev6"} + diff --git a/github/tests/ReplayData/Logging.testLogging.txt b/github/tests/ReplayData/Logging.testLoggingWithBasicAuthentication.txt similarity index 100% rename from github/tests/ReplayData/Logging.testLogging.txt rename to github/tests/ReplayData/Logging.testLoggingWithBasicAuthentication.txt diff --git a/github/tests/ReplayData/Logging.testLoggingWithOAuthAuthentication.txt b/github/tests/ReplayData/Logging.testLoggingWithOAuthAuthentication.txt new file mode 100644 index 00000000..4a205729 --- /dev/null +++ b/github/tests/ReplayData/Logging.testLoggingWithOAuthAuthentication.txt @@ -0,0 +1,5 @@ +https GET api.github.com None /user {'Authorization': 'token private_token_removed'} null +200 +[('status', '200 OK'), ('x-ratelimit-remaining', '4993'), ('x-github-media-type', 'github.beta; format=json'), ('x-content-type-options', 'nosniff'), ('vary', 'Accept, Authorization, Cookie'), ('content-length', '628'), ('server', 'nginx'), ('last-modified', 'Tue, 25 Sep 2012 07:42:42 GMT'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"c23ad6b5815fc3d6ec6341c4a47afe85"'), ('cache-control', 'private, max-age=60, s-maxage=60'), ('date', 'Tue, 25 Sep 2012 20:36:54 GMT'), ('x-oauth-scopes', ''), ('content-type', 'application/json; charset=utf-8'), ('x-accepted-oauth-scopes', 'user')] +{"type":"User","bio":"","html_url":"https://github.com/jacquev6","login":"jacquev6","followers":14,"company":"Criteo","blog":"http://vincent-jacques.net","public_repos":13,"created_at":"2010-07-09T06:10:06Z","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png","email":"vincent@vincent-jacques.net","following":29,"name":"Vincent Jacques","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","hireable":false,"id":327146,"public_gists":3,"location":"Paris, France","url":"https://api.github.com/users/jacquev6"} + diff --git a/github/tests/ReplayData/Logging.testLoggingWithoutAuthentication.txt b/github/tests/ReplayData/Logging.testLoggingWithoutAuthentication.txt new file mode 100644 index 00000000..3d991096 --- /dev/null +++ b/github/tests/ReplayData/Logging.testLoggingWithoutAuthentication.txt @@ -0,0 +1,5 @@ +https GET api.github.com None /users/jacquev6 {} null +200 +[('status', '200 OK'), ('content-length', '628'), ('x-github-media-type', 'github.beta; format=json'), ('x-content-type-options', 'nosniff'), ('x-ratelimit-limit', '5000'), ('vary', 'Accept'), ('x-ratelimit-remaining', '4989'), ('server', 'nginx'), ('last-modified', 'Tue, 25 Sep 2012 07:42:42 GMT'), ('connection', 'keep-alive'), ('etag', '"9bd085221a16b6d2ea95e72634c3c1ac"'), ('cache-control', 'public, max-age=60, s-maxage=60'), ('date', 'Tue, 25 Sep 2012 20:38:56 GMT'), ('content-type', 'application/json; charset=utf-8')] +{"type":"User","html_url":"https://github.com/jacquev6","login":"jacquev6","followers":14,"company":"Criteo","created_at":"2010-07-09T06:10:06Z","email":"vincent@vincent-jacques.net","hireable":false,"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png","public_gists":3,"bio":"","following":29,"name":"Vincent Jacques","blog":"http://vincent-jacques.net","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","id":327146,"public_repos":13,"location":"Paris, France","url":"https://api.github.com/users/jacquev6"} + From 431d9701d70b4fbd7d8e4e33b7585bb5d32fddeb Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Tue, 25 Sep 2012 23:13:13 +0200 Subject: [PATCH 15/62] Follow pep8 --- github/__init__.py | 1 + github/tests/Gist.py | 2 +- github/tests/Issue87.py | 16 ++++++++-------- github/tests/Logging.py | 4 ++-- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/github/__init__.py b/github/__init__.py index 02437110..641c0ee5 100644 --- a/github/__init__.py +++ b/github/__init__.py @@ -19,6 +19,7 @@ from InputFileContent import InputFileContent from InputGitAuthor import InputGitAuthor from InputGitTreeElement import InputGitTreeElement + def enable_console_debug_logging(): logger = logging.getLogger("github") logger.setLevel(logging.DEBUG) diff --git a/github/tests/Gist.py b/github/tests/Gist.py index 98ba0e60..93605532 100644 --- a/github/tests/Gist.py +++ b/github/tests/Gist.py @@ -30,7 +30,7 @@ class Gist(Framework.TestCase): self.assertEquals(self.gist.files["fail_github.py"].size, 1636) self.assertEquals(self.gist.files["fail_github.py"].filename, "fail_github.py") self.assertEquals(self.gist.files["fail_github.py"].language, "Python") - self.assertEquals(self.gist.files["fail_github.py"].content, 'import httplib\nimport base64\nimport json\n\nlogin = ""\npassword = ""\norgName = ""\nrepoName = "FailGithubApi"\n\ndef doRequest( verb, url, input ):\n input = json.dumps( input )\n cnx = httplib.HTTPSConnection( "api.github.com", strict = True )\n cnx.request( verb, url, input, { "Authorization" : "Basic " + base64.b64encode( login + ":" + password ).replace( \'\\n\', \'\' ) } )\n response = cnx.getresponse()\n status = response.status\n output = response.read()\n cnx.close()\n print verb, url, input, "=>", status, output\n print\n if status < 200 or status >= 300:\n exit( 1 )\n return json.loads( output )\n\n# Create a repo\ndoRequest( "POST", "/user/repos", { "name": repoName } )\n\n# Create a blob, a tree, a commit and the master branch\nb = doRequest(\n "POST", "/repos/%s/%s/git/blobs" % ( login, repoName ),\n { "content": "Content of the blob", "encoding": "latin1" }\n)\nt = doRequest(\n "POST", "/repos/%s/%s/git/trees" % ( login, repoName ),\n { "tree" : [ { "path": "foo.bar", "type": "blob", "mode": "100644", "sha": b["sha"] } ] }\n)\nc = doRequest(\n "POST", "/repos/%s/%s/git/commits" % ( login, repoName ),\n { "parents": [], "message": "Message of the commit", "tree": t["sha"] }\n)\ndoRequest(\n "POST", "/repos/%s/%s/git/refs" % ( login, repoName ),\n { "ref": "refs/heads/master", "sha": c["sha"] }\n)\n\n# Fork the repo\ndoRequest( "POST", "/repos/%s/%s/forks?org=%s" % ( login, repoName, orgName ), None )\n\n# Create a new blob => BOOM error 500\ndoRequest(\n "POST", "/repos/%s/%s/git/blobs" % ( orgName, repoName ),\n { "content": "Content of the new blob", "encoding": "latin1" }\n)\n' ) + self.assertEquals(self.gist.files["fail_github.py"].content, 'import httplib\nimport base64\nimport json\n\nlogin = ""\npassword = ""\norgName = ""\nrepoName = "FailGithubApi"\n\ndef doRequest( verb, url, input ):\n input = json.dumps( input )\n cnx = httplib.HTTPSConnection( "api.github.com", strict = True )\n cnx.request( verb, url, input, { "Authorization" : "Basic " + base64.b64encode( login + ":" + password ).replace( \'\\n\', \'\' ) } )\n response = cnx.getresponse()\n status = response.status\n output = response.read()\n cnx.close()\n print verb, url, input, "=>", status, output\n print\n if status < 200 or status >= 300:\n exit( 1 )\n return json.loads( output )\n\n# Create a repo\ndoRequest( "POST", "/user/repos", { "name": repoName } )\n\n# Create a blob, a tree, a commit and the master branch\nb = doRequest(\n "POST", "/repos/%s/%s/git/blobs" % ( login, repoName ),\n { "content": "Content of the blob", "encoding": "latin1" }\n)\nt = doRequest(\n "POST", "/repos/%s/%s/git/trees" % ( login, repoName ),\n { "tree" : [ { "path": "foo.bar", "type": "blob", "mode": "100644", "sha": b["sha"] } ] }\n)\nc = doRequest(\n "POST", "/repos/%s/%s/git/commits" % ( login, repoName ),\n { "parents": [], "message": "Message of the commit", "tree": t["sha"] }\n)\ndoRequest(\n "POST", "/repos/%s/%s/git/refs" % ( login, repoName ),\n { "ref": "refs/heads/master", "sha": c["sha"] }\n)\n\n# Fork the repo\ndoRequest( "POST", "/repos/%s/%s/forks?org=%s" % ( login, repoName, orgName ), None )\n\n# Create a new blob => BOOM error 500\ndoRequest(\n "POST", "/repos/%s/%s/git/blobs" % ( orgName, repoName ),\n { "content": "Content of the new blob", "encoding": "latin1" }\n)\n') self.assertEquals(self.gist.files["fail_github.py"].raw_url, "https://gist.github.com/raw/2729810/2fb3aa84e0efa50dc0f4c18b5df5b7b9ab27076b/fail_github.py") self.assertEquals(self.gist.forks, []) self.assertEquals(self.gist.git_pull_url, "git://gist.github.com/2729810.git") diff --git a/github/tests/Issue87.py b/github/tests/Issue87.py index 2c199739..6e777443 100644 --- a/github/tests/Issue87.py +++ b/github/tests/Issue87.py @@ -22,17 +22,17 @@ class Issue87(Framework.TestCase): # https://github.com/jacquev6/PyGithub/issue self.repo = self.g.get_user().get_repo("PyGithub") def testCreateIssueWithPercentInTitle(self): - issue = self.repo.create_issue( "Issue with percent % in title created by PyGithub" ) - self.assertEqual( issue.number, 99 ) + issue = self.repo.create_issue("Issue with percent % in title created by PyGithub") + self.assertEqual(issue.number, 99) def testCreateIssueWithPercentInBody(self): - issue = self.repo.create_issue( "Issue created by PyGithub", "Percent % in body" ) - self.assertEqual( issue.number, 98 ) + issue = self.repo.create_issue("Issue created by PyGithub", "Percent % in body") + self.assertEqual(issue.number, 98) def testCreateIssueWithEscapedPercentInTitle(self): - issue = self.repo.create_issue( "Issue with escaped percent %25 in title created by PyGithub" ) - self.assertEqual( issue.number, 97 ) + issue = self.repo.create_issue("Issue with escaped percent %25 in title created by PyGithub") + self.assertEqual(issue.number, 97) def testCreateIssueWithEscapedPercentInBody(self): - issue = self.repo.create_issue( "Issue created by PyGithub", "Escaped percent %25 in body" ) - self.assertEqual( issue.number, 96 ) + issue = self.repo.create_issue("Issue created by PyGithub", "Escaped percent %25 in body") + self.assertEqual(issue.number, 96) diff --git a/github/tests/Logging.py b/github/tests/Logging.py index f0c09e87..767118f1 100644 --- a/github/tests/Logging.py +++ b/github/tests/Logging.py @@ -27,7 +27,7 @@ class Logging(Framework.BasicTestCase): def handle(self, record): self.handled = record.getMessage() - def setUp( self ): + def setUp(self): Framework.BasicTestCase.setUp(self) logger = logging.getLogger("github") logger.setLevel(logging.DEBUG) @@ -48,5 +48,5 @@ class Logging(Framework.BasicTestCase): def testLoggingWithBaseUrl(self): # ReplayData forged, not recorded - self.assertEqual(github.Github(base_url = "http://my.enterprise.com/my/prefix").get_user("jacquev6").name, "Vincent Jacques") + self.assertEqual(github.Github(base_url="http://my.enterprise.com/my/prefix").get_user("jacquev6").name, "Vincent Jacques") self.assertEqual(self.__handler.handled, u'GET http://my.enterprise.com/my/prefix/users/jacquev6 {} None ==> 200 {\'status\': \'200 OK\', \'content-length\': \'628\', \'x-github-media-type\': \'github.beta; format=json\', \'x-content-type-options\': \'nosniff\', \'vary\': \'Accept\', \'x-ratelimit-remaining\': \'4989\', \'server\': \'nginx\', \'last-modified\': \'Tue, 25 Sep 2012 07:42:42 GMT\', \'connection\': \'keep-alive\', \'x-ratelimit-limit\': \'5000\', \'etag\': \'"9bd085221a16b6d2ea95e72634c3c1ac"\', \'cache-control\': \'public, max-age=60, s-maxage=60\', \'date\': \'Tue, 25 Sep 2012 20:38:56 GMT\', \'content-type\': \'application/json; charset=utf-8\'} {"type":"User","html_url":"https://github.com/jacquev6","login":"jacquev6","followers":14,"company":"Criteo","created_at":"2010-07-09T06:10:06Z","email":"vincent@vincent-jacques.net","hireable":false,"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png","public_gists":3,"bio":"","following":29,"name":"Vincent Jacques","blog":"http://vincent-jacques.net","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","id":327146,"public_repos":13,"location":"Paris, France","url":"https://api.github.com/users/jacquev6"}') From a03066d2d5d07888a0c4e6318eff6bfab221cc59 Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Tue, 25 Sep 2012 23:14:16 +0200 Subject: [PATCH 16/62] Add a Contribute.md file (issue #94) See https://github.com/blog/1184-contributing-guidelines --- Contributing.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Contributing.md diff --git a/Contributing.md b/Contributing.md new file mode 100644 index 00000000..efbb5203 --- /dev/null +++ b/Contributing.md @@ -0,0 +1,18 @@ +Issues +====== + +A good issue includes a [short, self contained, correct example](http://sscce.org/) of the problem, something like: + + assert github.Github().get_user("jacquev6").name == "Vincent Jacques" + +It is even better if you provide the debug logs associated with your issue. +Enable them with `github.enable_console_debug_logging()` and copy them in the body of the issue. +Warning, you may want to remove some private information (authentication information is removed, but there may be private stuff in the messages) + +If for any reason you are not able to provide, open your issue anyway and we will see what is needed to solve your problem. + +Pull requests +============= + +PyGithub follows [pep8 Style Guide for Python Code](http://www.python.org/dev/peps/pep-0008/) except for line length. +So if you do heavy modifications, please check your code with [pep8 Python style guide checker](http://pypi.python.org/pypi/pep8), by running `pep8 --ignore=E501 github`. From 6e39b78e9771019d4e36b285635d1ee1bf73ca72 Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Tue, 25 Sep 2012 23:29:02 +0200 Subject: [PATCH 17/62] Changelog --- ReadMe.md | 20 ++++++++------------ doc/ChangeLog.md | 10 ++++++++++ 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/ReadMe.md b/ReadMe.md index 49011411..6a26866d 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -13,19 +13,15 @@ What's new? [![Build Status](https://secure.travis-ci.org/jacquev6/PyGithub.png)](http://travis-ci.org/jacquev6/PyGithub) -[Next version](https://github.com/jacquev6/PyGithub/issues?milestone=13&state=closed) (???, 2012) ------------------------------------------------------------------------------------------------------------ +[Version 1.8.0](https://github.com/jacquev6/PyGithub/issues?milestone=13&state=closed) (September 26th, 2012) +------------------------------------------------------------------------------------------------------------- -* Enable Travis CI - -[Version 1.7](https://github.com/jacquev6/PyGithub/issues?milestone=12&state=closed) (September 12th, 2012) ------------------------------------------------------------------------------------------------------------ - -* Be able to clear the assignee and the milestone of an Issue. Thank you [quixotique](https://github.com/quixotique) for the merge request -* Fix an AssertionFailure in `Organization.get_xxx` when using Github Enterprise. Thank you [mnsanghvi](https://github.com/mnsanghvi) for pointing that -* Expose pagination to users needing it (`PaginatedList.get_page`). Thank you [kukuts](https://github.com/kukuts) for asking -* Improve handling of legacy search APIs -* Small refactoring (documentation, removal of old code generation artifacts) +* Enable [Travis CI](http://travis-ci.org/#!/jacquev6/PyGithub) +* Fix error 500 when json payload contains percent character (`%`). Thank you again [quixotique](https://github.com/quixotique) for pointing that and reporting it to Github +* Enable debug logging. Logger name is `"github"`. Simple logging can be enabled by `github.enable_console_debug_logging()`. Thank you [quixotique](https://github.com/quixotique) for the merge request and the advice +* Publish tests in the PyPi source archive to ease QA tests of the [FreeBSD port](http://www.freshports.org/devel/py-pygithub/). Thank you [koobs](https://github.com/koobs) for maintaining this port +* Switch to [Semantic Versioning](http://semver.org/) +* Respect [pep8 Style Guide for Python Code](http://www.python.org/dev/peps/pep-0008/) Previous versions ----------------- diff --git a/doc/ChangeLog.md b/doc/ChangeLog.md index 0da99048..e63b3df7 100644 --- a/doc/ChangeLog.md +++ b/doc/ChangeLog.md @@ -1,3 +1,13 @@ +[Version 1.8.0](https://github.com/jacquev6/PyGithub/issues?milestone=13&state=closed) (September 26th, 2012) +------------------------------------------------------------------------------------------------------------- + +* Enable [Travis CI](http://travis-ci.org/#!/jacquev6/PyGithub) +* Fix error 500 when json payload contains percent character (`%`). Thank you again [quixotique](https://github.com/quixotique) for pointing that and reporting it to Github +* Enable debug logging. Logger name is `"github"`. Simple logging can be enabled by `github.enable_console_debug_logging()`. Thank you [quixotique](https://github.com/quixotique) for the merge request and the advice +* Publish tests in the PyPi source archive to ease QA tests of the [FreeBSD port](http://www.freshports.org/devel/py-pygithub/). Thank you [koobs](https://github.com/koobs) for maintaining this port +* Switch to [Semantic Versioning](http://semver.org/) +* Respect [pep8 Style Guide for Python Code](http://www.python.org/dev/peps/pep-0008/) + [Version 1.7](https://github.com/jacquev6/PyGithub/issues?milestone=12&state=closed) (September 12th, 2012) =========================================================================================================== From 31110327ec45f3138e58ed247b2cf420fee481ec Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Sun, 30 Sep 2012 19:59:20 +0200 Subject: [PATCH 18/62] Publish version 1.8.0 --- ReadMe.md | 2 +- doc/ChangeLog.md | 2 +- setup.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ReadMe.md b/ReadMe.md index 6a26866d..d1d1488c 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -13,7 +13,7 @@ What's new? [![Build Status](https://secure.travis-ci.org/jacquev6/PyGithub.png)](http://travis-ci.org/jacquev6/PyGithub) -[Version 1.8.0](https://github.com/jacquev6/PyGithub/issues?milestone=13&state=closed) (September 26th, 2012) +[Version 1.8.0](https://github.com/jacquev6/PyGithub/issues?milestone=13&state=closed) (September 30th, 2012) ------------------------------------------------------------------------------------------------------------- * Enable [Travis CI](http://travis-ci.org/#!/jacquev6/PyGithub) diff --git a/doc/ChangeLog.md b/doc/ChangeLog.md index e63b3df7..531ba353 100644 --- a/doc/ChangeLog.md +++ b/doc/ChangeLog.md @@ -1,4 +1,4 @@ -[Version 1.8.0](https://github.com/jacquev6/PyGithub/issues?milestone=13&state=closed) (September 26th, 2012) +[Version 1.8.0](https://github.com/jacquev6/PyGithub/issues?milestone=13&state=closed) (September 30th, 2012) ------------------------------------------------------------------------------------------------------------- * Enable [Travis CI](http://travis-ci.org/#!/jacquev6/PyGithub) diff --git a/setup.py b/setup.py index 69baf89c..04da7286 100755 --- a/setup.py +++ b/setup.py @@ -31,7 +31,7 @@ class test( Command ): setup( name = "PyGithub", - version = "1.7", + version = "1.8.0", description = "Use the full Github API v3", author = "Vincent Jacques", author_email = "vincent@vincent-jacques.net", From 1010c9af1847cdb1b221b9fd67158a4000ce3796 Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Sun, 7 Oct 2012 13:03:42 +0200 Subject: [PATCH 19/62] Prepend "/refs/" in Repository.get_git_ref (issue #102) --- ReadMe.md | 11 +++-------- github/Repository.py | 2 +- github/tests/GitRef.py | 2 +- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/ReadMe.md b/ReadMe.md index d1d1488c..dc880ad6 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -13,15 +13,10 @@ What's new? [![Build Status](https://secure.travis-ci.org/jacquev6/PyGithub.png)](http://travis-ci.org/jacquev6/PyGithub) -[Version 1.8.0](https://github.com/jacquev6/PyGithub/issues?milestone=13&state=closed) (September 30th, 2012) -------------------------------------------------------------------------------------------------------------- +[Version 1.8.1](https://github.com/jacquev6/PyGithub/issues?milestone=15&state=closed) (October ??th, 2012) +----------------------------------------------------------------------------------------------------------- -* Enable [Travis CI](http://travis-ci.org/#!/jacquev6/PyGithub) -* Fix error 500 when json payload contains percent character (`%`). Thank you again [quixotique](https://github.com/quixotique) for pointing that and reporting it to Github -* Enable debug logging. Logger name is `"github"`. Simple logging can be enabled by `github.enable_console_debug_logging()`. Thank you [quixotique](https://github.com/quixotique) for the merge request and the advice -* Publish tests in the PyPi source archive to ease QA tests of the [FreeBSD port](http://www.freshports.org/devel/py-pygithub/). Thank you [koobs](https://github.com/koobs) for maintaining this port -* Switch to [Semantic Versioning](http://semver.org/) -* Respect [pep8 Style Guide for Python Code](http://www.python.org/dev/peps/pep-0008/) +* Repository.get_git_ref prepends "refs/" to the requested references. Thank you [simon-weber](https://github.com/simon-weber) for noting the incoherence between documentation and behavior Previous versions ----------------- diff --git a/github/Repository.py b/github/Repository.py index b2c81c80..fb8de184 100644 --- a/github/Repository.py +++ b/github/Repository.py @@ -663,7 +663,7 @@ class Repository(GithubObject.GithubObject): assert isinstance(ref, (str, unicode)), ref headers, data = self._requester.requestAndCheck( "GET", - self.url + "/git/" + ref, + self.url + "/git/refs/" + ref, None, None ) diff --git a/github/tests/GitRef.py b/github/tests/GitRef.py index 67e4ddc0..fb2e23d1 100644 --- a/github/tests/GitRef.py +++ b/github/tests/GitRef.py @@ -17,7 +17,7 @@ import Framework class GitRef(Framework.TestCase): def setUp(self): Framework.TestCase.setUp(self) - self.ref = self.g.get_user().get_repo("PyGithub").get_git_ref("refs/heads/BranchCreatedByPyGithub") + self.ref = self.g.get_user().get_repo("PyGithub").get_git_ref("heads/BranchCreatedByPyGithub") def testAttributes(self): self.assertEqual(self.ref.object.sha, "1292bf0e22c796e91cc3d6e24b544aece8c21f2a") From cc6d7f1ec3fa28e7f8fed12fb123a881848a3bbc Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Sun, 28 Oct 2012 09:54:07 +0100 Subject: [PATCH 20/62] Fix test when run on Linux with source tree on case-insensitive filesystem --- github/tests/AllTests.py | 4 ++-- github/tests/{Github.py => Github_.py} | 0 github/tests/{Logging.py => Logging_.py} | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename github/tests/{Github.py => Github_.py} (100%) rename github/tests/{Logging.py => Logging_.py} (100%) diff --git a/github/tests/AllTests.py b/github/tests/AllTests.py index dd8864ce..ab730318 100644 --- a/github/tests/AllTests.py +++ b/github/tests/AllTests.py @@ -25,7 +25,7 @@ from Gist import * from GistComment import * from GitBlob import * from GitCommit import * -from Github import * +from Github_ import * from GitRef import * from GitTag import * from GitTree import * @@ -51,7 +51,7 @@ from UserKey import * from PaginatedList import * from Exceptions import * from Enterprise import * -from Logging import * +from Logging_ import * from Issue33 import * from Issue50 import * diff --git a/github/tests/Github.py b/github/tests/Github_.py similarity index 100% rename from github/tests/Github.py rename to github/tests/Github_.py diff --git a/github/tests/Logging.py b/github/tests/Logging_.py similarity index 100% rename from github/tests/Logging.py rename to github/tests/Logging_.py From af98e6d1d48ebec80c8aa815472e81e6554d081c Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Sun, 28 Oct 2012 10:12:25 +0100 Subject: [PATCH 21/62] Implement optional revert of #102 (issue #104) --- github/Github.py | 8 ++++++++ github/Repository.py | 5 ++++- github/Requester.py | 1 + github/tests/ReplayData/Repository.testGetGitRef.txt | 5 +++++ .../Repository.testGetGitRefWithIssue102Reverted.txt | 5 +++++ github/tests/Repository.py | 11 +++++++++++ 6 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 github/tests/ReplayData/Repository.testGetGitRef.txt create mode 100644 github/tests/ReplayData/Repository.testGetGitRefWithIssue102Reverted.txt diff --git a/github/Github.py b/github/Github.py index 4ae6c60a..60f8be1f 100644 --- a/github/Github.py +++ b/github/Github.py @@ -33,6 +33,14 @@ class Github(object): def __init__(self, login_or_token=None, password=None, base_url=DEFAULT_BASE_URL, timeout=DEFAULT_TIMEOUT): self.__requester = Requester(login_or_token, password, base_url, timeout) + @property + def FIX_REPO_GET_GIT_REF(self): + return self.__requester.FIX_REPO_GET_GIT_REF + + @FIX_REPO_GET_GIT_REF.setter + def FIX_REPO_GET_GIT_REF(self, value): + self.__requester.FIX_REPO_GET_GIT_REF = value + @property def rate_limiting(self): return self.__requester.rate_limiting diff --git a/github/Repository.py b/github/Repository.py index fb8de184..e4f98b18 100644 --- a/github/Repository.py +++ b/github/Repository.py @@ -660,10 +660,13 @@ class Repository(GithubObject.GithubObject): return GitCommit.GitCommit(self._requester, data, completed=True) def get_git_ref(self, ref): + prefix = "/git/refs/" + if not self._requester.FIX_REPO_GET_GIT_REF: + prefix = "/git/" assert isinstance(ref, (str, unicode)), ref headers, data = self._requester.requestAndCheck( "GET", - self.url + "/git/refs/" + ref, + self.url + prefix + ref, None, None ) diff --git a/github/Requester.py b/github/Requester.py index aad22e57..1f3214f8 100644 --- a/github/Requester.py +++ b/github/Requester.py @@ -61,6 +61,7 @@ class Requester: else: assert(False) # pragma no cover self.rate_limiting = (5000, 5000) + self.FIX_REPO_GET_GIT_REF = True def requestAndCheck(self, verb, url, parameters, input): status, headers, output = self.requestRaw(verb, url, parameters, input) diff --git a/github/tests/ReplayData/Repository.testGetGitRef.txt b/github/tests/ReplayData/Repository.testGetGitRef.txt new file mode 100644 index 00000000..ffa15201 --- /dev/null +++ b/github/tests/ReplayData/Repository.testGetGitRef.txt @@ -0,0 +1,5 @@ +https GET api.github.com None /repos/jacquev6/PyGithub/git/refs/heads/master {'Authorization': 'Basic login_and_password_removed'} null +200 +[('status', '200 OK'), ('x-ratelimit-remaining', '4987'), ('x-github-media-type', 'github.beta; format=json'), ('x-content-type-options', 'nosniff'), ('x-ratelimit-limit', '5000'), ('vary', 'Accept, Authorization, Cookie'), ('content-length', '288'), ('server', 'nginx'), ('last-modified', 'Sun, 28 Oct 2012 01:48:38 GMT'), ('connection', 'keep-alive'), ('etag', '"d7478b9ae7e3c0de496ede43edd2fdfc"'), ('cache-control', 'private, max-age=60, s-maxage=60'), ('date', 'Sun, 28 Oct 2012 08:58:25 GMT'), ('content-type', 'application/json; charset=utf-8')] +{"url":"https://api.github.com/repos/jacquev6/PyGithub/git/refs/heads/master","object":{"url":"https://api.github.com/repos/jacquev6/PyGithub/git/commits/31110327ec45f3138e58ed247b2cf420fee481ec","type":"commit","sha":"31110327ec45f3138e58ed247b2cf420fee481ec"},"ref":"refs/heads/master"} + diff --git a/github/tests/ReplayData/Repository.testGetGitRefWithIssue102Reverted.txt b/github/tests/ReplayData/Repository.testGetGitRefWithIssue102Reverted.txt new file mode 100644 index 00000000..ffa15201 --- /dev/null +++ b/github/tests/ReplayData/Repository.testGetGitRefWithIssue102Reverted.txt @@ -0,0 +1,5 @@ +https GET api.github.com None /repos/jacquev6/PyGithub/git/refs/heads/master {'Authorization': 'Basic login_and_password_removed'} null +200 +[('status', '200 OK'), ('x-ratelimit-remaining', '4987'), ('x-github-media-type', 'github.beta; format=json'), ('x-content-type-options', 'nosniff'), ('x-ratelimit-limit', '5000'), ('vary', 'Accept, Authorization, Cookie'), ('content-length', '288'), ('server', 'nginx'), ('last-modified', 'Sun, 28 Oct 2012 01:48:38 GMT'), ('connection', 'keep-alive'), ('etag', '"d7478b9ae7e3c0de496ede43edd2fdfc"'), ('cache-control', 'private, max-age=60, s-maxage=60'), ('date', 'Sun, 28 Oct 2012 08:58:25 GMT'), ('content-type', 'application/json; charset=utf-8')] +{"url":"https://api.github.com/repos/jacquev6/PyGithub/git/refs/heads/master","object":{"url":"https://api.github.com/repos/jacquev6/PyGithub/git/commits/31110327ec45f3138e58ed247b2cf420fee481ec","type":"commit","sha":"31110327ec45f3138e58ed247b2cf420fee481ec"},"ref":"refs/heads/master"} + diff --git a/github/tests/Repository.py b/github/tests/Repository.py index 9835973a..9dffedb9 100644 --- a/github/tests/Repository.py +++ b/github/tests/Repository.py @@ -267,6 +267,17 @@ class Repository(Framework.TestCase): def testGetGitRefs(self): self.assertListKeyEqual(self.repo.get_git_refs(), lambda r: r.ref, ["refs/heads/develop", "refs/heads/master", "refs/heads/topic/DependencyGraph", "refs/heads/topic/RewriteWithGeneratedCode", "refs/tags/v0.1", "refs/tags/v0.2", "refs/tags/v0.3", "refs/tags/v0.4", "refs/tags/v0.5", "refs/tags/v0.6", "refs/tags/v0.7"]) + def testGetGitRef( self ): + self.assertTrue(self.g.FIX_REPO_GET_GIT_REF) + self.assertEqual(self.repo.get_git_ref( "heads/master" ).object.sha, "31110327ec45f3138e58ed247b2cf420fee481ec" ) + + def testGetGitRefWithIssue102Reverted( self ): + self.g.FIX_REPO_GET_GIT_REF = False + self.assertFalse(self.g.FIX_REPO_GET_GIT_REF) + self.assertEqual(self.repo.get_git_ref( "refs/heads/master" ).object.sha, "31110327ec45f3138e58ed247b2cf420fee481ec" ) + self.g.FIX_REPO_GET_GIT_REF = True + self.assertTrue(self.g.FIX_REPO_GET_GIT_REF) + def testGetGitTreeWithRecursive(self): tree = self.repo.get_git_tree("f492784d8ca837779650d1fb406a1a3587a764ad", True) self.assertEqual(len(tree.tree), 90) From d4679b330d62dad21877b460891f5c799fc17d07 Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Sun, 28 Oct 2012 10:29:19 +0100 Subject: [PATCH 22/62] pep8... --- github/tests/Repository.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/github/tests/Repository.py b/github/tests/Repository.py index 9dffedb9..b2833109 100644 --- a/github/tests/Repository.py +++ b/github/tests/Repository.py @@ -267,14 +267,14 @@ class Repository(Framework.TestCase): def testGetGitRefs(self): self.assertListKeyEqual(self.repo.get_git_refs(), lambda r: r.ref, ["refs/heads/develop", "refs/heads/master", "refs/heads/topic/DependencyGraph", "refs/heads/topic/RewriteWithGeneratedCode", "refs/tags/v0.1", "refs/tags/v0.2", "refs/tags/v0.3", "refs/tags/v0.4", "refs/tags/v0.5", "refs/tags/v0.6", "refs/tags/v0.7"]) - def testGetGitRef( self ): + def testGetGitRef(self): self.assertTrue(self.g.FIX_REPO_GET_GIT_REF) - self.assertEqual(self.repo.get_git_ref( "heads/master" ).object.sha, "31110327ec45f3138e58ed247b2cf420fee481ec" ) + self.assertEqual(self.repo.get_git_ref("heads/master").object.sha, "31110327ec45f3138e58ed247b2cf420fee481ec") - def testGetGitRefWithIssue102Reverted( self ): + def testGetGitRefWithIssue102Reverted(self): self.g.FIX_REPO_GET_GIT_REF = False self.assertFalse(self.g.FIX_REPO_GET_GIT_REF) - self.assertEqual(self.repo.get_git_ref( "refs/heads/master" ).object.sha, "31110327ec45f3138e58ed247b2cf420fee481ec" ) + self.assertEqual(self.repo.get_git_ref("refs/heads/master").object.sha, "31110327ec45f3138e58ed247b2cf420fee481ec") self.g.FIX_REPO_GET_GIT_REF = True self.assertTrue(self.g.FIX_REPO_GET_GIT_REF) From 9bee696d78ddabd62b95500093893667ead4da4b Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Sun, 28 Oct 2012 10:32:41 +0100 Subject: [PATCH 23/62] Prepare v1.8.1 --- ReadMe.md | 4 ++-- doc/ChangeLog.md | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ReadMe.md b/ReadMe.md index dc880ad6..c3ad6035 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -13,10 +13,10 @@ What's new? [![Build Status](https://secure.travis-ci.org/jacquev6/PyGithub.png)](http://travis-ci.org/jacquev6/PyGithub) -[Version 1.8.1](https://github.com/jacquev6/PyGithub/issues?milestone=15&state=closed) (October ??th, 2012) +[Version 1.8.1](https://github.com/jacquev6/PyGithub/issues?milestone=15&state=closed) (October 28th, 2012) ----------------------------------------------------------------------------------------------------------- -* Repository.get_git_ref prepends "refs/" to the requested references. Thank you [simon-weber](https://github.com/simon-weber) for noting the incoherence between documentation and behavior +* Repository.get_git_ref prepends "refs/" to the requested references. Thank you [simon-weber](https://github.com/simon-weber) for noting the incoherence between documentation and behavior. If you feel like it's a breaking change, please see [this issue](https://github.com/jacquev6/PyGithub/issues/104) Previous versions ----------------- diff --git a/doc/ChangeLog.md b/doc/ChangeLog.md index 531ba353..f38329c4 100644 --- a/doc/ChangeLog.md +++ b/doc/ChangeLog.md @@ -1,3 +1,8 @@ +[Version 1.8.1](https://github.com/jacquev6/PyGithub/issues?milestone=15&state=closed) (October 28th, 2012) +----------------------------------------------------------------------------------------------------------- + +* Repository.get_git_ref prepends "refs/" to the requested references. Thank you [simon-weber](https://github.com/simon-weber) for noting the incoherence between documentation and behavior. If you feel like it's a breaking change, please see [this issue](https://github.com/jacquev6/PyGithub/issues/104) + [Version 1.8.0](https://github.com/jacquev6/PyGithub/issues?milestone=13&state=closed) (September 30th, 2012) ------------------------------------------------------------------------------------------------------------- From e3d76fc3ec3dd4f4c3b3a440ff9e771f06d63a39 Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Sun, 28 Oct 2012 10:35:11 +0100 Subject: [PATCH 24/62] Publish version 1.8.1 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 04da7286..db1f1232 100755 --- a/setup.py +++ b/setup.py @@ -31,7 +31,7 @@ class test( Command ): setup( name = "PyGithub", - version = "1.8.0", + version = "1.8.1", description = "Use the full Github API v3", author = "Vincent Jacques", author_email = "vincent@vincent-jacques.net", From 1867f461ed14f5d73e02818703badabd5dc097b2 Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Sun, 28 Oct 2012 11:13:21 +0100 Subject: [PATCH 25/62] Restore support of Python 2.5 --- github/Github.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/github/Github.py b/github/Github.py index 60f8be1f..5525a000 100644 --- a/github/Github.py +++ b/github/Github.py @@ -33,14 +33,14 @@ class Github(object): def __init__(self, login_or_token=None, password=None, base_url=DEFAULT_BASE_URL, timeout=DEFAULT_TIMEOUT): self.__requester = Requester(login_or_token, password, base_url, timeout) - @property - def FIX_REPO_GET_GIT_REF(self): + def get_FIX_REPO_GET_GIT_REF(self): return self.__requester.FIX_REPO_GET_GIT_REF - @FIX_REPO_GET_GIT_REF.setter - def FIX_REPO_GET_GIT_REF(self, value): + def set_FIX_REPO_GET_GIT_REF(self, value): self.__requester.FIX_REPO_GET_GIT_REF = value + FIX_REPO_GET_GIT_REF = property(get_FIX_REPO_GET_GIT_REF, set_FIX_REPO_GET_GIT_REF) + @property def rate_limiting(self): return self.__requester.rate_limiting From ca1e7998266b65cb4cd4e87a8c7ff7cc2afa4658 Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Sun, 28 Oct 2012 15:53:03 +0100 Subject: [PATCH 26/62] Restore measure of test coverage --- github/Legacy.py | 56 +++++++++++++++++------------------ github/Requester.py | 2 +- github/__init__.py | 2 +- github/tests/Exceptions.py | 24 ++++++++++----- github/tests/Framework.py | 14 ++++----- github/tests/Issue.py | 2 +- github/tests/PaginatedList.py | 4 +-- github/tests/Repository.py | 4 ++- github/tests/Team.py | 8 ++--- github/tests/__init__.py | 2 +- github/tests/__main__.py | 13 ++++++++ setup.py | 25 +++++++++++++++- 12 files changed, 101 insertions(+), 55 deletions(-) diff --git a/github/Legacy.py b/github/Legacy.py index de55eb61..89c9862a 100644 --- a/github/Legacy.py +++ b/github/Legacy.py @@ -59,17 +59,17 @@ def convertUser(attributes): "login": attributes["login"], "url": "/users/" + attributes["login"], } - if "gravatar_id" in attributes: + if "gravatar_id" in attributes: # pragma no branch convertedAttributes["gravatar_id"] = attributes["gravatar_id"] - if "followers" in attributes: + if "followers" in attributes: # pragma no branch convertedAttributes["followers"] = attributes["followers"] - if "repos" in attributes: + if "repos" in attributes: # pragma no branch convertedAttributes["public_repos"] = attributes["repos"] - if "name" in attributes: + if "name" in attributes: # pragma no branch convertedAttributes["name"] = attributes["name"] - if "created_at" in attributes: + if "created_at" in attributes: # pragma no branch convertedAttributes["created_at"] = attributes["created_at"] - if "location" in attributes: + if "location" in attributes: # pragma no branch convertedAttributes["location"] = attributes["location"] return convertedAttributes @@ -79,35 +79,35 @@ def convertRepo(attributes): "owner": {"login": attributes["owner"], "url": "/users/" + attributes["owner"]}, "url": "/repos/" + attributes["owner"] + "/" + attributes["name"], } - if "pushed_at" in attributes: + if "pushed_at" in attributes: # pragma no branch convertedAttributes["pushed_at"] = attributes["pushed_at"] - if "homepage" in attributes: + if "homepage" in attributes: # pragma no branch convertedAttributes["homepage"] = attributes["homepage"] - if "created_at" in attributes: + if "created_at" in attributes: # pragma no branch convertedAttributes["created_at"] = attributes["created_at"] - if "watchers" in attributes: + if "watchers" in attributes: # pragma no branch convertedAttributes["watchers"] = attributes["watchers"] - if "has_downloads" in attributes: + if "has_downloads" in attributes: # pragma no branch convertedAttributes["has_downloads"] = attributes["has_downloads"] - if "fork" in attributes: + if "fork" in attributes: # pragma no branch convertedAttributes["fork"] = attributes["fork"] - if "has_issues" in attributes: + if "has_issues" in attributes: # pragma no branch convertedAttributes["has_issues"] = attributes["has_issues"] - if "has_wiki" in attributes: + if "has_wiki" in attributes: # pragma no branch convertedAttributes["has_wiki"] = attributes["has_wiki"] - if "forks" in attributes: + if "forks" in attributes: # pragma no branch convertedAttributes["forks"] = attributes["forks"] - if "size" in attributes: + if "size" in attributes: # pragma no branch convertedAttributes["size"] = attributes["size"] - if "private" in attributes: + if "private" in attributes: # pragma no branch convertedAttributes["private"] = attributes["private"] - if "open_issues" in attributes: + if "open_issues" in attributes: # pragma no branch convertedAttributes["open_issues"] = attributes["open_issues"] - if "description" in attributes: + if "description" in attributes: # pragma no branch convertedAttributes["description"] = attributes["description"] - if "language" in attributes: + if "language" in attributes: # pragma no branch convertedAttributes["language"] = attributes["language"] - if "name" in attributes: + if "name" in attributes: # pragma no branch convertedAttributes["name"] = attributes["name"] return convertedAttributes @@ -118,18 +118,18 @@ def convertIssue(attributes): "url": "/repos" + urlparse.urlparse(attributes["html_url"]).path, "user": {"login": attributes["user"], "url": "/users/" + attributes["user"]}, } - if "labels" in attributes: + if "labels" in attributes: # pragma no branch convertedAttributes["labels"] = [{"name": label} for label in attributes["labels"]] - if "title" in attributes: + if "title" in attributes: # pragma no branch convertedAttributes["title"] = attributes["title"] - if "created_at" in attributes: + if "created_at" in attributes: # pragma no branch convertedAttributes["created_at"] = attributes["created_at"] - if "comments" in attributes: + if "comments" in attributes: # pragma no branch convertedAttributes["comments"] = attributes["comments"] - if "body" in attributes: + if "body" in attributes: # pragma no branch convertedAttributes["body"] = attributes["body"] - if "updated_at" in attributes: + if "updated_at" in attributes: # pragma no branch convertedAttributes["updated_at"] = attributes["updated_at"] - if "state" in attributes: + if "state" in attributes: # pragma no branch convertedAttributes["state"] = attributes["state"] return convertedAttributes diff --git a/github/Requester.py b/github/Requester.py index 1f3214f8..17cc9070 100644 --- a/github/Requester.py +++ b/github/Requester.py @@ -122,7 +122,7 @@ class Requester: requestHeaders["Authorization"] = "Basic (login and password removed)" elif requestHeaders["Authorization"].startswith("token"): requestHeaders["Authorization"] = "token (oauth token removed)" - else: + else: # pragma no cover requestHeaders["Authorization"] = "Unknown authorization removed" logger.debug("%s %s://%s%s %s %s ==> %i %s %s", str(verb), self.__scheme, self.__hostname, str(url), str(requestHeaders), str(input), status, str(responseHeaders), str(output)) diff --git a/github/__init__.py b/github/__init__.py index 641c0ee5..9485b2cc 100644 --- a/github/__init__.py +++ b/github/__init__.py @@ -20,7 +20,7 @@ from InputGitAuthor import InputGitAuthor from InputGitTreeElement import InputGitTreeElement -def enable_console_debug_logging(): +def enable_console_debug_logging(): # pragma no cover logger = logging.getLogger("github") logger.setLevel(logging.DEBUG) logger.addHandler(logging.StreamHandler()) diff --git a/github/tests/Exceptions.py b/github/tests/Exceptions.py index b30cff58..b95602f4 100644 --- a/github/tests/Exceptions.py +++ b/github/tests/Exceptions.py @@ -21,10 +21,11 @@ atLeastPython26 = sys.hexversion >= 0x02060000 class Exceptions(Framework.TestCase): # To stay compatible with Python 2.6, we do not use self.assertRaises with only one argument def testInvalidInput(self): + raised = False try: self.g.get_user().create_key("Bad key", "xxx") - self.fail("Should have raised") except github.GithubException, exception: + raised = True self.assertEqual(exception.status, 422) self.assertEqual( exception.data, @@ -43,40 +44,47 @@ class Exceptions(Framework.TestCase): # To stay compatible with Python 2.6, we if atLeastPython26: self.assertEqual(str(exception), "422 {u\'message\': u\'Validation Failed\', u\'errors\': [{u\'field\': u\'key\', u\'message\': u\"key is invalid. It must begin with \'ssh-rsa\' or \'ssh-dss\'. Check that you\'re copying the public half of the key\", u\'code\': u\'custom\', u\'resource\': u\'PublicKey\'}]}") else: - self.assertEqual(str(exception), "422 {\'message\': \'Validation Failed\', \'errors\': [{\'field\': \'key\', \'message\': \"key is invalid. It must begin with \'ssh-rsa\' or \'ssh-dss\'. Check that you\'re copying the public half of the key\", \'code\': \'custom\', \'resource\': \'PublicKey\'}]}") + self.assertEqual(str(exception), "422 {\'message\': \'Validation Failed\', \'errors\': [{\'field\': \'key\', \'message\': \"key is invalid. It must begin with \'ssh-rsa\' or \'ssh-dss\'. Check that you\'re copying the public half of the key\", \'code\': \'custom\', \'resource\': \'PublicKey\'}]}") # pragma no cover + self.assertTrue(raised) def testUnknownObject(self): + raised = False try: self.g.get_user().get_repo("Xxx") - self.fail("Should have raised") except github.GithubException, exception: + raised = True self.assertEqual(exception.status, 404) self.assertEqual(exception.data, {"message": "Not Found"}) if atLeastPython26: self.assertEqual(str(exception), "404 {u'message': u'Not Found'}") else: - self.assertEqual(str(exception), "404 {'message': 'Not Found'}") + self.assertEqual(str(exception), "404 {'message': 'Not Found'}") # pragma no cover + self.assertTrue(raised) def testUnknownUser(self): + raised = False try: self.g.get_user("ThisUserShouldReallyNotExist") - self.fail("Should have raised") except github.GithubException, exception: + raised = True self.assertEqual(exception.status, 404) self.assertEqual(exception.data, {"message": "Not Found"}) if atLeastPython26: self.assertEqual(str(exception), "404 {u'message': u'Not Found'}") else: - self.assertEqual(str(exception), "404 {'message': 'Not Found'}") + self.assertEqual(str(exception), "404 {'message': 'Not Found'}") # pragma no cover + self.assertTrue(raised) def testBadAuthentication(self): + raised = False try: github.Github("BadUser", "BadPassword").get_user().login - self.fail("Should have raised") except github.GithubException, exception: + raised = True self.assertEqual(exception.status, 401) self.assertEqual(exception.data, {"message": "Bad credentials"}) if atLeastPython26: self.assertEqual(str(exception), "401 {u'message': u'Bad credentials'}") else: - self.assertEqual(str(exception), "401 {'message': 'Bad credentials'}") + self.assertEqual(str(exception), "401 {'message': 'Bad credentials'}") # pragma no cover + self.assertTrue(raised) diff --git a/github/tests/Framework.py b/github/tests/Framework.py index ae8c3878..af528f5a 100644 --- a/github/tests/Framework.py +++ b/github/tests/Framework.py @@ -39,11 +39,11 @@ def fixAuthorizationHeader(headers): headers["Authorization"] = "token private_token_removed" elif headers["Authorization"].startswith("Basic "): headers["Authorization"] = "Basic login_and_password_removed" - else: + else: # pragma no cover assert False -class RecordingConnection: +class RecordingConnection: # pragma no cover def __init__(self, file, protocol, host, port, *args, **kwds): self.__file = file self.__protocol = protocol @@ -76,14 +76,14 @@ class RecordingConnection: return self.__cnx.close() -class RecordingHttpConnection(RecordingConnection): +class RecordingHttpConnection(RecordingConnection): # pragma no cover _realConnection = httplib.HTTPConnection def __init__(self, file, *args, **kwds): RecordingConnection.__init__(self, file, "http", *args, **kwds) -class RecordingHttpsConnection(RecordingConnection): +class RecordingHttpsConnection(RecordingConnection): # pragma no cover _realConnection = httplib.HTTPSConnection def __init__(self, file, *args, **kwds): @@ -130,7 +130,7 @@ class BasicTestCase(unittest.TestCase): unittest.TestCase.setUp(self) self.__fileName = "" self.__file = None - if self.recordMode: + if self.recordMode: # pragma no cover github.Requester.Requester.injectConnectionClasses( lambda ignored, *args, **kwds: RecordingHttpConnection(self.__openFile("wb"), *args, **kwds), lambda ignored, *args, **kwds: RecordingHttpsConnection(self.__openFile("wb"), *args, **kwds) @@ -165,7 +165,7 @@ class BasicTestCase(unittest.TestCase): def __closeReplayFileIfNeeded(self): if self.__file is not None: - if not self.recordMode: + if not self.recordMode: # pragma no branch self.assertEqual(self.__file.readline(), "") self.__file.close() @@ -184,5 +184,5 @@ class TestCase(BasicTestCase): self.g = github.Github(self.login, self.password) -def activateRecordMode(): +def activateRecordMode(): # pragma no cover BasicTestCase.recordMode = True diff --git a/github/tests/Issue.py b/github/tests/Issue.py index 95eec520..91db99fc 100644 --- a/github/tests/Issue.py +++ b/github/tests/Issue.py @@ -95,6 +95,6 @@ class Issue(Framework.TestCase): question = self.repo.get_label("Question") self.assertListKeyEqual(self.issue.get_labels(), lambda l: l.name, ["Bug", "Project management", "Question"]) self.issue.delete_labels() - self.assertListKeyEqual(self.issue.get_labels(), lambda l: l.name, []) + self.assertListKeyEqual(self.issue.get_labels(), None, []) self.issue.set_labels(bug, question) self.assertListKeyEqual(self.issue.get_labels(), lambda l: l.name, ["Bug", "Question"]) diff --git a/github/tests/PaginatedList.py b/github/tests/PaginatedList.py index 00c45db1..0191b3fd 100644 --- a/github/tests/PaginatedList.py +++ b/github/tests/PaginatedList.py @@ -66,7 +66,7 @@ class PaginatedList(Framework.TestCase): def testInterruptedIteration(self): # No asserts, but checks that only three pages are fetched l = 0 - for element in self.list: + for element in self.list: # pragma no branch (exits only by break) l += 1 if l == 75: break @@ -74,7 +74,7 @@ class PaginatedList(Framework.TestCase): def testInterruptedIterationInSlice(self): # No asserts, but checks that only three pages are fetched l = 0 - for element in self.list[:100]: + for element in self.list[:100]: # pragma no branch (exits only by break) l += 1 if l == 75: break diff --git a/github/tests/Repository.py b/github/tests/Repository.py index b2833109..9458c816 100644 --- a/github/tests/Repository.py +++ b/github/tests/Repository.py @@ -409,9 +409,11 @@ class Repository(Framework.TestCase): self.assertEqual(commit, None) def testMergeWithConflict(self): + raised = False try: commit = self.repo.merge("branchForBase", "branchForHead") - self.fail("Should have raised") except github.GithubException, exception: + raised = True self.assertEqual(exception.status, 409) self.assertEqual(exception.data, {"message": "Merge conflict"}) + self.assertTrue(raised) diff --git a/github/tests/Team.py b/github/tests/Team.py index c2469886..7f32d6f3 100644 --- a/github/tests/Team.py +++ b/github/tests/Team.py @@ -30,24 +30,24 @@ class Team(Framework.TestCase): def testMembers(self): user = self.g.get_user("jacquev6") - self.assertListKeyEqual(self.team.get_members(), lambda u: u.login, []) + self.assertListKeyEqual(self.team.get_members(), None, []) self.assertFalse(self.team.has_in_members(user)) self.team.add_to_members(user) self.assertListKeyEqual(self.team.get_members(), lambda u: u.login, ["jacquev6"]) self.assertTrue(self.team.has_in_members(user)) self.team.remove_from_members(user) - self.assertListKeyEqual(self.team.get_members(), lambda u: u.login, []) + self.assertListKeyEqual(self.team.get_members(), None, []) self.assertFalse(self.team.has_in_members(user)) def testRepos(self): repo = self.org.get_repo("FatherBeaver") - self.assertListKeyEqual(self.team.get_repos(), lambda r: r.name, []) + self.assertListKeyEqual(self.team.get_repos(), None, []) self.assertFalse(self.team.has_in_repos(repo)) self.team.add_to_repos(repo) self.assertListKeyEqual(self.team.get_repos(), lambda r: r.name, ["FatherBeaver"]) self.assertTrue(self.team.has_in_repos(repo)) self.team.remove_from_repos(repo) - self.assertListKeyEqual(self.team.get_repos(), lambda r: r.name, []) + self.assertListKeyEqual(self.team.get_repos(), None, []) self.assertFalse(self.team.has_in_repos(repo)) def testEditWithoutArguments(self): diff --git a/github/tests/__init__.py b/github/tests/__init__.py index 8108507e..ba9e1b20 100644 --- a/github/tests/__init__.py +++ b/github/tests/__init__.py @@ -17,4 +17,4 @@ import AllTests def run(): - unittest.main(module=AllTests, argv=["Dummy Script Name"]) + return unittest.main(module=AllTests, argv=["Dummy Script Name"], exit=False).result diff --git a/github/tests/__main__.py b/github/tests/__main__.py index 802c3f69..c6f8d2ca 100644 --- a/github/tests/__main__.py +++ b/github/tests/__main__.py @@ -1,3 +1,16 @@ +# Copyright 2012 Vincent Jacques +# vincent@vincent-jacques.net + +# This file is part of PyGithub. http://vincent-jacques.net/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 sys import unittest diff --git a/setup.py b/setup.py index db1f1232..6b783931 100755 --- a/setup.py +++ b/setup.py @@ -15,6 +15,8 @@ from distutils.core import setup, Command import textwrap +import sys +import glob class test( Command ): user_options = [] @@ -26,8 +28,29 @@ class test( Command ): pass def run( self ): + try: + import coverage + analyseCoverage = True + except ImportError: + print "Unable to import coverage. Running tests without coverage analysis" + analyseCoverage = False + if analyseCoverage: + cov = coverage.coverage(branch=True) + cov.start() + import github.tests - github.tests.run() + testsResult = github.tests.run() + + ok = len( testsResult.failures ) == 0 and len( testsResult.errors ) == 0 + if analyseCoverage: + cov.stop() + for f in glob.glob( "github/*.py" ): + ok = ok and len( cov.analysis2( f )[ 3 ] ) == 0 + cov.report(file=sys.stdout, include="github/*") + if ok: + exit( 0 ) + else: + exit( 1 ) setup( name = "PyGithub", From 823f25357a6dae8d648daabd19a08ff8ca899a72 Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Sun, 28 Oct 2012 18:20:14 +0100 Subject: [PATCH 27/62] Simplify --- setup.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 6b783931..74e169b0 100755 --- a/setup.py +++ b/setup.py @@ -39,9 +39,7 @@ class test( Command ): cov.start() import github.tests - testsResult = github.tests.run() - - ok = len( testsResult.failures ) == 0 and len( testsResult.errors ) == 0 + ok = github.tests.run().wasSuccessful() if analyseCoverage: cov.stop() for f in glob.glob( "github/*.py" ): From c0ccafa7ec02af00d5f59085e1bf5e99c74a7aee Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Sun, 28 Oct 2012 18:51:06 +0100 Subject: [PATCH 28/62] Restore Python 2.5 and 2.6? (This commit was 'push --force'd) --- .travis.yml | 2 +- github/tests/__init__.py | 14 ++++++++++++-- python25-requirements.txt | 1 + python26-requirements.txt | 1 + 4 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 python26-requirements.txt diff --git a/.travis.yml b/.travis.yml index 6e717c33..ac1f0ce8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,5 +3,5 @@ python: - "2.7" - "2.6" - "2.5" -install: if [ "$(python --version 2>&1)" == "Python 2.5.6" ]; then pip install -r python25-requirements.txt --use-mirrors; fi +install: if [ "$(python --version 2>&1)" == "Python 2.5.6" ]; then pip install -r python25-requirements.txt --use-mirrors; fi; if [ "$(python --version 2>&1)" == "Python 2.6.8" ]; then pip install -r python26-requirements.txt --use-mirrors; fi script: python ./setup.py test diff --git a/github/tests/__init__.py b/github/tests/__init__.py index ba9e1b20..3f15457c 100644 --- a/github/tests/__init__.py +++ b/github/tests/__init__.py @@ -11,10 +11,20 @@ # You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see . -import unittest +import sys + +atLeastPython27 = sys.hexversion >= 0x02070000 + +if atLeastPython27: + import unittest +else: # pragma no cover + import unittest2 as unittest # pragma no cover import AllTests def run(): - return unittest.main(module=AllTests, argv=["Dummy Script Name"], exit=False).result + testLoader = unittest.loader.TestLoader() + testRunner = unittest.runner.TextTestRunner(verbosity=1) + test = testLoader.loadTestsFromModule(AllTests) + return testRunner.run(test) diff --git a/python25-requirements.txt b/python25-requirements.txt index 7693e645..609f9122 100644 --- a/python25-requirements.txt +++ b/python25-requirements.txt @@ -1 +1,2 @@ simplejson +unittest2 diff --git a/python26-requirements.txt b/python26-requirements.txt new file mode 100644 index 00000000..9a23970d --- /dev/null +++ b/python26-requirements.txt @@ -0,0 +1 @@ +unittest2 From 4c6a70c24ac985ce602d9c5672a102646b6db4eb Mon Sep 17 00:00:00 2001 From: Zearin Date: Thu, 1 Nov 2012 11:43:56 -0400 Subject: [PATCH 29/62] Add encoding comment to source files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a minor thing. It’s a convention, not a rule (obviously)—but it’s also a best practice. Many text editors look for this kind of comment as the first line—or second line, if there is a shebang (the `#!/usr/bin/env python`, or whatever else)—and make use of this to determine the file’s encoding. --- github/AuthenticatedUser.py | 2 ++ github/Authorization.py | 2 ++ github/AuthorizationApplication.py | 2 ++ github/Branch.py | 2 ++ github/Commit.py | 2 ++ github/CommitComment.py | 2 ++ github/CommitStats.py | 2 ++ github/CommitStatus.py | 2 ++ github/Comparison.py | 2 ++ github/ContentFile.py | 2 ++ github/Download.py | 2 ++ github/Event.py | 2 ++ github/File.py | 2 ++ github/Gist.py | 2 ++ github/GistComment.py | 2 ++ github/GistFile.py | 2 ++ github/GistHistoryState.py | 2 ++ github/GitAuthor.py | 2 ++ github/GitBlob.py | 2 ++ github/GitCommit.py | 2 ++ github/GitObject.py | 2 ++ github/GitRef.py | 2 ++ github/GitTag.py | 2 ++ github/GitTree.py | 2 ++ github/GitTreeElement.py | 2 ++ github/Github.py | 2 ++ github/GithubException.py | 2 ++ github/GithubObject.py | 2 ++ github/Hook.py | 2 ++ github/HookDescription.py | 2 ++ github/HookResponse.py | 2 ++ github/InputFileContent.py | 2 ++ github/InputGitAuthor.py | 2 ++ github/InputGitTreeElement.py | 2 ++ github/Issue.py | 2 ++ github/IssueComment.py | 2 ++ github/IssueEvent.py | 2 ++ github/IssuePullRequest.py | 2 ++ github/Label.py | 2 ++ github/Legacy.py | 2 ++ github/Milestone.py | 2 ++ github/NamedUser.py | 2 ++ github/Organization.py | 2 ++ github/PaginatedList.py | 2 ++ github/Permissions.py | 2 ++ github/Plan.py | 2 ++ github/PullRequest.py | 2 ++ github/PullRequestComment.py | 2 ++ github/PullRequestMergeStatus.py | 2 ++ github/PullRequestPart.py | 2 ++ github/Repository.py | 2 ++ github/RepositoryKey.py | 2 ++ github/Requester.py | 2 ++ github/Tag.py | 2 ++ github/Team.py | 2 ++ github/UserKey.py | 2 ++ github/__init__.py | 2 ++ github/tests/AllTests.py | 2 ++ github/tests/AuthenticatedUser.py | 2 ++ github/tests/Authentication.py | 2 ++ github/tests/Authorization.py | 2 ++ github/tests/Branch.py | 2 ++ github/tests/Commit.py | 2 ++ github/tests/CommitComment.py | 2 ++ github/tests/CommitStatus.py | 2 ++ github/tests/ContentFile.py | 2 ++ github/tests/Download.py | 2 ++ github/tests/Enterprise.py | 2 ++ github/tests/Event.py | 2 ++ github/tests/Exceptions.py | 2 ++ github/tests/Framework.py | 2 ++ github/tests/Gist.py | 2 ++ github/tests/GistComment.py | 2 ++ github/tests/GitBlob.py | 2 ++ github/tests/GitCommit.py | 2 ++ github/tests/GitRef.py | 2 ++ github/tests/GitTag.py | 2 ++ github/tests/GitTree.py | 2 ++ github/tests/Github_.py | 2 ++ github/tests/Hook.py | 2 ++ github/tests/IntegrationTest.py | 2 ++ github/tests/Issue.py | 2 ++ github/tests/Issue33.py | 2 ++ github/tests/Issue50.py | 2 ++ github/tests/Issue54.py | 2 ++ github/tests/Issue80.py | 2 ++ github/tests/Issue87.py | 2 ++ github/tests/IssueComment.py | 2 ++ github/tests/IssueEvent.py | 2 ++ github/tests/Label.py | 2 ++ github/tests/Logging_.py | 2 ++ github/tests/Markdown.py | 2 ++ github/tests/Milestone.py | 2 ++ github/tests/NamedUser.py | 2 ++ github/tests/Organization.py | 2 ++ github/tests/PaginatedList.py | 2 ++ github/tests/PullRequest.py | 2 ++ github/tests/PullRequestComment.py | 2 ++ github/tests/PullRequestFile.py | 2 ++ github/tests/RateLimiting.py | 2 ++ github/tests/Repository.py | 2 ++ github/tests/RepositoryKey.py | 2 ++ github/tests/Tag.py | 2 ++ github/tests/Team.py | 2 ++ github/tests/UserKey.py | 2 ++ github/tests/__init__.py | 2 ++ github/tests/__main__.py | 2 ++ publish.sh | 1 + setup.py | 1 + 109 files changed, 216 insertions(+) diff --git a/github/AuthenticatedUser.py b/github/AuthenticatedUser.py index 684c2142..9be73ea9 100644 --- a/github/AuthenticatedUser.py +++ b/github/AuthenticatedUser.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/Authorization.py b/github/Authorization.py index 1271624c..91805330 100644 --- a/github/Authorization.py +++ b/github/Authorization.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/AuthorizationApplication.py b/github/AuthorizationApplication.py index ee23a727..e99844dc 100644 --- a/github/AuthorizationApplication.py +++ b/github/AuthorizationApplication.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/Branch.py b/github/Branch.py index 4c99ed11..a49e9a7a 100644 --- a/github/Branch.py +++ b/github/Branch.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/Commit.py b/github/Commit.py index c0e8d075..2849285b 100644 --- a/github/Commit.py +++ b/github/Commit.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/CommitComment.py b/github/CommitComment.py index 53c09632..d3e0e47f 100644 --- a/github/CommitComment.py +++ b/github/CommitComment.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/CommitStats.py b/github/CommitStats.py index e5b3b6ba..03001a24 100644 --- a/github/CommitStats.py +++ b/github/CommitStats.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/CommitStatus.py b/github/CommitStatus.py index 715ceece..08479073 100644 --- a/github/CommitStatus.py +++ b/github/CommitStatus.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/Comparison.py b/github/Comparison.py index fe1622ea..494240ed 100644 --- a/github/Comparison.py +++ b/github/Comparison.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/ContentFile.py b/github/ContentFile.py index b69b611b..1026e795 100644 --- a/github/ContentFile.py +++ b/github/ContentFile.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/Download.py b/github/Download.py index 8551d9b6..e54bbfbe 100644 --- a/github/Download.py +++ b/github/Download.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/Event.py b/github/Event.py index 496b660c..4c8b3b3b 100644 --- a/github/Event.py +++ b/github/Event.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/File.py b/github/File.py index e3395910..0dedb3cd 100644 --- a/github/File.py +++ b/github/File.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/Gist.py b/github/Gist.py index c3b382a5..f583a321 100644 --- a/github/Gist.py +++ b/github/Gist.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/GistComment.py b/github/GistComment.py index 4273987b..aa8f73cb 100644 --- a/github/GistComment.py +++ b/github/GistComment.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/GistFile.py b/github/GistFile.py index 194f64ed..1b8aba3e 100644 --- a/github/GistFile.py +++ b/github/GistFile.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/GistHistoryState.py b/github/GistHistoryState.py index 19a46abc..0c214fff 100644 --- a/github/GistHistoryState.py +++ b/github/GistHistoryState.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/GitAuthor.py b/github/GitAuthor.py index 4e99645b..a14f31c9 100644 --- a/github/GitAuthor.py +++ b/github/GitAuthor.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/GitBlob.py b/github/GitBlob.py index 6e47584a..19b10589 100644 --- a/github/GitBlob.py +++ b/github/GitBlob.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/GitCommit.py b/github/GitCommit.py index cd3a7057..0dcf1de5 100644 --- a/github/GitCommit.py +++ b/github/GitCommit.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/GitObject.py b/github/GitObject.py index 15ed92b5..5b6b308b 100644 --- a/github/GitObject.py +++ b/github/GitObject.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/GitRef.py b/github/GitRef.py index eab64cc8..58b2426f 100644 --- a/github/GitRef.py +++ b/github/GitRef.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/GitTag.py b/github/GitTag.py index e8a030b1..664bc8aa 100644 --- a/github/GitTag.py +++ b/github/GitTag.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/GitTree.py b/github/GitTree.py index 70c5b64e..3af066ab 100644 --- a/github/GitTree.py +++ b/github/GitTree.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/GitTreeElement.py b/github/GitTreeElement.py index 6c5c463b..e2b1a63e 100644 --- a/github/GitTreeElement.py +++ b/github/GitTreeElement.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/Github.py b/github/Github.py index 5525a000..bd6662bd 100644 --- a/github/Github.py +++ b/github/Github.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/GithubException.py b/github/GithubException.py index 626ab238..11b615a5 100644 --- a/github/GithubException.py +++ b/github/GithubException.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/GithubObject.py b/github/GithubObject.py index 8448e70d..76e3c4b8 100644 --- a/github/GithubObject.py +++ b/github/GithubObject.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/Hook.py b/github/Hook.py index cabc5f5a..9a0af68e 100644 --- a/github/Hook.py +++ b/github/Hook.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/HookDescription.py b/github/HookDescription.py index 6dd0d143..28e4e654 100644 --- a/github/HookDescription.py +++ b/github/HookDescription.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/HookResponse.py b/github/HookResponse.py index c09cfc86..a5f174cf 100644 --- a/github/HookResponse.py +++ b/github/HookResponse.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/InputFileContent.py b/github/InputFileContent.py index f46ab975..b3234622 100644 --- a/github/InputFileContent.py +++ b/github/InputFileContent.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/InputGitAuthor.py b/github/InputGitAuthor.py index c2cf8d9d..4dbacb2c 100644 --- a/github/InputGitAuthor.py +++ b/github/InputGitAuthor.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/InputGitTreeElement.py b/github/InputGitTreeElement.py index 290d3793..edf56150 100644 --- a/github/InputGitTreeElement.py +++ b/github/InputGitTreeElement.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/Issue.py b/github/Issue.py index 859c8097..282a6765 100644 --- a/github/Issue.py +++ b/github/Issue.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/IssueComment.py b/github/IssueComment.py index 18f72557..68d44d14 100644 --- a/github/IssueComment.py +++ b/github/IssueComment.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/IssueEvent.py b/github/IssueEvent.py index ba658efd..5839ae8f 100644 --- a/github/IssueEvent.py +++ b/github/IssueEvent.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/IssuePullRequest.py b/github/IssuePullRequest.py index 6f94cb23..e5b94375 100644 --- a/github/IssuePullRequest.py +++ b/github/IssuePullRequest.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/Label.py b/github/Label.py index 3dcc0d5a..1d8e7dd8 100644 --- a/github/Label.py +++ b/github/Label.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/Legacy.py b/github/Legacy.py index 89c9862a..e09c79dc 100644 --- a/github/Legacy.py +++ b/github/Legacy.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/Milestone.py b/github/Milestone.py index 7a0c2262..b2528665 100644 --- a/github/Milestone.py +++ b/github/Milestone.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/NamedUser.py b/github/NamedUser.py index e8666187..03c079dd 100644 --- a/github/NamedUser.py +++ b/github/NamedUser.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/Organization.py b/github/Organization.py index 90cd93e5..ab724a89 100644 --- a/github/Organization.py +++ b/github/Organization.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/PaginatedList.py b/github/PaginatedList.py index 24a14b8a..80703413 100644 --- a/github/PaginatedList.py +++ b/github/PaginatedList.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/Permissions.py b/github/Permissions.py index 0c776469..91d65ecf 100644 --- a/github/Permissions.py +++ b/github/Permissions.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/Plan.py b/github/Plan.py index 76f801be..9c9d6055 100644 --- a/github/Plan.py +++ b/github/Plan.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/PullRequest.py b/github/PullRequest.py index a31b4a45..e66649f7 100644 --- a/github/PullRequest.py +++ b/github/PullRequest.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/PullRequestComment.py b/github/PullRequestComment.py index 04525b01..6e6eb2a6 100644 --- a/github/PullRequestComment.py +++ b/github/PullRequestComment.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/PullRequestMergeStatus.py b/github/PullRequestMergeStatus.py index 3117b003..ce96afac 100644 --- a/github/PullRequestMergeStatus.py +++ b/github/PullRequestMergeStatus.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/PullRequestPart.py b/github/PullRequestPart.py index f7695e85..0507133e 100644 --- a/github/PullRequestPart.py +++ b/github/PullRequestPart.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/Repository.py b/github/Repository.py index e4f98b18..93156d78 100644 --- a/github/Repository.py +++ b/github/Repository.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/RepositoryKey.py b/github/RepositoryKey.py index e094b775..ef92ad80 100644 --- a/github/RepositoryKey.py +++ b/github/RepositoryKey.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/Requester.py b/github/Requester.py index 17cc9070..52e5e5a1 100644 --- a/github/Requester.py +++ b/github/Requester.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/Tag.py b/github/Tag.py index ab1f6fd3..b38ff6ae 100644 --- a/github/Tag.py +++ b/github/Tag.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/Team.py b/github/Team.py index 342ee4ce..b89a5ba8 100644 --- a/github/Team.py +++ b/github/Team.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/UserKey.py b/github/UserKey.py index baaacddd..ed2691af 100644 --- a/github/UserKey.py +++ b/github/UserKey.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/__init__.py b/github/__init__.py index 9485b2cc..269bb7bd 100644 --- a/github/__init__.py +++ b/github/__init__.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/tests/AllTests.py b/github/tests/AllTests.py index ab730318..33b9f840 100644 --- a/github/tests/AllTests.py +++ b/github/tests/AllTests.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/tests/AuthenticatedUser.py b/github/tests/AuthenticatedUser.py index 5cfae067..b58aaa30 100644 --- a/github/tests/AuthenticatedUser.py +++ b/github/tests/AuthenticatedUser.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/tests/Authentication.py b/github/tests/Authentication.py index cc8e7b06..91bb1e04 100644 --- a/github/tests/Authentication.py +++ b/github/tests/Authentication.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/tests/Authorization.py b/github/tests/Authorization.py index c23f2a0c..9e79ca1c 100644 --- a/github/tests/Authorization.py +++ b/github/tests/Authorization.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/tests/Branch.py b/github/tests/Branch.py index 9b84ee5b..27feeb62 100644 --- a/github/tests/Branch.py +++ b/github/tests/Branch.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/tests/Commit.py b/github/tests/Commit.py index 4c242858..ac9275e0 100644 --- a/github/tests/Commit.py +++ b/github/tests/Commit.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/tests/CommitComment.py b/github/tests/CommitComment.py index 83068c2b..2bead16e 100644 --- a/github/tests/CommitComment.py +++ b/github/tests/CommitComment.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/tests/CommitStatus.py b/github/tests/CommitStatus.py index 49691267..2ce0e867 100644 --- a/github/tests/CommitStatus.py +++ b/github/tests/CommitStatus.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/tests/ContentFile.py b/github/tests/ContentFile.py index 1616c6eb..21b85ec0 100644 --- a/github/tests/ContentFile.py +++ b/github/tests/ContentFile.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/tests/Download.py b/github/tests/Download.py index 975d6f20..a24dcfd4 100644 --- a/github/tests/Download.py +++ b/github/tests/Download.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/tests/Enterprise.py b/github/tests/Enterprise.py index 5552f14b..ee8f73a2 100644 --- a/github/tests/Enterprise.py +++ b/github/tests/Enterprise.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/tests/Event.py b/github/tests/Event.py index 5bc0d6c7..5d518dfb 100644 --- a/github/tests/Event.py +++ b/github/tests/Event.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/tests/Exceptions.py b/github/tests/Exceptions.py index b95602f4..c1a51f12 100644 --- a/github/tests/Exceptions.py +++ b/github/tests/Exceptions.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/tests/Framework.py b/github/tests/Framework.py index af528f5a..b21c276c 100644 --- a/github/tests/Framework.py +++ b/github/tests/Framework.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/tests/Gist.py b/github/tests/Gist.py index 93605532..7bf85017 100644 --- a/github/tests/Gist.py +++ b/github/tests/Gist.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/tests/GistComment.py b/github/tests/GistComment.py index 08ab183d..a4d30630 100644 --- a/github/tests/GistComment.py +++ b/github/tests/GistComment.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/tests/GitBlob.py b/github/tests/GitBlob.py index 92e495ae..e7896f7a 100644 --- a/github/tests/GitBlob.py +++ b/github/tests/GitBlob.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/tests/GitCommit.py b/github/tests/GitCommit.py index d2d71871..fe327a4b 100644 --- a/github/tests/GitCommit.py +++ b/github/tests/GitCommit.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/tests/GitRef.py b/github/tests/GitRef.py index fb2e23d1..357ca8de 100644 --- a/github/tests/GitRef.py +++ b/github/tests/GitRef.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/tests/GitTag.py b/github/tests/GitTag.py index eb20977c..2a36dc42 100644 --- a/github/tests/GitTag.py +++ b/github/tests/GitTag.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/tests/GitTree.py b/github/tests/GitTree.py index 7a512d8d..6ced3b3a 100644 --- a/github/tests/GitTree.py +++ b/github/tests/GitTree.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/tests/Github_.py b/github/tests/Github_.py index 899b7beb..95a51b5d 100644 --- a/github/tests/Github_.py +++ b/github/tests/Github_.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/tests/Hook.py b/github/tests/Hook.py index 38e114a2..403a0e4e 100644 --- a/github/tests/Hook.py +++ b/github/tests/Hook.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/tests/IntegrationTest.py b/github/tests/IntegrationTest.py index a7ff3600..3fbaabb6 100755 --- a/github/tests/IntegrationTest.py +++ b/github/tests/IntegrationTest.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + #!/bin/env python # Copyright 2012 Vincent Jacques diff --git a/github/tests/Issue.py b/github/tests/Issue.py index 91db99fc..7fe40498 100644 --- a/github/tests/Issue.py +++ b/github/tests/Issue.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/tests/Issue33.py b/github/tests/Issue33.py index 2e29d2e1..61d8e429 100644 --- a/github/tests/Issue33.py +++ b/github/tests/Issue33.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/tests/Issue50.py b/github/tests/Issue50.py index 519a2195..e4bf99df 100644 --- a/github/tests/Issue50.py +++ b/github/tests/Issue50.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/tests/Issue54.py b/github/tests/Issue54.py index a8d0888a..df9b2ab0 100644 --- a/github/tests/Issue54.py +++ b/github/tests/Issue54.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/tests/Issue80.py b/github/tests/Issue80.py index d5a63322..fb6643fd 100644 --- a/github/tests/Issue80.py +++ b/github/tests/Issue80.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/tests/Issue87.py b/github/tests/Issue87.py index 6e777443..7edf0331 100644 --- a/github/tests/Issue87.py +++ b/github/tests/Issue87.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/tests/IssueComment.py b/github/tests/IssueComment.py index 6090b4d0..53fde395 100644 --- a/github/tests/IssueComment.py +++ b/github/tests/IssueComment.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/tests/IssueEvent.py b/github/tests/IssueEvent.py index 688508b8..96cb740a 100644 --- a/github/tests/IssueEvent.py +++ b/github/tests/IssueEvent.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/tests/Label.py b/github/tests/Label.py index 4be91a16..3fa94ed0 100644 --- a/github/tests/Label.py +++ b/github/tests/Label.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/tests/Logging_.py b/github/tests/Logging_.py index 767118f1..79cc3e34 100644 --- a/github/tests/Logging_.py +++ b/github/tests/Logging_.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/tests/Markdown.py b/github/tests/Markdown.py index a9bc2dd8..ec480124 100644 --- a/github/tests/Markdown.py +++ b/github/tests/Markdown.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/tests/Milestone.py b/github/tests/Milestone.py index 55446d9b..a4a17a17 100644 --- a/github/tests/Milestone.py +++ b/github/tests/Milestone.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/tests/NamedUser.py b/github/tests/NamedUser.py index 90768009..5cfbdaf0 100644 --- a/github/tests/NamedUser.py +++ b/github/tests/NamedUser.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/tests/Organization.py b/github/tests/Organization.py index 7610d18f..c69e6106 100644 --- a/github/tests/Organization.py +++ b/github/tests/Organization.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/tests/PaginatedList.py b/github/tests/PaginatedList.py index 0191b3fd..9ad4e6d5 100644 --- a/github/tests/PaginatedList.py +++ b/github/tests/PaginatedList.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/tests/PullRequest.py b/github/tests/PullRequest.py index 7afaf576..c856d1e8 100644 --- a/github/tests/PullRequest.py +++ b/github/tests/PullRequest.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/tests/PullRequestComment.py b/github/tests/PullRequestComment.py index 1830f110..fae74621 100644 --- a/github/tests/PullRequestComment.py +++ b/github/tests/PullRequestComment.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/tests/PullRequestFile.py b/github/tests/PullRequestFile.py index 4ebb09ed..f2ee7817 100644 --- a/github/tests/PullRequestFile.py +++ b/github/tests/PullRequestFile.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/tests/RateLimiting.py b/github/tests/RateLimiting.py index 7f3c2e0b..40da9752 100644 --- a/github/tests/RateLimiting.py +++ b/github/tests/RateLimiting.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/tests/Repository.py b/github/tests/Repository.py index 9458c816..efbdd6f2 100644 --- a/github/tests/Repository.py +++ b/github/tests/Repository.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/tests/RepositoryKey.py b/github/tests/RepositoryKey.py index bfc82936..1072d71a 100644 --- a/github/tests/RepositoryKey.py +++ b/github/tests/RepositoryKey.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/tests/Tag.py b/github/tests/Tag.py index 9421d343..86ecf627 100644 --- a/github/tests/Tag.py +++ b/github/tests/Tag.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/tests/Team.py b/github/tests/Team.py index 7f32d6f3..dae05bae 100644 --- a/github/tests/Team.py +++ b/github/tests/Team.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/tests/UserKey.py b/github/tests/UserKey.py index 6b4306b5..14a59240 100644 --- a/github/tests/UserKey.py +++ b/github/tests/UserKey.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/tests/__init__.py b/github/tests/__init__.py index 3f15457c..cf725e9e 100644 --- a/github/tests/__init__.py +++ b/github/tests/__init__.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/github/tests/__main__.py b/github/tests/__main__.py index c6f8d2ca..5ab5ad74 100644 --- a/github/tests/__main__.py +++ b/github/tests/__main__.py @@ -1,3 +1,5 @@ +# -*- coding: utf-8 -*- + # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net diff --git a/publish.sh b/publish.sh index 5fb0cdd7..23cef761 100755 --- a/publish.sh +++ b/publish.sh @@ -1,4 +1,5 @@ #!/bin/sh +# -*- coding: utf-8 -*- pep8 --ignore=E501 github # pip install pep8 python setup.py test diff --git a/setup.py b/setup.py index 74e169b0..eebba39f 100755 --- a/setup.py +++ b/setup.py @@ -1,4 +1,5 @@ #!/usr/bin/env python +# -*- coding: utf-8 -*- # Copyright 2012 Vincent Jacques # vincent@vincent-jacques.net From a627c9d4cae32d019409d961abe40e41fb54f52b Mon Sep 17 00:00:00 2001 From: Michael Stead Date: Fri, 2 Nov 2012 21:13:18 -0300 Subject: [PATCH 30/62] Add 'assignee' attribute to PullRequest It seems as though this may have been added to the github API and was not being included in the PullRequest object. --- github/PullRequest.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/github/PullRequest.py b/github/PullRequest.py index a31b4a45..8ec0d608 100644 --- a/github/PullRequest.py +++ b/github/PullRequest.py @@ -29,6 +29,11 @@ class PullRequest(GithubObject.GithubObject): self._completeIfNotSet(self._additions) return self._NoneIfNotSet(self._additions) + @property + def assignee(self): + self._completeIfNotSet(self._assignee) + return self._NoneIfNotSet(self._assignee) + @property def base(self): self._completeIfNotSet(self._base) @@ -290,6 +295,7 @@ class PullRequest(GithubObject.GithubObject): def _initAttributes(self): self._additions = GithubObject.NotSet + self._assignee = GithubObject.NotSet self._base = GithubObject.NotSet self._body = GithubObject.NotSet self._changed_files = GithubObject.NotSet @@ -320,6 +326,9 @@ class PullRequest(GithubObject.GithubObject): if "additions" in attributes: # pragma no branch assert attributes["additions"] is None or isinstance(attributes["additions"], int), attributes["additions"] self._additions = attributes["additions"] + if "assignee" in attributes: # pragma no branch + assert attributes["assignee"] is None or isinstance(attributes["assignee"], dict), attributes["assignee"] + self._assignee = None if attributes["assignee"] is None else NamedUser.NamedUser(self._requester, attributes["assignee"], completed=False) if "base" in attributes: # pragma no branch assert attributes["base"] is None or isinstance(attributes["base"], dict), attributes["base"] self._base = None if attributes["base"] is None else PullRequestPart.PullRequestPart(self._requester, attributes["base"], completed=False) From 55dd10f7fdd6f67cb4139eed7613cfdb464cdf09 Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Sat, 3 Nov 2012 09:24:35 +0100 Subject: [PATCH 31/62] Documentation and tests for PullRequest.assignee (Pull #111) --- doc/ReferenceOfClasses.md | 1 + github/tests/PullRequest.py | 7 ++++--- github/tests/ReplayData/PullRequest.setUp.txt | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/doc/ReferenceOfClasses.md b/doc/ReferenceOfClasses.md index 3db332e4..35e4fdd2 100644 --- a/doc/ReferenceOfClasses.md +++ b/doc/ReferenceOfClasses.md @@ -1014,6 +1014,7 @@ Class `PullRequest` Attributes ---------- * `additions`: integer +* `assignee`: `NamedUser` * `base`: `PullRequestPart` * `body`: string * `changed_files`: integer diff --git a/github/tests/PullRequest.py b/github/tests/PullRequest.py index 7afaf576..7aa4a770 100644 --- a/github/tests/PullRequest.py +++ b/github/tests/PullRequest.py @@ -24,6 +24,7 @@ class PullRequest(Framework.TestCase): def testAttributes(self): self.assertEqual(self.pull.additions, 511) + self.assertEqual(self.pull.assignee.login, "jacquev6") self.assertEqual(self.pull.base.label, "jacquev6:topic/RewriteWithGeneratedCode") self.assertEqual(self.pull.base.sha, "ed866fc43833802ab553e5ff8581c81bb00dd433") self.assertEqual(self.pull.base.user.login, "jacquev6") @@ -32,7 +33,7 @@ class PullRequest(Framework.TestCase): self.assertEqual(self.pull.body, "Body edited by PyGithub") self.assertEqual(self.pull.changed_files, 45) self.assertEqual(self.pull.closed_at, datetime.datetime(2012, 5, 27, 10, 29, 7)) - self.assertEqual(self.pull.comments, 0) + self.assertEqual(self.pull.comments, 1) self.assertEqual(self.pull.commits, 3) self.assertEqual(self.pull.created_at, datetime.datetime(2012, 5, 27, 9, 25, 36)) self.assertEqual(self.pull.deletions, 384) @@ -41,7 +42,7 @@ class PullRequest(Framework.TestCase): self.assertEqual(self.pull.html_url, "https://github.com/jacquev6/PyGithub/pull/31") self.assertEqual(self.pull.id, 1436215) self.assertEqual(self.pull.issue_url, "https://github.com/jacquev6/PyGithub/issues/31") - self.assertEqual(self.pull.mergeable, None) + self.assertEqual(self.pull.mergeable, False) self.assertEqual(self.pull.merged, True) self.assertEqual(self.pull.merged_at, datetime.datetime(2012, 5, 27, 10, 29, 7)) self.assertEqual(self.pull.merged_by.login, "jacquev6") @@ -50,7 +51,7 @@ class PullRequest(Framework.TestCase): self.assertEqual(self.pull.review_comments, 1) self.assertEqual(self.pull.state, "closed") self.assertEqual(self.pull.title, "Title edited by PyGithub") - self.assertEqual(self.pull.updated_at, datetime.datetime(2012, 5, 27, 10, 29, 7)) + self.assertEqual(self.pull.updated_at, datetime.datetime(2012, 11, 3, 8, 19, 40)) self.assertEqual(self.pull.url, "https://api.github.com/repos/jacquev6/PyGithub/pulls/31") self.assertEqual(self.pull.user.login, "jacquev6") diff --git a/github/tests/ReplayData/PullRequest.setUp.txt b/github/tests/ReplayData/PullRequest.setUp.txt index b1473769..ac0543aa 100644 --- a/github/tests/ReplayData/PullRequest.setUp.txt +++ b/github/tests/ReplayData/PullRequest.setUp.txt @@ -10,6 +10,6 @@ https GET api.github.com None /repos/jacquev6/PyGithub {'Authorization': 'Basic https GET api.github.com None /repos/jacquev6/PyGithub/pulls/31 {'Authorization': 'Basic login_and_password_removed'} null 200 -[('status', '200 OK'), ('x-ratelimit-remaining', '4948'), ('content-length', '4806'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"2ec526e3dd610dfb92cccc8159bd2585"'), ('date', 'Sun, 27 May 2012 10:32:06 GMT'), ('content-type', 'application/json; charset=utf-8')] -{"merged":true,"mergeable":null,"_links":{"self":{"href":"https://api.github.com/repos/jacquev6/PyGithub/pulls/31"},"comments":{"href":"https://api.github.com/repos/jacquev6/PyGithub/issues/31/comments"},"issue":{"href":"https://api.github.com/repos/jacquev6/PyGithub/issues/31"},"html":{"href":"https://github.com/jacquev6/PyGithub/pull/31"},"review_comments":{"href":"https://api.github.com/repos/jacquev6/PyGithub/pulls/31/comments"}},"head":{"ref":"master","label":"BeaverSoftware:master","repo":{"clone_url":"https://github.com/BeaverSoftware/PyGithub.git","has_downloads":true,"watchers":1,"updated_at":"2012-05-27T09:09:17Z","homepage":"http://vincent-jacques.net/PyGithub","url":"https://api.github.com/repos/BeaverSoftware/PyGithub","mirror_url":null,"has_wiki":false,"has_issues":false,"fork":true,"forks":0,"git_url":"git://github.com/BeaverSoftware/PyGithub.git","size":176,"private":false,"open_issues":0,"svn_url":"https://github.com/BeaverSoftware/PyGithub","owner":{"url":"https://api.github.com/users/BeaverSoftware","avatar_url":"https://secure.gravatar.com/avatar/d563e337cac2fdc644e2aaaad1e23266?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png","gravatar_id":"d563e337cac2fdc644e2aaaad1e23266","login":"BeaverSoftware","id":1424031},"name":"PyGithub","language":"Python","description":"Python library implementing the full Github API v3","ssh_url":"git@github.com:BeaverSoftware/PyGithub.git","pushed_at":"2012-05-27T09:09:17Z","created_at":"2012-05-27T08:50:04Z","id":4460787,"html_url":"https://github.com/BeaverSoftware/PyGithub","full_name":"BeaverSoftware/PyGithub"},"user":{"url":"https://api.github.com/users/BeaverSoftware","avatar_url":"https://secure.gravatar.com/avatar/d563e337cac2fdc644e2aaaad1e23266?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png","gravatar_id":"d563e337cac2fdc644e2aaaad1e23266","login":"BeaverSoftware","id":1424031},"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206"},"updated_at":"2012-05-27T10:29:07Z","issue_url":"https://github.com/jacquev6/PyGithub/issues/31","changed_files":45,"body":"Body edited by PyGithub","url":"https://api.github.com/repos/jacquev6/PyGithub/pulls/31","comments":0,"base":{"ref":"topic/RewriteWithGeneratedCode","label":"jacquev6:topic/RewriteWithGeneratedCode","repo":{"clone_url":"https://github.com/jacquev6/PyGithub.git","has_downloads":true,"watchers":15,"updated_at":"2012-05-27T10:29:10Z","homepage":"http://vincent-jacques.net/PyGithub","url":"https://api.github.com/repos/jacquev6/PyGithub","mirror_url":null,"has_wiki":false,"has_issues":true,"fork":false,"forks":3,"git_url":"git://github.com/jacquev6/PyGithub.git","size":188,"private":false,"open_issues":16,"svn_url":"https://github.com/jacquev6/PyGithub","owner":{"url":"https://api.github.com/users/jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146},"name":"PyGithub","language":"Python","description":"Python library implementing the full Github API v3","ssh_url":"git@github.com:jacquev6/PyGithub.git","pushed_at":"2012-05-27T10:29:09Z","created_at":"2012-02-25T12:53:47Z","id":3544490,"html_url":"https://github.com/jacquev6/PyGithub","full_name":"jacquev6/PyGithub"},"user":{"url":"https://api.github.com/users/jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146},"sha":"ed866fc43833802ab553e5ff8581c81bb00dd433"},"number":31,"diff_url":"https://github.com/jacquev6/PyGithub/pull/31.diff","merged_by":{"url":"https://api.github.com/users/jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146},"closed_at":"2012-05-27T10:29:07Z","title":"Title edited by PyGithub","deletions":384,"merged_at":"2012-05-27T10:29:07Z","patch_url":"https://github.com/jacquev6/PyGithub/pull/31.patch","additions":511,"created_at":"2012-05-27T09:25:36Z","user":{"url":"https://api.github.com/users/jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146},"state":"closed","id":1436215,"review_comments":1,"commits":3,"html_url":"https://github.com/jacquev6/PyGithub/pull/31"} +[('status', '200 OK'), ('x-ratelimit-remaining', '4985'), ('x-github-media-type', 'github.beta; format=json'), ('x-content-type-options', 'nosniff'), ('x-ratelimit-limit', '5000'), ('vary', 'Accept, Authorization, Cookie'), ('content-length', '4182'), ('server', 'nginx'), ('last-modified', 'Sat, 03 Nov 2012 08:19:40 GMT'), ('connection', 'keep-alive'), ('etag', '"1ec7d9f2ebb27db7dc002f1382d23975"'), ('cache-control', 'private, s-maxage=60, max-age=60'), ('date', 'Sat, 03 Nov 2012 08:19:46 GMT'), ('content-type', 'application/json; charset=utf-8')] +{"additions":511,"deletions":384,"merged_at":"2012-05-27T10:29:07Z","base":{"label":"jacquev6:topic/RewriteWithGeneratedCode","repo":{"watchers":97,"pushed_at":"2012-11-03T08:07:38Z","watchers_count":97,"forks":27,"open_issues":12,"mirror_url":null,"description":"Python library implementing the full Github API v3","owner":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png","login":"jacquev6","id":327146},"open_issues_count":12,"url":"https://api.github.com/repos/jacquev6/PyGithub","updated_at":"2012-11-03T08:07:40Z","html_url":"https://github.com/jacquev6/PyGithub","clone_url":"https://github.com/jacquev6/PyGithub.git","language":"Python","has_downloads":true,"ssh_url":"git@github.com:jacquev6/PyGithub.git","size":256,"forks_count":27,"fork":false,"full_name":"jacquev6/PyGithub","name":"PyGithub","created_at":"2012-02-25T12:53:47Z","git_url":"git://github.com/jacquev6/PyGithub.git","svn_url":"https://github.com/jacquev6/PyGithub","homepage":"http://vincent-jacques.net/PyGithub","has_wiki":true,"private":false,"id":3544490,"has_issues":true},"sha":"ed866fc43833802ab553e5ff8581c81bb00dd433","ref":"topic/RewriteWithGeneratedCode","user":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png","login":"jacquev6","id":327146}},"review_comments":1,"changed_files":45,"merge_commit_sha":"28ae6dd10ebccd5eaf8db8dacb5b699ee7f4a663","closed_at":"2012-05-27T10:29:07Z","number":31,"issue_url":"https://github.com/jacquev6/PyGithub/issues/31","url":"https://api.github.com/repos/jacquev6/PyGithub/pulls/31","milestone":null,"updated_at":"2012-11-03T08:19:40Z","patch_url":"https://github.com/jacquev6/PyGithub/pull/31.patch","html_url":"https://github.com/jacquev6/PyGithub/pull/31","merged_by":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png","login":"jacquev6","id":327146},"commits":3,"state":"closed","mergeable":false,"_links":{"review_comments":{"href":"https://api.github.com/repos/jacquev6/PyGithub/pulls/31/comments"},"html":{"href":"https://github.com/jacquev6/PyGithub/pull/31"},"self":{"href":"https://api.github.com/repos/jacquev6/PyGithub/pulls/31"},"issue":{"href":"https://api.github.com/repos/jacquev6/PyGithub/issues/31"},"comments":{"href":"https://api.github.com/repos/jacquev6/PyGithub/issues/31/comments"}},"head":{"label":"BeaverSoftware:master","repo":null,"sha":"8a4f306d4b223682dd19410d4a9150636ebe4206","ref":"master","user":{"url":"https://api.github.com/users/BeaverSoftware","gravatar_id":"d563e337cac2fdc644e2aaaad1e23266","avatar_url":"https://secure.gravatar.com/avatar/d563e337cac2fdc644e2aaaad1e23266?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-org-420.png","login":"BeaverSoftware","id":1424031}},"assignee":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png","login":"jacquev6","id":327146},"diff_url":"https://github.com/jacquev6/PyGithub/pull/31.diff","comments":1,"created_at":"2012-05-27T09:25:36Z","id":1436215,"merged":true,"mergeable_state":"dirty","body":"Body edited by PyGithub","user":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png","login":"jacquev6","id":327146},"title":"Title edited by PyGithub"} From 47dee65b63022ef14b2a57a03d3f2a6ba270d564 Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Sat, 3 Nov 2012 09:49:01 +0100 Subject: [PATCH 32/62] Implement default_branch in Repository.edit (issue #107) See http://developer.github.com/changes/2012-10-24-set-default-branch/ --- doc/ReferenceOfClasses.md | 3 ++- github/Repository.py | 5 ++++- .../ReplayData/Repository.testEditWithDefaultBranch.txt | 5 +++++ github/tests/Repository.py | 5 +++++ 4 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 github/tests/ReplayData/Repository.testEditWithDefaultBranch.txt diff --git a/doc/ReferenceOfClasses.md b/doc/ReferenceOfClasses.md index 35e4fdd2..930153b2 100644 --- a/doc/ReferenceOfClasses.md +++ b/doc/ReferenceOfClasses.md @@ -1375,7 +1375,7 @@ Milestones Modification ------------ -* `edit( name, [description, homepage, public, has_issues, has_wiki, has_downloads] )` +* `edit( name, [description, homepage, public, has_issues, has_wiki, has_downloads, default_branch] )` * `name`: string * `description`: string * `homepage`: string @@ -1383,6 +1383,7 @@ Modification * `has_issues`: bool * `has_wiki`: bool * `has_downloads`: bool + * `default_branch`: string Pulls ----- diff --git a/github/Repository.py b/github/Repository.py index 93156d78..b8311270 100644 --- a/github/Repository.py +++ b/github/Repository.py @@ -467,7 +467,7 @@ class Repository(GithubObject.GithubObject): None ) - def edit(self, name, description=GithubObject.NotSet, homepage=GithubObject.NotSet, public=GithubObject.NotSet, has_issues=GithubObject.NotSet, has_wiki=GithubObject.NotSet, has_downloads=GithubObject.NotSet): + def edit(self, name, description=GithubObject.NotSet, homepage=GithubObject.NotSet, public=GithubObject.NotSet, has_issues=GithubObject.NotSet, has_wiki=GithubObject.NotSet, has_downloads=GithubObject.NotSet, default_branch=GithubObject.NotSet): assert isinstance(name, (str, unicode)), name assert description is GithubObject.NotSet or isinstance(description, (str, unicode)), description assert homepage is GithubObject.NotSet or isinstance(homepage, (str, unicode)), homepage @@ -475,6 +475,7 @@ class Repository(GithubObject.GithubObject): assert has_issues is GithubObject.NotSet or isinstance(has_issues, bool), has_issues assert has_wiki is GithubObject.NotSet or isinstance(has_wiki, bool), has_wiki assert has_downloads is GithubObject.NotSet or isinstance(has_downloads, bool), has_downloads + assert default_branch is GithubObject.NotSet or isinstance(default_branch, (str, unicode)), default_branch post_parameters = { "name": name, } @@ -490,6 +491,8 @@ class Repository(GithubObject.GithubObject): post_parameters["has_wiki"] = has_wiki if has_downloads is not GithubObject.NotSet: post_parameters["has_downloads"] = has_downloads + if default_branch is not GithubObject.NotSet: + post_parameters["default_branch"] = default_branch headers, data = self._requester.requestAndCheck( "PATCH", self.url, diff --git a/github/tests/ReplayData/Repository.testEditWithDefaultBranch.txt b/github/tests/ReplayData/Repository.testEditWithDefaultBranch.txt new file mode 100644 index 00000000..81524825 --- /dev/null +++ b/github/tests/ReplayData/Repository.testEditWithDefaultBranch.txt @@ -0,0 +1,5 @@ +https PATCH api.github.com None /repos/jacquev6/PyGithub {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"default_branch": "master", "name": "PyGithub"} +200 +[('status', '200 OK'), ('content-length', '1264'), ('x-github-media-type', 'github.beta; format=json'), ('x-content-type-options', 'nosniff'), ('x-ratelimit-remaining', '4971'), ('server', 'nginx'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"4493662efd70c37f486a910d29ef99c1"'), ('cache-control', 'max-age=0, private, must-revalidate'), ('date', 'Sat, 03 Nov 2012 08:41:07 GMT'), ('content-type', 'application/json; charset=utf-8')] +{"master_branch":"master","watchers":97,"pushed_at":"2012-11-03T08:25:58Z","watchers_count":97,"forks":27,"svn_url":"https://github.com/jacquev6/PyGithub","description":"Python library implementing the full Github API v3","owner":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png","login":"jacquev6","id":327146},"open_issues":11,"open_issues_count":11,"url":"https://api.github.com/repos/jacquev6/PyGithub","updated_at":"2012-11-03T08:41:07Z","permissions":{"push":true,"pull":true,"admin":true},"default_branch":"master","html_url":"https://github.com/jacquev6/PyGithub","clone_url":"https://github.com/jacquev6/PyGithub.git","language":"Python","has_downloads":true,"ssh_url":"git@github.com:jacquev6/PyGithub.git","size":256,"mirror_url":null,"fork":false,"full_name":"jacquev6/PyGithub","forks_count":27,"name":"PyGithub","created_at":"2012-02-25T12:53:47Z","git_url":"git://github.com/jacquev6/PyGithub.git","homepage":"http://vincent-jacques.net/PyGithub","has_issues":true,"private":false,"id":3544490,"network_count":27,"has_wiki":true} + diff --git a/github/tests/Repository.py b/github/tests/Repository.py index efbdd6f2..578b6106 100644 --- a/github/tests/Repository.py +++ b/github/tests/Repository.py @@ -67,6 +67,11 @@ class Repository(Framework.TestCase): self.repo.edit("PyGithub", "Python library implementing the full Github API v3") self.assertEqual(self.repo.description, "Python library implementing the full Github API v3") + def testEditWithDefaultBranch(self): + self.assertEqual(self.repo.master_branch, None) + self.repo.edit("PyGithub", default_branch="master") + self.assertEqual(self.repo.master_branch, "master") + def testDelete(self): repo = self.g.get_user().get_repo("TestPyGithub") repo.delete() From f80df9e429659ecd49ddd1d19f9bfa364f1a9cad Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Sat, 3 Nov 2012 10:06:52 +0100 Subject: [PATCH 33/62] Add auto_init and gitignore_template to create_repo (issue #106) http://developer.github.com/changes/2012-9-28-auto-init-for-repositories/ --- doc/ReferenceOfClasses.md | 8 ++++++-- github/AuthenticatedUser.py | 8 +++++++- github/Organization.py | 8 +++++++- github/tests/AuthenticatedUser.py | 4 ++++ github/tests/Organization.py | 4 ++++ ...AuthenticatedUser.testCreateRepositoryWithAutoInit.txt | 5 +++++ .../Organization.testCreateRepositoryWithAutoInit.txt | 5 +++++ 7 files changed, 38 insertions(+), 4 deletions(-) create mode 100644 github/tests/ReplayData/AuthenticatedUser.testCreateRepositoryWithAutoInit.txt create mode 100644 github/tests/ReplayData/Organization.testCreateRepositoryWithAutoInit.txt diff --git a/doc/ReferenceOfClasses.md b/doc/ReferenceOfClasses.md index 930153b2..048354cc 100644 --- a/doc/ReferenceOfClasses.md +++ b/doc/ReferenceOfClasses.md @@ -170,7 +170,7 @@ Orgs Repos ----- -* `create_repo( name, [description, homepage, private, has_issues, has_wiki, has_downloads] )`: `Repository` +* `create_repo( name, [description, homepage, private, has_issues, has_wiki, has_downloads, auto_init, gitignore_template] )`: `Repository` * `name`: string * `description`: string * `homepage`: string @@ -178,6 +178,8 @@ Repos * `has_issues`: bool * `has_wiki`: bool * `has_downloads`: bool + * `auto_init`: bool + * `gitignore_template`: string * `get_repo( name )`: `Repository` * `name`: string * `get_repos( [type, sort, direction] )`: `PaginatedList` of `Repository` @@ -965,7 +967,7 @@ Public_members Repos ----- -* `create_repo( name, [description, homepage, private, has_issues, has_wiki, has_downloads, team_id] )`: `Repository` +* `create_repo( name, [description, homepage, private, has_issues, has_wiki, has_downloads, team_id, auto_init, gitignore_template] )`: `Repository` * `name`: string * `description`: string * `homepage`: string @@ -974,6 +976,8 @@ Repos * `has_wiki`: bool * `has_downloads`: bool * `team_id`: `Team` + * `auto_init`: bool + * `gitignore_template`: string * `get_repo( name )`: `Repository` * `name`: string * `get_repos( [type] )`: `PaginatedList` of `Repository` diff --git a/github/AuthenticatedUser.py b/github/AuthenticatedUser.py index 9be73ea9..f131d625 100644 --- a/github/AuthenticatedUser.py +++ b/github/AuthenticatedUser.py @@ -262,7 +262,7 @@ class AuthenticatedUser(GithubObject.GithubObject): ) return UserKey.UserKey(self._requester, data, completed=True) - def create_repo(self, name, description=GithubObject.NotSet, homepage=GithubObject.NotSet, private=GithubObject.NotSet, has_issues=GithubObject.NotSet, has_wiki=GithubObject.NotSet, has_downloads=GithubObject.NotSet): + def create_repo(self, name, description=GithubObject.NotSet, homepage=GithubObject.NotSet, private=GithubObject.NotSet, has_issues=GithubObject.NotSet, has_wiki=GithubObject.NotSet, has_downloads=GithubObject.NotSet, auto_init=GithubObject.NotSet, gitignore_template=GithubObject.NotSet): assert isinstance(name, (str, unicode)), name assert description is GithubObject.NotSet or isinstance(description, (str, unicode)), description assert homepage is GithubObject.NotSet or isinstance(homepage, (str, unicode)), homepage @@ -270,6 +270,8 @@ class AuthenticatedUser(GithubObject.GithubObject): assert has_issues is GithubObject.NotSet or isinstance(has_issues, bool), has_issues assert has_wiki is GithubObject.NotSet or isinstance(has_wiki, bool), has_wiki assert has_downloads is GithubObject.NotSet or isinstance(has_downloads, bool), has_downloads + assert auto_init is GithubObject.NotSet or isinstance(auto_init, bool), auto_init + assert gitignore_template is GithubObject.NotSet or isinstance(gitignore_template, (str, unicode)), gitignore_template post_parameters = { "name": name, } @@ -285,6 +287,10 @@ class AuthenticatedUser(GithubObject.GithubObject): post_parameters["has_wiki"] = has_wiki if has_downloads is not GithubObject.NotSet: post_parameters["has_downloads"] = has_downloads + if auto_init is not GithubObject.NotSet: + post_parameters["auto_init"] = auto_init + if gitignore_template is not GithubObject.NotSet: + post_parameters["gitignore_template"] = gitignore_template headers, data = self._requester.requestAndCheck( "POST", "/user/repos", diff --git a/github/Organization.py b/github/Organization.py index ab724a89..a64134fc 100644 --- a/github/Organization.py +++ b/github/Organization.py @@ -166,7 +166,7 @@ class Organization(GithubObject.GithubObject): ) return Repository.Repository(self._requester, data, completed=True) - def create_repo(self, name, description=GithubObject.NotSet, homepage=GithubObject.NotSet, private=GithubObject.NotSet, has_issues=GithubObject.NotSet, has_wiki=GithubObject.NotSet, has_downloads=GithubObject.NotSet, team_id=GithubObject.NotSet): + def create_repo(self, name, description=GithubObject.NotSet, homepage=GithubObject.NotSet, private=GithubObject.NotSet, has_issues=GithubObject.NotSet, has_wiki=GithubObject.NotSet, has_downloads=GithubObject.NotSet, team_id=GithubObject.NotSet, auto_init=GithubObject.NotSet, gitignore_template=GithubObject.NotSet): assert isinstance(name, (str, unicode)), name assert description is GithubObject.NotSet or isinstance(description, (str, unicode)), description assert homepage is GithubObject.NotSet or isinstance(homepage, (str, unicode)), homepage @@ -175,6 +175,8 @@ class Organization(GithubObject.GithubObject): assert has_wiki is GithubObject.NotSet or isinstance(has_wiki, bool), has_wiki assert has_downloads is GithubObject.NotSet or isinstance(has_downloads, bool), has_downloads assert team_id is GithubObject.NotSet or isinstance(team_id, Team.Team), team_id + assert auto_init is GithubObject.NotSet or isinstance(auto_init, bool), auto_init + assert gitignore_template is GithubObject.NotSet or isinstance(gitignore_template, (str, unicode)), gitignore_template post_parameters = { "name": name, } @@ -192,6 +194,10 @@ class Organization(GithubObject.GithubObject): post_parameters["has_downloads"] = has_downloads if team_id is not GithubObject.NotSet: post_parameters["team_id"] = team_id._identity + if auto_init is not GithubObject.NotSet: + post_parameters["auto_init"] = auto_init + if gitignore_template is not GithubObject.NotSet: + post_parameters["gitignore_template"] = gitignore_template headers, data = self._requester.requestAndCheck( "POST", self.url + "/repos", diff --git a/github/tests/AuthenticatedUser.py b/github/tests/AuthenticatedUser.py index b58aaa30..19e35fc8 100644 --- a/github/tests/AuthenticatedUser.py +++ b/github/tests/AuthenticatedUser.py @@ -122,6 +122,10 @@ class AuthenticatedUser(Framework.TestCase): repo = self.user.create_repo("TestPyGithub", "Repo created by PyGithub", "http://foobar.com", private=False, has_issues=False, has_wiki=False, has_downloads=False) self.assertEqual(repo.url, "https://api.github.com/repos/jacquev6/TestPyGithub") + def testCreateRepositoryWithAutoInit(self): + repo = self.user.create_repo("TestPyGithub", auto_init=True, gitignore_template="Python") + self.assertEqual(repo.url, "https://api.github.com/repos/jacquev6/TestPyGithub") + def testCreateAuthorizationWithoutArguments(self): authorization = self.user.create_authorization() self.assertEqual(authorization.id, 372259) diff --git a/github/tests/Organization.py b/github/tests/Organization.py index c69e6106..08db9120 100644 --- a/github/tests/Organization.py +++ b/github/tests/Organization.py @@ -113,6 +113,10 @@ class Organization(Framework.TestCase): repo = self.org.create_repo("TestPyGithub2", "Repo created by PyGithub", "http://foobar.com", False, False, False, False, team) self.assertEqual(repo.url, "https://api.github.com/repos/BeaverSoftware/TestPyGithub2") + def testCreateRepositoryWithAutoInit(self): + repo = self.org.create_repo("TestPyGithub", auto_init=True, gitignore_template="Python") + self.assertEqual(repo.url, "https://api.github.com/repos/BeaverSoftware/TestPyGithub") + def testCreateFork(self): pygithub = self.g.get_user("jacquev6").get_repo("PyGithub") repo = self.org.create_fork(pygithub) diff --git a/github/tests/ReplayData/AuthenticatedUser.testCreateRepositoryWithAutoInit.txt b/github/tests/ReplayData/AuthenticatedUser.testCreateRepositoryWithAutoInit.txt new file mode 100644 index 00000000..eddc90a5 --- /dev/null +++ b/github/tests/ReplayData/AuthenticatedUser.testCreateRepositoryWithAutoInit.txt @@ -0,0 +1,5 @@ +https POST api.github.com None /user/repos {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"gitignore_template": "Python", "name": "TestPyGithub", "auto_init": true} +201 +[('status', '201 Created'), ('content-length', '1176'), ('x-github-media-type', 'github.beta; format=json'), ('x-content-type-options', 'nosniff'), ('x-ratelimit-limit', '5000'), ('x-ratelimit-remaining', '4999'), ('server', 'nginx'), ('connection', 'keep-alive'), ('etag', '"762d15bfe4477f7ec15c3c08a07da857"'), ('location', 'https://api.github.com/repos/jacquev6/TestPyGithub'), ('cache-control', 'max-age=0, private, must-revalidate'), ('date', 'Sat, 03 Nov 2012 09:01:00 GMT'), ('content-type', 'application/json; charset=utf-8')] +{"watchers":0,"pushed_at":"2012-11-03T09:00:59Z","forks":0,"has_issues":true,"has_downloads":true,"open_issues_count":0,"description":null,"html_url":"https://github.com/jacquev6/TestPyGithub","owner":{"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png","url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146},"url":"https://api.github.com/repos/jacquev6/TestPyGithub","updated_at":"2012-11-03T09:01:00Z","permissions":{"push":true,"pull":true,"admin":true},"mirror_url":null,"clone_url":"https://github.com/jacquev6/TestPyGithub.git","language":null,"has_wiki":true,"ssh_url":"git@github.com:jacquev6/TestPyGithub.git","svn_url":"https://github.com/jacquev6/TestPyGithub","size":0,"fork":false,"full_name":"jacquev6/TestPyGithub","open_issues":0,"git_url":"git://github.com/jacquev6/TestPyGithub.git","forks_count":0,"name":"TestPyGithub","created_at":"2012-11-03T09:00:59Z","homepage":null,"private":false,"id":6517838,"master_branch":"master","network_count":0,"watchers_count":0} + diff --git a/github/tests/ReplayData/Organization.testCreateRepositoryWithAutoInit.txt b/github/tests/ReplayData/Organization.testCreateRepositoryWithAutoInit.txt new file mode 100644 index 00000000..cb71243b --- /dev/null +++ b/github/tests/ReplayData/Organization.testCreateRepositoryWithAutoInit.txt @@ -0,0 +1,5 @@ +https POST api.github.com None /orgs/BeaverSoftware/repos {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"gitignore_template": "Python", "name": "TestPyGithub", "auto_init": true} +201 +[('status', '201 Created'), ('content-length', '1559'), ('x-github-media-type', 'github.beta; format=json'), ('x-content-type-options', 'nosniff'), ('x-ratelimit-limit', '5000'), ('x-ratelimit-remaining', '4996'), ('server', 'nginx'), ('connection', 'keep-alive'), ('etag', '"2f35ceac1b69bbfc8c38907877514e9d"'), ('location', 'https://api.github.com/repos/BeaverSoftware/TestPyGithub'), ('cache-control', 'max-age=0, private, must-revalidate'), ('date', 'Sat, 03 Nov 2012 09:03:49 GMT'), ('content-type', 'application/json; charset=utf-8')] +{"watchers":0,"pushed_at":"2012-11-03T09:03:49Z","forks":0,"has_issues":true,"has_downloads":true,"open_issues_count":0,"description":null,"html_url":"https://github.com/BeaverSoftware/TestPyGithub","owner":{"avatar_url":"https://secure.gravatar.com/avatar/d563e337cac2fdc644e2aaaad1e23266?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-org-420.png","url":"https://api.github.com/users/BeaverSoftware","gravatar_id":"d563e337cac2fdc644e2aaaad1e23266","login":"BeaverSoftware","id":1424031},"url":"https://api.github.com/repos/BeaverSoftware/TestPyGithub","updated_at":"2012-11-03T09:03:49Z","organization":{"avatar_url":"https://secure.gravatar.com/avatar/d563e337cac2fdc644e2aaaad1e23266?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-org-420.png","url":"https://api.github.com/users/BeaverSoftware","gravatar_id":"d563e337cac2fdc644e2aaaad1e23266","login":"BeaverSoftware","id":1424031},"permissions":{"push":true,"pull":true,"admin":true},"mirror_url":null,"clone_url":"https://github.com/BeaverSoftware/TestPyGithub.git","language":null,"has_wiki":true,"ssh_url":"git@github.com:BeaverSoftware/TestPyGithub.git","svn_url":"https://github.com/BeaverSoftware/TestPyGithub","size":0,"fork":false,"full_name":"BeaverSoftware/TestPyGithub","open_issues":0,"git_url":"git://github.com/BeaverSoftware/TestPyGithub.git","forks_count":0,"name":"TestPyGithub","created_at":"2012-11-03T09:03:49Z","homepage":null,"private":false,"id":6517856,"master_branch":"master","network_count":0,"watchers_count":0} + From 4f2030ad6c67ee3f113a5eced839fc1a3737a8ce Mon Sep 17 00:00:00 2001 From: Michael Woodworth Date: Wed, 7 Nov 2012 18:15:27 -0500 Subject: [PATCH 34/62] added client_id and client_secret auth option --- github/Github.py | 4 ++-- github/Requester.py | 13 ++++++++++++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/github/Github.py b/github/Github.py index 60f8be1f..9bb2cca9 100644 --- a/github/Github.py +++ b/github/Github.py @@ -30,8 +30,8 @@ DEFAULT_TIMEOUT = 10 class Github(object): - def __init__(self, login_or_token=None, password=None, base_url=DEFAULT_BASE_URL, timeout=DEFAULT_TIMEOUT): - self.__requester = Requester(login_or_token, password, base_url, timeout) + def __init__(self, login_or_token=None, password=None, base_url=DEFAULT_BASE_URL, timeout=DEFAULT_TIMEOUT, client_id=None, client_secret=None): + self.__requester = Requester(login_or_token, password, base_url, timeout, client_id, client_secret) @property def FIX_REPO_GET_GIT_REF(self): diff --git a/github/Requester.py b/github/Requester.py index 1f3214f8..2dc08f7b 100644 --- a/github/Requester.py +++ b/github/Requester.py @@ -37,7 +37,7 @@ class Requester: cls.__httpConnectionClass = httpConnectionClass cls.__httpsConnectionClass = httpsConnectionClass - def __init__(self, login_or_token, password, base_url, timeout): + def __init__(self, login_or_token, password, base_url, timeout, client_id=None, client_secret=None): if password is not None: login = login_or_token self.__authorizationHeader = "Basic " + base64.b64encode(login + ":" + password).replace('\n', '') @@ -63,6 +63,9 @@ class Requester: self.rate_limiting = (5000, 5000) self.FIX_REPO_GET_GIT_REF = True + self.__client_id = client_id + self.__client_secret = client_secret + def requestAndCheck(self, verb, url, parameters, input): status, headers, output = self.requestRaw(verb, url, parameters, input) output = self.__structuredFromJson(output) @@ -129,6 +132,14 @@ class Requester: return status, responseHeaders, output def __completeUrl(self, url, parameters): + if self.__client_id and self.__client_secret: + client_parameters = {'client_id': self.__client_id, 'client_secret': self.__client_secret} + if parameters is None or len(parameters) == 0: + return url + '?' + urllib.urlencode(client_parameters) + else: + return url + "?" + urllib.urlencode(parameters) + '&' + urllib.urlencode(client_parameters) + + #there is no client id and secret if parameters is None or len(parameters) == 0: return url else: From db1f6812a4d7bdfd98d5ba48a38a439ceed70a7c Mon Sep 17 00:00:00 2001 From: Tim Babych Date: Wed, 14 Nov 2012 01:15:03 +0200 Subject: [PATCH 35/62] typo in ReadMe.md --- ReadMe.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReadMe.md b/ReadMe.md index c3ad6035..167445f9 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -32,7 +32,7 @@ You can also clone it on [Github](http://github.com/jacquev6/PyGithub). Tutorial ======== -First create a Gihtub instance: +First create a Github instance: from github import Github From 0038aea74eb3e92b96b60dd847a48e306b64db42 Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Mon, 19 Nov 2012 20:27:00 +0100 Subject: [PATCH 36/62] Add tests for pull #112 --- github/tests/Authentication.py | 5 +++++ github/tests/Framework.py | 5 +++++ .../Authentication.testSecretKeyAuthentication.txt | 10 ++++++++++ 3 files changed, 20 insertions(+) create mode 100644 github/tests/ReplayData/Authentication.testSecretKeyAuthentication.txt diff --git a/github/tests/Authentication.py b/github/tests/Authentication.py index 91bb1e04..61617edc 100644 --- a/github/tests/Authentication.py +++ b/github/tests/Authentication.py @@ -29,3 +29,8 @@ class Authentication(Framework.BasicTestCase): def testOAuthAuthentication(self): g = github.Github(self.oauth_token) self.assertEqual(g.get_user("jacquev6").name, "Vincent Jacques") + + # Warning: I don't have a scret key, so the requests for this test are forged + def testSecretKeyAuthentication(self): + g = github.Github(client_id=self.client_id,client_secret=self.client_secret) + self.assertListKeyEqual(g.get_organization("BeaverSoftware").get_repos("public"), lambda r: r.name, ["FatherBeaver", "PyGithub"]) diff --git a/github/tests/Framework.py b/github/tests/Framework.py index b21c276c..f9c38c6d 100644 --- a/github/tests/Framework.py +++ b/github/tests/Framework.py @@ -141,6 +141,9 @@ class BasicTestCase(unittest.TestCase): self.login = GithubCredentials.login self.password = GithubCredentials.password self.oauth_token = GithubCredentials.oauth_token + # @todo Remove client_id and client_secret from ReplayData (as we already remove login, password and oauth_token) + # self.client_id = GithubCredentials.client_id + # self.client_secret = GithubCredentials.client_secret else: github.Requester.Requester.injectConnectionClasses( lambda ignored, *args, **kwds: ReplayingHttpConnection(self, self.__openFile("r"), *args, **kwds), @@ -149,6 +152,8 @@ class BasicTestCase(unittest.TestCase): self.login = "login" self.password = "password" self.oauth_token = "oauth_token" + self.client_id = "client_id" + self.client_secret = "client_secret" def tearDown(self): unittest.TestCase.tearDown(self) diff --git a/github/tests/ReplayData/Authentication.testSecretKeyAuthentication.txt b/github/tests/ReplayData/Authentication.testSecretKeyAuthentication.txt new file mode 100644 index 00000000..bd81dc41 --- /dev/null +++ b/github/tests/ReplayData/Authentication.testSecretKeyAuthentication.txt @@ -0,0 +1,10 @@ +https GET api.github.com None /orgs/BeaverSoftware?client_secret=client_secret&client_id=client_id {} null +200 +[('status', '200 OK'), ('x-ratelimit-remaining', '4997'), ('content-length', '716'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"bd349122929faf5f9be3e53d9ad41d08"'), ('date', 'Fri, 11 May 2012 09:07:56 GMT'), ('content-type', 'application/json; charset=utf-8')] +{"type":"Organization","url":"https://api.github.com/orgs/BeaverSoftware","billing_email":"BeaverSoftware@vincent-jacques.net","disk_usage":112,"plan":{"private_repos":0,"space":307200,"name":"free"},"html_url":"https://github.com/BeaverSoftware","blog":null,"login":"BeaverSoftware","public_gists":0,"email":null,"avatar_url":"https://secure.gravatar.com/avatar/d563e337cac2fdc644e2aaaad1e23266?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png","total_private_repos":0,"private_gists":0,"collaborators":0,"created_at":"2012-02-09T19:20:12Z","company":null,"location":"Paris, France","followers":0,"following":0,"name":null,"owned_private_repos":0,"id":1424031,"public_repos":2} + +https GET api.github.com None /orgs/BeaverSoftware/repos?type=public&client_secret=client_secret&client_id=client_id {} null +200 +[('status', '200 OK'), ('x-ratelimit-remaining', '4987'), ('content-length', '2291'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"4bcc5321db433ac18171c121303c77d2"'), ('date', 'Tue, 29 May 2012 18:11:16 GMT'), ('content-type', 'application/json; charset=utf-8')] +[{"mirror_url":null,"clone_url":"https://github.com/BeaverSoftware/FatherBeaver.git","has_downloads":true,"watchers":2,"updated_at":"2012-02-16T21:51:15Z","permissions":{"pull":true,"admin":true,"push":true},"homepage":"","url":"https://api.github.com/repos/BeaverSoftware/FatherBeaver","html_url":"https://github.com/BeaverSoftware/FatherBeaver","has_wiki":true,"has_issues":true,"fork":false,"git_url":"git://github.com/BeaverSoftware/FatherBeaver.git","forks":1,"size":0,"private":false,"open_issues":0,"svn_url":"https://github.com/BeaverSoftware/FatherBeaver","owner":{"url":"https://api.github.com/users/BeaverSoftware","avatar_url":"https://secure.gravatar.com/avatar/d563e337cac2fdc644e2aaaad1e23266?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png","gravatar_id":"d563e337cac2fdc644e2aaaad1e23266","login":"BeaverSoftware","id":1424031},"name":"FatherBeaver","language":null,"description":"","ssh_url":"git@github.com:BeaverSoftware/FatherBeaver.git","pushed_at":null,"created_at":"2012-02-09T19:32:21Z","id":3400397,"full_name":"BeaverSoftware/FatherBeaver"},{"mirror_url":null,"clone_url":"https://github.com/BeaverSoftware/PyGithub.git","has_downloads":true,"watchers":1,"updated_at":"2012-05-29T18:09:14Z","permissions":{"pull":true,"admin":true,"push":true},"homepage":"http://vincent-jacques.net/PyGithub","url":"https://api.github.com/repos/BeaverSoftware/PyGithub","html_url":"https://github.com/BeaverSoftware/PyGithub","has_wiki":false,"has_issues":false,"fork":true,"git_url":"git://github.com/BeaverSoftware/PyGithub.git","forks":0,"size":428,"private":false,"open_issues":0,"svn_url":"https://github.com/BeaverSoftware/PyGithub","owner":{"url":"https://api.github.com/users/BeaverSoftware","avatar_url":"https://secure.gravatar.com/avatar/d563e337cac2fdc644e2aaaad1e23266?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png","gravatar_id":"d563e337cac2fdc644e2aaaad1e23266","login":"BeaverSoftware","id":1424031},"name":"PyGithub","language":"Python","description":"Python library implementing the full Github API v3","ssh_url":"git@github.com:BeaverSoftware/PyGithub.git","pushed_at":"2012-05-29T18:05:10Z","created_at":"2012-05-29T18:03:19Z","id":4485562,"full_name":"BeaverSoftware/PyGithub"}] + From ef55a93d9a2853948363fdea17e742215efb058c Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Mon, 19 Nov 2012 20:31:33 +0100 Subject: [PATCH 37/62] Refactor --- github/Requester.py | 18 ++++++++---------- ...hentication.testSecretKeyAuthentication.txt | 2 +- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/github/Requester.py b/github/Requester.py index 2cd8b6c7..2167e08e 100644 --- a/github/Requester.py +++ b/github/Requester.py @@ -65,8 +65,8 @@ class Requester: self.rate_limiting = (5000, 5000) self.FIX_REPO_GET_GIT_REF = True - self.__client_id = client_id - self.__client_secret = client_secret + self.__clientId = client_id + self.__clientSecret = client_secret def requestAndCheck(self, verb, url, parameters, input): status, headers, output = self.requestRaw(verb, url, parameters, input) @@ -78,6 +78,12 @@ class Requester: def requestRaw(self, verb, url, parameters, input): assert verb in ["HEAD", "GET", "POST", "PATCH", "PUT", "DELETE"] + if self.__clientId and self.__clientSecret: + if parameters is None: + parameters = dict() + parameters["client_id"] = self.__clientId + parameters["client_secret"] = self.__clientSecret + # URLs generated locally will be relative to __base_url # URLs returned from the server will start with __base_url if url.startswith("/"): @@ -134,14 +140,6 @@ class Requester: return status, responseHeaders, output def __completeUrl(self, url, parameters): - if self.__client_id and self.__client_secret: - client_parameters = {'client_id': self.__client_id, 'client_secret': self.__client_secret} - if parameters is None or len(parameters) == 0: - return url + '?' + urllib.urlencode(client_parameters) - else: - return url + "?" + urllib.urlencode(parameters) + '&' + urllib.urlencode(client_parameters) - - #there is no client id and secret if parameters is None or len(parameters) == 0: return url else: diff --git a/github/tests/ReplayData/Authentication.testSecretKeyAuthentication.txt b/github/tests/ReplayData/Authentication.testSecretKeyAuthentication.txt index bd81dc41..009c043a 100644 --- a/github/tests/ReplayData/Authentication.testSecretKeyAuthentication.txt +++ b/github/tests/ReplayData/Authentication.testSecretKeyAuthentication.txt @@ -3,7 +3,7 @@ https GET api.github.com None /orgs/BeaverSoftware?client_secret=client_secret&c [('status', '200 OK'), ('x-ratelimit-remaining', '4997'), ('content-length', '716'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"bd349122929faf5f9be3e53d9ad41d08"'), ('date', 'Fri, 11 May 2012 09:07:56 GMT'), ('content-type', 'application/json; charset=utf-8')] {"type":"Organization","url":"https://api.github.com/orgs/BeaverSoftware","billing_email":"BeaverSoftware@vincent-jacques.net","disk_usage":112,"plan":{"private_repos":0,"space":307200,"name":"free"},"html_url":"https://github.com/BeaverSoftware","blog":null,"login":"BeaverSoftware","public_gists":0,"email":null,"avatar_url":"https://secure.gravatar.com/avatar/d563e337cac2fdc644e2aaaad1e23266?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png","total_private_repos":0,"private_gists":0,"collaborators":0,"created_at":"2012-02-09T19:20:12Z","company":null,"location":"Paris, France","followers":0,"following":0,"name":null,"owned_private_repos":0,"id":1424031,"public_repos":2} -https GET api.github.com None /orgs/BeaverSoftware/repos?type=public&client_secret=client_secret&client_id=client_id {} null +https GET api.github.com None /orgs/BeaverSoftware/repos?client_secret=client_secret&type=public&client_id=client_id {} null 200 [('status', '200 OK'), ('x-ratelimit-remaining', '4987'), ('content-length', '2291'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"4bcc5321db433ac18171c121303c77d2"'), ('date', 'Tue, 29 May 2012 18:11:16 GMT'), ('content-type', 'application/json; charset=utf-8')] [{"mirror_url":null,"clone_url":"https://github.com/BeaverSoftware/FatherBeaver.git","has_downloads":true,"watchers":2,"updated_at":"2012-02-16T21:51:15Z","permissions":{"pull":true,"admin":true,"push":true},"homepage":"","url":"https://api.github.com/repos/BeaverSoftware/FatherBeaver","html_url":"https://github.com/BeaverSoftware/FatherBeaver","has_wiki":true,"has_issues":true,"fork":false,"git_url":"git://github.com/BeaverSoftware/FatherBeaver.git","forks":1,"size":0,"private":false,"open_issues":0,"svn_url":"https://github.com/BeaverSoftware/FatherBeaver","owner":{"url":"https://api.github.com/users/BeaverSoftware","avatar_url":"https://secure.gravatar.com/avatar/d563e337cac2fdc644e2aaaad1e23266?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png","gravatar_id":"d563e337cac2fdc644e2aaaad1e23266","login":"BeaverSoftware","id":1424031},"name":"FatherBeaver","language":null,"description":"","ssh_url":"git@github.com:BeaverSoftware/FatherBeaver.git","pushed_at":null,"created_at":"2012-02-09T19:32:21Z","id":3400397,"full_name":"BeaverSoftware/FatherBeaver"},{"mirror_url":null,"clone_url":"https://github.com/BeaverSoftware/PyGithub.git","has_downloads":true,"watchers":1,"updated_at":"2012-05-29T18:09:14Z","permissions":{"pull":true,"admin":true,"push":true},"homepage":"http://vincent-jacques.net/PyGithub","url":"https://api.github.com/repos/BeaverSoftware/PyGithub","html_url":"https://github.com/BeaverSoftware/PyGithub","has_wiki":false,"has_issues":false,"fork":true,"git_url":"git://github.com/BeaverSoftware/PyGithub.git","forks":0,"size":428,"private":false,"open_issues":0,"svn_url":"https://github.com/BeaverSoftware/PyGithub","owner":{"url":"https://api.github.com/users/BeaverSoftware","avatar_url":"https://secure.gravatar.com/avatar/d563e337cac2fdc644e2aaaad1e23266?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png","gravatar_id":"d563e337cac2fdc644e2aaaad1e23266","login":"BeaverSoftware","id":1424031},"name":"PyGithub","language":"Python","description":"Python library implementing the full Github API v3","ssh_url":"git@github.com:BeaverSoftware/PyGithub.git","pushed_at":"2012-05-29T18:05:10Z","created_at":"2012-05-29T18:03:19Z","id":4485562,"full_name":"BeaverSoftware/PyGithub"}] From 3c07876a9604cbda5a28b470744be6d7b08940e1 Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Mon, 19 Nov 2012 20:44:14 +0100 Subject: [PATCH 38/62] Refactor Requester --- github/Requester.py | 97 +++++++++++++++++++++++++-------------------- 1 file changed, 55 insertions(+), 42 deletions(-) diff --git a/github/Requester.py b/github/Requester.py index 2167e08e..6f414bf6 100644 --- a/github/Requester.py +++ b/github/Requester.py @@ -61,7 +61,7 @@ class Requester: elif o.scheme == "http": self.__connectionClass = self.__httpConnectionClass else: - assert(False) # pragma no cover + assert False, "Unknown URL scheme" # pragma no cover self.rate_limiting = (5000, 5000) self.FIX_REPO_GET_GIT_REF = True @@ -75,40 +75,27 @@ class Requester: raise GithubException.GithubException(status, output) return headers, output + def __structuredFromJson(self, data): + if len(data) == 0: + return None + else: + return json.loads(data) + def requestRaw(self, verb, url, parameters, input): assert verb in ["HEAD", "GET", "POST", "PATCH", "PUT", "DELETE"] - - if self.__clientId and self.__clientSecret: - if parameters is None: - parameters = dict() - parameters["client_id"] = self.__clientId - parameters["client_secret"] = self.__clientSecret - - # URLs generated locally will be relative to __base_url - # URLs returned from the server will start with __base_url - if url.startswith("/"): - url = self.__prefix + url - else: - o = urlparse.urlparse(url) - assert o.scheme == self.__scheme or o.scheme == "https" and self.__scheme == "http" # Issue #80 - assert o.hostname == self.__hostname - assert o.path.startswith(self.__prefix) - assert o.port == self.__port - url = o.path - if o.query != "": - url += "?" + o.query - url = self.__completeUrl(url, parameters) + if parameters is None: + parameters = dict() requestHeaders = dict() + self.__authenticate(requestHeaders, parameters) + + url = self.__makeAbsoluteUrl(url) + url = self.__addParametersToUrl(url, parameters) + if input is not None: requestHeaders["Content-Type"] = "application/json" - if self.__authorizationHeader is not None: - requestHeaders["Authorization"] = self.__authorizationHeader - if atLeastPython26: - cnx = self.__connectionClass(host=self.__hostname, port=self.__port, strict=True, timeout=self.__timeout) - else: # pragma no cover - cnx = self.__connectionClass(host=self.__hostname, port=self.__port, strict=True) # pragma no cover + cnx = self.__createConnection() cnx.request( verb, url, @@ -126,6 +113,46 @@ class Requester: if "x-ratelimit-remaining" in responseHeaders and "x-ratelimit-limit" in responseHeaders: self.rate_limiting = (int(responseHeaders["x-ratelimit-remaining"]), int(responseHeaders["x-ratelimit-limit"])) + self.__log(verb, url, requestHeaders, input, status, responseHeaders, output) + + return status, responseHeaders, output + + def __authenticate(self, requestHeaders, parameters): + if self.__clientId and self.__clientSecret: + parameters["client_id"] = self.__clientId + parameters["client_secret"] = self.__clientSecret + if self.__authorizationHeader is not None: + requestHeaders["Authorization"] = self.__authorizationHeader + + def __makeAbsoluteUrl(self, url): + # URLs generated locally will be relative to __base_url + # URLs returned from the server will start with __base_url + if url.startswith("/"): + url = self.__prefix + url + else: + o = urlparse.urlparse(url) + assert o.scheme == self.__scheme or o.scheme == "https" and self.__scheme == "http" # Issue #80 + assert o.hostname == self.__hostname + assert o.path.startswith(self.__prefix) + assert o.port == self.__port + url = o.path + if o.query != "": + url += "?" + o.query + return url + + def __addParametersToUrl(self, url, parameters): + if len(parameters) == 0: + return url + else: + return url + "?" + urllib.urlencode(parameters) + + def __createConnection(self): + if atLeastPython26: + return self.__connectionClass(host=self.__hostname, port=self.__port, strict=True, timeout=self.__timeout) + else: # pragma no cover + return self.__connectionClass(host=self.__hostname, port=self.__port, strict=True) # pragma no cover + + def __log(self, verb, url, requestHeaders, input, status, responseHeaders, output): logger = logging.getLogger(__name__) if logger.isEnabledFor(logging.DEBUG): if "Authorization" in requestHeaders: @@ -136,17 +163,3 @@ class Requester: else: # pragma no cover requestHeaders["Authorization"] = "Unknown authorization removed" logger.debug("%s %s://%s%s %s %s ==> %i %s %s", str(verb), self.__scheme, self.__hostname, str(url), str(requestHeaders), str(input), status, str(responseHeaders), str(output)) - - return status, responseHeaders, output - - def __completeUrl(self, url, parameters): - if parameters is None or len(parameters) == 0: - return url - else: - return url + "?" + urllib.urlencode(parameters) - - def __structuredFromJson(self, data): - if len(data) == 0: - return None - else: - return json.loads(data) From 94bdbe13a4bcb8575a22b19b65886c3691a77673 Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Mon, 19 Nov 2012 20:59:58 +0100 Subject: [PATCH 39/62] Change URL of gist comments (issue #113) --- github/Gist.py | 2 +- github/tests/GistComment.py | 2 +- github/tests/ReplayData/GistComment.setUp.txt | 4 ++-- github/tests/ReplayData/GistComment.testDelete.txt | 2 +- github/tests/ReplayData/GistComment.testEdit.txt | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/github/Gist.py b/github/Gist.py index f583a321..9f6de4d1 100644 --- a/github/Gist.py +++ b/github/Gist.py @@ -150,7 +150,7 @@ class Gist(GithubObject.GithubObject): assert isinstance(id, int), id headers, data = self._requester.requestAndCheck( "GET", - "/gists/comments/" + str(id), + self.url + "/comments/" + str(id), None, None ) diff --git a/github/tests/GistComment.py b/github/tests/GistComment.py index a4d30630..9734fa56 100644 --- a/github/tests/GistComment.py +++ b/github/tests/GistComment.py @@ -28,7 +28,7 @@ class GistComment(Framework.TestCase): self.assertEquals(self.comment.created_at, datetime.datetime(2012, 5, 19, 7, 7, 57)) self.assertEquals(self.comment.id, 323629) self.assertEquals(self.comment.updated_at, datetime.datetime(2012, 5, 19, 7, 7, 57)) - self.assertEquals(self.comment.url, "https://api.github.com/gists/comments/323629") + self.assertEquals(self.comment.url, "https://api.github.com/gists/2729810/comments/323629") self.assertEquals(self.comment.user.login, "jacquev6") def testEdit(self): diff --git a/github/tests/ReplayData/GistComment.setUp.txt b/github/tests/ReplayData/GistComment.setUp.txt index 1f35ba10..bad1d596 100644 --- a/github/tests/ReplayData/GistComment.setUp.txt +++ b/github/tests/ReplayData/GistComment.setUp.txt @@ -3,8 +3,8 @@ https GET api.github.com None /gists/2729810 {'Authorization': 'Basic login_and_ [('status', '200 OK'), ('x-ratelimit-remaining', '4970'), ('content-length', '3280'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"b01fb6ac81527f99db9f6f586b048ee3"'), ('date', 'Sat, 19 May 2012 06:58:15 GMT'), ('content-type', 'application/json; charset=utf-8')] {"updated_at":"2012-02-29T16:47:12Z","forks":[],"url":"https://api.github.com/gists/2729810","comments":0,"public":true,"git_pull_url":"git://gist.github.com/2729810.git","files":{"fail_github.py":{"type":"application/python","raw_url":"https://gist.github.com/raw/2729810/2fb3aa84e0efa50dc0f4c18b5df5b7b9ab27076b/fail_github.py","size":1636,"filename":"fail_github.py","content":"import httplib\nimport base64\nimport json\n\nlogin = \"\"\npassword = \"\"\norgName = \"\"\nrepoName = \"FailGithubApi\"\n\ndef doRequest( verb, url, input ):\n input = json.dumps( input )\n cnx = httplib.HTTPSConnection( \"api.github.com\", strict = True )\n cnx.request( verb, url, input, { \"Authorization\" : \"Basic \" + base64.b64encode( login + \":\" + password ).replace( '\\n', '' ) } )\n response = cnx.getresponse()\n status = response.status\n output = response.read()\n cnx.close()\n print verb, url, input, \"=>\", status, output\n print\n if status < 200 or status >= 300:\n exit( 1 )\n return json.loads( output )\n\n# Create a repo\ndoRequest( \"POST\", \"/user/repos\", { \"name\": repoName } )\n\n# Create a blob, a tree, a commit and the master branch\nb = doRequest(\n \"POST\", \"/repos/%s/%s/git/blobs\" % ( login, repoName ),\n { \"content\": \"Content of the blob\", \"encoding\": \"latin1\" }\n)\nt = doRequest(\n \"POST\", \"/repos/%s/%s/git/trees\" % ( login, repoName ),\n { \"tree\" : [ { \"path\": \"foo.bar\", \"type\": \"blob\", \"mode\": \"100644\", \"sha\": b[\"sha\"] } ] }\n)\nc = doRequest(\n \"POST\", \"/repos/%s/%s/git/commits\" % ( login, repoName ),\n { \"parents\": [], \"message\": \"Message of the commit\", \"tree\": t[\"sha\"] }\n)\ndoRequest(\n \"POST\", \"/repos/%s/%s/git/refs\" % ( login, repoName ),\n { \"ref\": \"refs/heads/master\", \"sha\": c[\"sha\"] }\n)\n\n# Fork the repo\ndoRequest( \"POST\", \"/repos/%s/%s/forks?org=%s\" % ( login, repoName, orgName ), None )\n\n# Create a new blob => BOOM error 500\ndoRequest(\n \"POST\", \"/repos/%s/%s/git/blobs\" % ( orgName, repoName ),\n { \"content\": \"Content of the new blob\", \"encoding\": \"latin1\" }\n)\n","language":"Python"}},"html_url":"https://gist.github.com/2729810","git_push_url":"git@gist.github.com:2729810.git","user":{"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146},"description":"How to error 500 Github API v3, as requested by Rick (GitHub Staff)","created_at":"2012-02-29T16:47:12Z","id":"2729810","history":[{"url":"https://api.github.com/gists/2729810/a40de483e42ba33bda308371c0ef8383db73be9e","change_status":{"deletions":0,"additions":52,"total":52},"committed_at":"2012-02-29T16:47:12Z","version":"a40de483e42ba33bda308371c0ef8383db73be9e","user":{"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146}}]} -https GET api.github.com None /gists/comments/323629 {'Authorization': 'Basic login_and_password_removed'} null +https GET api.github.com None /gists/2729810/comments/323629 {'Authorization': 'Basic login_and_password_removed'} null 200 [('status', '200 OK'), ('content-length', '479'), ('x-ratelimit-limit', '5000'), ('x-ratelimit-remaining', '4988'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('etag', '"c2581153865c9b18a576589587e1fb98"'), ('date', 'Sat, 19 May 2012 07:12:31 GMT'), ('content-type', 'application/json; charset=utf-8')] -{"url":"https://api.github.com/gists/comments/323629","body":"Comment created by PyGithub","created_at":"2012-05-19T07:07:57Z","updated_at":"2012-05-19T07:07:57Z","id":323629,"user":{"url":"https://api.github.com/users/jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","id":327146}} +{"url":"https://api.github.com/gists/2729810/comments/323629","body":"Comment created by PyGithub","created_at":"2012-05-19T07:07:57Z","updated_at":"2012-05-19T07:07:57Z","id":323629,"user":{"url":"https://api.github.com/users/jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","id":327146}} diff --git a/github/tests/ReplayData/GistComment.testDelete.txt b/github/tests/ReplayData/GistComment.testDelete.txt index 55599972..871d1fac 100644 --- a/github/tests/ReplayData/GistComment.testDelete.txt +++ b/github/tests/ReplayData/GistComment.testDelete.txt @@ -1,4 +1,4 @@ -https DELETE api.github.com None /gists/comments/323629 {'Authorization': 'Basic login_and_password_removed'} null +https DELETE api.github.com None /gists/2729810/comments/323629 {'Authorization': 'Basic login_and_password_removed'} null 204 [('status', '204 No Content'), ('x-ratelimit-remaining', '4984'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"d41d8cd98f00b204e9800998ecf8427e"'), ('date', 'Sat, 19 May 2012 07:14:33 GMT')] diff --git a/github/tests/ReplayData/GistComment.testEdit.txt b/github/tests/ReplayData/GistComment.testEdit.txt index 0630398e..0fd1d93d 100644 --- a/github/tests/ReplayData/GistComment.testEdit.txt +++ b/github/tests/ReplayData/GistComment.testEdit.txt @@ -1,5 +1,5 @@ -https PATCH api.github.com None /gists/comments/323629 {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"body": "Comment edited by PyGithub"} +https PATCH api.github.com None /gists/2729810/comments/323629 {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed'} {"body": "Comment edited by PyGithub"} 200 [('status', '200 OK'), ('content-length', '478'), ('x-ratelimit-limit', '5000'), ('x-ratelimit-remaining', '4987'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('etag', '"cea8090368993f1fb95c32cdcf4245d3"'), ('date', 'Sat, 19 May 2012 07:12:32 GMT'), ('content-type', 'application/json; charset=utf-8')] -{"url":"https://api.github.com/gists/comments/323629","body":"Comment edited by PyGithub","created_at":"2012-05-19T07:07:57Z","updated_at":"2012-05-19T07:12:32Z","id":323629,"user":{"url":"https://api.github.com/users/jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","id":327146}} +{"url":"https://api.github.com/gists/2729810/comments/323629","body":"Comment edited by PyGithub","created_at":"2012-05-19T07:07:57Z","updated_at":"2012-05-19T07:12:32Z","id":323629,"user":{"url":"https://api.github.com/users/jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","id":327146}} From 63a56e074a4ecfd82c8dae1c7e2d6ddf08c07edb Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Mon, 19 Nov 2012 21:18:43 +0100 Subject: [PATCH 40/62] Add a customizable User-Agent (issue #109) --- github/Github.py | 4 ++-- github/Requester.py | 5 ++++- github/tests/Authentication.py | 4 ++++ github/tests/ReplayData/Authentication.testUserAgent.txt | 5 +++++ 4 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 github/tests/ReplayData/Authentication.testUserAgent.txt diff --git a/github/Github.py b/github/Github.py index 413072b7..32d69c91 100644 --- a/github/Github.py +++ b/github/Github.py @@ -32,8 +32,8 @@ DEFAULT_TIMEOUT = 10 class Github(object): - def __init__(self, login_or_token=None, password=None, base_url=DEFAULT_BASE_URL, timeout=DEFAULT_TIMEOUT, client_id=None, client_secret=None): - self.__requester = Requester(login_or_token, password, base_url, timeout, client_id, client_secret) + def __init__(self, login_or_token=None, password=None, base_url=DEFAULT_BASE_URL, timeout=DEFAULT_TIMEOUT, client_id=None, client_secret=None, user_agent=None): + self.__requester = Requester(login_or_token, password, base_url, timeout, client_id, client_secret, user_agent) def get_FIX_REPO_GET_GIT_REF(self): return self.__requester.FIX_REPO_GET_GIT_REF diff --git a/github/Requester.py b/github/Requester.py index 6f414bf6..26d28f51 100644 --- a/github/Requester.py +++ b/github/Requester.py @@ -39,7 +39,7 @@ class Requester: cls.__httpConnectionClass = httpConnectionClass cls.__httpsConnectionClass = httpsConnectionClass - def __init__(self, login_or_token, password, base_url, timeout, client_id=None, client_secret=None): + def __init__(self, login_or_token, password, base_url, timeout, client_id, client_secret, user_agent): if password is not None: login = login_or_token self.__authorizationHeader = "Basic " + base64.b64encode(login + ":" + password).replace('\n', '') @@ -67,6 +67,7 @@ class Requester: self.__clientId = client_id self.__clientSecret = client_secret + self.__userAgent = user_agent def requestAndCheck(self, verb, url, parameters, input): status, headers, output = self.requestRaw(verb, url, parameters, input) @@ -88,6 +89,8 @@ class Requester: requestHeaders = dict() self.__authenticate(requestHeaders, parameters) + if self.__userAgent is not None: + requestHeaders["User-Agent"] = self.__userAgent url = self.__makeAbsoluteUrl(url) url = self.__addParametersToUrl(url, parameters) diff --git a/github/tests/Authentication.py b/github/tests/Authentication.py index 61617edc..465d4077 100644 --- a/github/tests/Authentication.py +++ b/github/tests/Authentication.py @@ -34,3 +34,7 @@ class Authentication(Framework.BasicTestCase): def testSecretKeyAuthentication(self): g = github.Github(client_id=self.client_id,client_secret=self.client_secret) self.assertListKeyEqual(g.get_organization("BeaverSoftware").get_repos("public"), lambda r: r.name, ["FatherBeaver", "PyGithub"]) + + def testUserAgent(self): + g = github.Github(user_agent="PyGithubTester") + self.assertEqual(g.get_user("jacquev6").name, "Vincent Jacques") diff --git a/github/tests/ReplayData/Authentication.testUserAgent.txt b/github/tests/ReplayData/Authentication.testUserAgent.txt new file mode 100644 index 00000000..dfe9ff7c --- /dev/null +++ b/github/tests/ReplayData/Authentication.testUserAgent.txt @@ -0,0 +1,5 @@ +https GET api.github.com None /users/jacquev6 {'User-Agent': 'PyGithubTester'} null +200 +[('status', '200 OK'), ('content-length', '1250'), ('x-github-media-type', 'github.beta; format=json'), ('x-content-type-options', 'nosniff'), ('vary', 'Accept'), ('x-ratelimit-remaining', '57'), ('server', 'nginx'), ('last-modified', 'Mon, 19 Nov 2012 19:05:48 GMT'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '60'), ('etag', '"20bb1bc354d1c62d7c5e8b918cdbe6a1"'), ('cache-control', 'public, s-maxage=60, max-age=60'), ('date', 'Mon, 19 Nov 2012 20:14:08 GMT'), ('content-type', 'application/json; charset=utf-8')] +{"public_repos":19,"type":"User","followers_url":"https://api.github.com/users/jacquev6/followers","url":"https://api.github.com/users/jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-user-420.png","received_events_url":"https://api.github.com/users/jacquev6/received_events","following_url":"https://api.github.com/users/jacquev6/following","login":"jacquev6","blog":"http://vincent-jacques.net","following":37,"html_url":"https://github.com/jacquev6","created_at":"2010-07-09T06:10:06Z","subscriptions_url":"https://api.github.com/users/jacquev6/subscriptions","hireable":false,"gravatar_id":"b68de5ae38616c296fa345d2b9df2225","starred_url":"https://api.github.com/users/jacquev6/starred{/owner}{/repo}","gists_url":"https://api.github.com/users/jacquev6/gists{/gist_id}","bio":"","name":"Vincent Jacques","email":"vincent@vincent-jacques.net","repos_url":"https://api.github.com/users/jacquev6/repos","public_gists":2,"followers":18,"company":"Criteo","location":"Paris, France","id":327146,"events_url":"https://api.github.com/users/jacquev6/events{/privacy}","organizations_url":"https://api.github.com/users/jacquev6/orgs"} + From 86033f8a626bcb3a01a434fa7f71496b367a6903 Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Mon, 19 Nov 2012 21:40:17 +0100 Subject: [PATCH 41/62] Prepare version 1.9.0 --- ReadMe.md | 17 ++++++++++++++--- doc/ChangeLog.md | 16 ++++++++++++++++ doc/ReferenceOfClasses.md | 4 ++++ github/tests/Authentication.py | 2 +- 4 files changed, 35 insertions(+), 4 deletions(-) diff --git a/ReadMe.md b/ReadMe.md index c3ad6035..92228dd1 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -13,10 +13,21 @@ What's new? [![Build Status](https://secure.travis-ci.org/jacquev6/PyGithub.png)](http://travis-ci.org/jacquev6/PyGithub) -[Version 1.8.1](https://github.com/jacquev6/PyGithub/issues?milestone=15&state=closed) (October 28th, 2012) ------------------------------------------------------------------------------------------------------------ +[Version 1.9.0](https://github.com/jacquev6/PyGithub/issues?milestone=14&state=closed) (November 19th, 2012) +------------------------------------------------------------------------------------------------------------ -* Repository.get_git_ref prepends "refs/" to the requested references. Thank you [simon-weber](https://github.com/simon-weber) for noting the incoherence between documentation and behavior. If you feel like it's a breaking change, please see [this issue](https://github.com/jacquev6/PyGithub/issues/104) +* You can now use your client_id and client_secret to increase rate limiting without authentication +* You can now send a custom User-Agent +* PullRequest now has its 'assignee' attribute, thank you [mstead](https://github.com/mstead) +* Repository.edit now has 'default_branch' parameter +* create_repo has 'auto_init' and 'gitignore_template' parameters +* GistComment URL is changed (see http://developer.github.com/changes/2012-10-31-gist-comment-uris) +* A typo in the readme was fixed by [tymofij](https://github.com/tymofij), thank you +* Internal stuff: + * Add encoding comment to Python files, thank you [Zearin](https://github.com/Zearin) + * Restore support of Python 2.5 + * Restore coverage measurement in setup.py test + * Small refactoring Previous versions ----------------- diff --git a/doc/ChangeLog.md b/doc/ChangeLog.md index f38329c4..f8ab7d11 100644 --- a/doc/ChangeLog.md +++ b/doc/ChangeLog.md @@ -1,3 +1,19 @@ +[Version 1.9.0](https://github.com/jacquev6/PyGithub/issues?milestone=14&state=closed) (November 19th, 2012) +------------------------------------------------------------------------------------------------------------ + +* You can now use your client_id and client_secret to increase rate limiting without authentication +* You can now send a custom User-Agent +* PullRequest now has its 'assignee' attribute, thank you [mstead](https://github.com/mstead) +* Repository.edit now has 'default_branch' parameter +* create_repo has 'auto_init' and 'gitignore_template' parameters +* GistComment URL is changed (see http://developer.github.com/changes/2012-10-31-gist-comment-uris) +* A typo in the readme was fixed by [tymofij](https://github.com/tymofij), thank you +* Internal stuff: + * Add encoding comment to Python files, thank you [Zearin](https://github.com/Zearin) + * Restore support of Python 2.5 + * Restore coverage measurement in setup.py test + * Small refactoring + [Version 1.8.1](https://github.com/jacquev6/PyGithub/issues?milestone=15&state=closed) (October 28th, 2012) ----------------------------------------------------------------------------------------------------------- diff --git a/doc/ReferenceOfClasses.md b/doc/ReferenceOfClasses.md index 048354cc..e34a3882 100644 --- a/doc/ReferenceOfClasses.md +++ b/doc/ReferenceOfClasses.md @@ -10,7 +10,11 @@ Constructed from user's login and password or OAuth token or nothing: g = Github( token ) g = Github() +You can also use your client_id and client_secret: + g = github.Github(client_id="YourClientId", client_secret="YourClientSecret") + You can add an argument `base_url = "http://my.enterprise.com:8080/path/to/github"` to connect to a local install of Github (ie. Github Enterprise). +You can add an argument `user_agent` to send a custom User-Agent header to Github. Another argument, that can be passed is `timeout` which has default value `10`. Attributes diff --git a/github/tests/Authentication.py b/github/tests/Authentication.py index 465d4077..7d585933 100644 --- a/github/tests/Authentication.py +++ b/github/tests/Authentication.py @@ -32,7 +32,7 @@ class Authentication(Framework.BasicTestCase): # Warning: I don't have a scret key, so the requests for this test are forged def testSecretKeyAuthentication(self): - g = github.Github(client_id=self.client_id,client_secret=self.client_secret) + g = github.Github(client_id=self.client_id, client_secret=self.client_secret) self.assertListKeyEqual(g.get_organization("BeaverSoftware").get_repos("public"), lambda r: r.name, ["FatherBeaver", "PyGithub"]) def testUserAgent(self): From 808fe92191d287bbad6131c5a8be78b4ded745fd Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Mon, 19 Nov 2012 21:41:56 +0100 Subject: [PATCH 42/62] Publish version 1.9.0 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index eebba39f..79c9c382 100755 --- a/setup.py +++ b/setup.py @@ -53,7 +53,7 @@ class test( Command ): setup( name = "PyGithub", - version = "1.8.1", + version = "1.9.0", description = "Use the full Github API v3", author = "Vincent Jacques", author_email = "vincent@vincent-jacques.net", From a6972c03c346bfc00cf3bb4ff3849be5e634ce62 Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Tue, 20 Nov 2012 19:34:55 +0100 Subject: [PATCH 43/62] Fix assertion failure on big integers (issue #116) --- ReadMe.md | 5 +++++ doc/ChangeLog.md | 5 +++++ github/AuthenticatedUser.py | 24 ++++++++++++------------ github/Authorization.py | 2 +- github/Commit.py | 4 ++-- github/CommitComment.py | 6 +++--- github/CommitStats.py | 6 +++--- github/CommitStatus.py | 2 +- github/Comparison.py | 6 +++--- github/ContentFile.py | 2 +- github/Download.py | 6 +++--- github/File.py | 6 +++--- github/Gist.py | 4 ++-- github/GistComment.py | 2 +- github/GistFile.py | 2 +- github/GitBlob.py | 2 +- github/GitTreeElement.py | 2 +- github/Hook.py | 2 +- github/HookResponse.py | 2 +- github/Issue.py | 8 ++++---- github/IssueComment.py | 2 +- github/IssueEvent.py | 2 +- github/Legacy.py | 2 +- github/Milestone.py | 8 ++++---- github/NamedUser.py | 22 +++++++++++----------- github/Organization.py | 22 +++++++++++----------- github/PaginatedList.py | 2 +- github/Plan.py | 6 +++--- github/PullRequest.py | 22 +++++++++++----------- github/PullRequestComment.py | 6 +++--- github/Repository.py | 28 ++++++++++++++-------------- github/RepositoryKey.py | 2 +- github/Team.py | 6 +++--- github/UserKey.py | 2 +- 34 files changed, 120 insertions(+), 110 deletions(-) diff --git a/ReadMe.md b/ReadMe.md index a2d23d3c..effb87e7 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -13,6 +13,11 @@ What's new? [![Build Status](https://secure.travis-ci.org/jacquev6/PyGithub.png)](http://travis-ci.org/jacquev6/PyGithub) +[Version 1.9.1](https://github.com/jacquev6/PyGithub/issues?milestone=16&state=closed) (November 20th, 2012) +------------------------------------------------------------------------------------------------------------ + +* Fix an assertion failure when integers returned by Github do not fit in a Python `int` + [Version 1.9.0](https://github.com/jacquev6/PyGithub/issues?milestone=14&state=closed) (November 19th, 2012) ------------------------------------------------------------------------------------------------------------ diff --git a/doc/ChangeLog.md b/doc/ChangeLog.md index f8ab7d11..c8742c6b 100644 --- a/doc/ChangeLog.md +++ b/doc/ChangeLog.md @@ -1,3 +1,8 @@ +[Version 1.9.1](https://github.com/jacquev6/PyGithub/issues?milestone=16&state=closed) (November 20th, 2012) +------------------------------------------------------------------------------------------------------------ + +* Fix an assertion failure when integers returned by Github do not fit in a Python `int` + [Version 1.9.0](https://github.com/jacquev6/PyGithub/issues?milestone=14&state=closed) (November 19th, 2012) ------------------------------------------------------------------------------------------------------------ diff --git a/github/AuthenticatedUser.py b/github/AuthenticatedUser.py index f131d625..e450d5bc 100644 --- a/github/AuthenticatedUser.py +++ b/github/AuthenticatedUser.py @@ -331,7 +331,7 @@ class AuthenticatedUser(GithubObject.GithubObject): self._useAttributes(data) def get_authorization(self, id): - assert isinstance(id, int), id + assert isinstance(id, (int, long)), id headers, data = self._requester.requestAndCheck( "GET", "/authorizations/" + str(id), @@ -398,7 +398,7 @@ class AuthenticatedUser(GithubObject.GithubObject): ) def get_key(self, id): - assert isinstance(id, int), id + assert isinstance(id, (int, long)), id headers, data = self._requester.requestAndCheck( "GET", "/user/keys/" + str(id), @@ -616,7 +616,7 @@ class AuthenticatedUser(GithubObject.GithubObject): assert attributes["blog"] is None or isinstance(attributes["blog"], (str, unicode)), attributes["blog"] self._blog = attributes["blog"] if "collaborators" in attributes: # pragma no branch - assert attributes["collaborators"] is None or isinstance(attributes["collaborators"], int), attributes["collaborators"] + assert attributes["collaborators"] is None or isinstance(attributes["collaborators"], (int, long)), attributes["collaborators"] self._collaborators = attributes["collaborators"] if "company" in attributes: # pragma no branch assert attributes["company"] is None or isinstance(attributes["company"], (str, unicode)), attributes["company"] @@ -625,16 +625,16 @@ class AuthenticatedUser(GithubObject.GithubObject): assert attributes["created_at"] is None or isinstance(attributes["created_at"], (str, unicode)), attributes["created_at"] self._created_at = self._parseDatetime(attributes["created_at"]) if "disk_usage" in attributes: # pragma no branch - assert attributes["disk_usage"] is None or isinstance(attributes["disk_usage"], int), attributes["disk_usage"] + assert attributes["disk_usage"] is None or isinstance(attributes["disk_usage"], (int, long)), attributes["disk_usage"] self._disk_usage = attributes["disk_usage"] if "email" in attributes: # pragma no branch assert attributes["email"] is None or isinstance(attributes["email"], (str, unicode)), attributes["email"] self._email = attributes["email"] if "followers" in attributes: # pragma no branch - assert attributes["followers"] is None or isinstance(attributes["followers"], int), attributes["followers"] + assert attributes["followers"] is None or isinstance(attributes["followers"], (int, long)), attributes["followers"] self._followers = attributes["followers"] if "following" in attributes: # pragma no branch - assert attributes["following"] is None or isinstance(attributes["following"], int), attributes["following"] + assert attributes["following"] is None or isinstance(attributes["following"], (int, long)), attributes["following"] self._following = attributes["following"] if "gravatar_id" in attributes: # pragma no branch assert attributes["gravatar_id"] is None or isinstance(attributes["gravatar_id"], (str, unicode)), attributes["gravatar_id"] @@ -646,7 +646,7 @@ class AuthenticatedUser(GithubObject.GithubObject): assert attributes["html_url"] is None or isinstance(attributes["html_url"], (str, unicode)), attributes["html_url"] self._html_url = attributes["html_url"] if "id" in attributes: # pragma no branch - assert attributes["id"] is None or isinstance(attributes["id"], int), attributes["id"] + assert attributes["id"] is None or isinstance(attributes["id"], (int, long)), attributes["id"] self._id = attributes["id"] if "location" in attributes: # pragma no branch assert attributes["location"] is None or isinstance(attributes["location"], (str, unicode)), attributes["location"] @@ -658,22 +658,22 @@ class AuthenticatedUser(GithubObject.GithubObject): assert attributes["name"] is None or isinstance(attributes["name"], (str, unicode)), attributes["name"] self._name = attributes["name"] if "owned_private_repos" in attributes: # pragma no branch - assert attributes["owned_private_repos"] is None or isinstance(attributes["owned_private_repos"], int), attributes["owned_private_repos"] + assert attributes["owned_private_repos"] is None or isinstance(attributes["owned_private_repos"], (int, long)), attributes["owned_private_repos"] self._owned_private_repos = attributes["owned_private_repos"] if "plan" in attributes: # pragma no branch assert attributes["plan"] is None or isinstance(attributes["plan"], dict), attributes["plan"] self._plan = None if attributes["plan"] is None else Plan.Plan(self._requester, attributes["plan"], completed=False) if "private_gists" in attributes: # pragma no branch - assert attributes["private_gists"] is None or isinstance(attributes["private_gists"], int), attributes["private_gists"] + assert attributes["private_gists"] is None or isinstance(attributes["private_gists"], (int, long)), attributes["private_gists"] self._private_gists = attributes["private_gists"] if "public_gists" in attributes: # pragma no branch - assert attributes["public_gists"] is None or isinstance(attributes["public_gists"], int), attributes["public_gists"] + assert attributes["public_gists"] is None or isinstance(attributes["public_gists"], (int, long)), attributes["public_gists"] self._public_gists = attributes["public_gists"] if "public_repos" in attributes: # pragma no branch - assert attributes["public_repos"] is None or isinstance(attributes["public_repos"], int), attributes["public_repos"] + assert attributes["public_repos"] is None or isinstance(attributes["public_repos"], (int, long)), attributes["public_repos"] self._public_repos = attributes["public_repos"] if "total_private_repos" in attributes: # pragma no branch - assert attributes["total_private_repos"] is None or isinstance(attributes["total_private_repos"], int), attributes["total_private_repos"] + assert attributes["total_private_repos"] is None or isinstance(attributes["total_private_repos"], (int, long)), attributes["total_private_repos"] self._total_private_repos = attributes["total_private_repos"] if "type" in attributes: # pragma no branch assert attributes["type"] is None or isinstance(attributes["type"], (str, unicode)), attributes["type"] diff --git a/github/Authorization.py b/github/Authorization.py index 91805330..4ee1a008 100644 --- a/github/Authorization.py +++ b/github/Authorization.py @@ -116,7 +116,7 @@ class Authorization(GithubObject.GithubObject): assert attributes["created_at"] is None or isinstance(attributes["created_at"], (str, unicode)), attributes["created_at"] self._created_at = self._parseDatetime(attributes["created_at"]) if "id" in attributes: # pragma no branch - assert attributes["id"] is None or isinstance(attributes["id"], int), attributes["id"] + assert attributes["id"] is None or isinstance(attributes["id"], (int, long)), attributes["id"] self._id = attributes["id"] if "note" in attributes: # pragma no branch assert attributes["note"] is None or isinstance(attributes["note"], (str, unicode)), attributes["note"] diff --git a/github/Commit.py b/github/Commit.py index 2849285b..88610b1a 100644 --- a/github/Commit.py +++ b/github/Commit.py @@ -68,9 +68,9 @@ class Commit(GithubObject.GithubObject): def create_comment(self, body, line=GithubObject.NotSet, path=GithubObject.NotSet, position=GithubObject.NotSet): assert isinstance(body, (str, unicode)), body - assert line is GithubObject.NotSet or isinstance(line, int), line + assert line is GithubObject.NotSet or isinstance(line, (int, long)), line assert path is GithubObject.NotSet or isinstance(path, (str, unicode)), path - assert position is GithubObject.NotSet or isinstance(position, int), position + assert position is GithubObject.NotSet or isinstance(position, (int, long)), position post_parameters = { "body": body, } diff --git a/github/CommitComment.py b/github/CommitComment.py index d3e0e47f..335285de 100644 --- a/github/CommitComment.py +++ b/github/CommitComment.py @@ -122,16 +122,16 @@ class CommitComment(GithubObject.GithubObject): assert attributes["html_url"] is None or isinstance(attributes["html_url"], (str, unicode)), attributes["html_url"] self._html_url = attributes["html_url"] if "id" in attributes: # pragma no branch - assert attributes["id"] is None or isinstance(attributes["id"], int), attributes["id"] + assert attributes["id"] is None or isinstance(attributes["id"], (int, long)), attributes["id"] self._id = attributes["id"] if "line" in attributes: # pragma no branch - assert attributes["line"] is None or isinstance(attributes["line"], int), attributes["line"] + assert attributes["line"] is None or isinstance(attributes["line"], (int, long)), attributes["line"] self._line = attributes["line"] if "path" in attributes: # pragma no branch assert attributes["path"] is None or isinstance(attributes["path"], (str, unicode)), attributes["path"] self._path = attributes["path"] if "position" in attributes: # pragma no branch - assert attributes["position"] is None or isinstance(attributes["position"], int), attributes["position"] + assert attributes["position"] is None or isinstance(attributes["position"], (int, long)), attributes["position"] self._position = attributes["position"] if "updated_at" in attributes: # pragma no branch assert attributes["updated_at"] is None or isinstance(attributes["updated_at"], (str, unicode)), attributes["updated_at"] diff --git a/github/CommitStats.py b/github/CommitStats.py index 03001a24..0fed5814 100644 --- a/github/CommitStats.py +++ b/github/CommitStats.py @@ -36,11 +36,11 @@ class CommitStats(GithubObject.BasicGithubObject): def _useAttributes(self, attributes): if "additions" in attributes: # pragma no branch - assert attributes["additions"] is None or isinstance(attributes["additions"], int), attributes["additions"] + assert attributes["additions"] is None or isinstance(attributes["additions"], (int, long)), attributes["additions"] self._additions = attributes["additions"] if "deletions" in attributes: # pragma no branch - assert attributes["deletions"] is None or isinstance(attributes["deletions"], int), attributes["deletions"] + assert attributes["deletions"] is None or isinstance(attributes["deletions"], (int, long)), attributes["deletions"] self._deletions = attributes["deletions"] if "total" in attributes: # pragma no branch - assert attributes["total"] is None or isinstance(attributes["total"], int), attributes["total"] + assert attributes["total"] is None or isinstance(attributes["total"], (int, long)), attributes["total"] self._total = attributes["total"] diff --git a/github/CommitStatus.py b/github/CommitStatus.py index 08479073..62e367d4 100644 --- a/github/CommitStatus.py +++ b/github/CommitStatus.py @@ -67,7 +67,7 @@ class CommitStatus(GithubObject.BasicGithubObject): assert attributes["description"] is None or isinstance(attributes["description"], (str, unicode)), attributes["description"] self._description = attributes["description"] if "id" in attributes: # pragma no branch - assert attributes["id"] is None or isinstance(attributes["id"], int), attributes["id"] + assert attributes["id"] is None or isinstance(attributes["id"], (int, long)), attributes["id"] self._id = attributes["id"] if "state" in attributes: # pragma no branch assert attributes["state"] is None or isinstance(attributes["state"], (str, unicode)), attributes["state"] diff --git a/github/Comparison.py b/github/Comparison.py index 494240ed..c4007f5e 100644 --- a/github/Comparison.py +++ b/github/Comparison.py @@ -96,13 +96,13 @@ class Comparison(GithubObject.GithubObject): def _useAttributes(self, attributes): if "ahead_by" in attributes: # pragma no branch - assert attributes["ahead_by"] is None or isinstance(attributes["ahead_by"], int), attributes["ahead_by"] + assert attributes["ahead_by"] is None or isinstance(attributes["ahead_by"], (int, long)), attributes["ahead_by"] self._ahead_by = attributes["ahead_by"] if "base_commit" in attributes: # pragma no branch assert attributes["base_commit"] is None or isinstance(attributes["base_commit"], dict), attributes["base_commit"] self._base_commit = None if attributes["base_commit"] is None else Commit.Commit(self._requester, attributes["base_commit"], completed=False) if "behind_by" in attributes: # pragma no branch - assert attributes["behind_by"] is None or isinstance(attributes["behind_by"], int), attributes["behind_by"] + assert attributes["behind_by"] is None or isinstance(attributes["behind_by"], (int, long)), attributes["behind_by"] self._behind_by = attributes["behind_by"] if "commits" in attributes: # pragma no branch assert attributes["commits"] is None or all(isinstance(element, dict) for element in attributes["commits"]), attributes["commits"] @@ -132,7 +132,7 @@ class Comparison(GithubObject.GithubObject): assert attributes["status"] is None or isinstance(attributes["status"], (str, unicode)), attributes["status"] self._status = attributes["status"] if "total_commits" in attributes: # pragma no branch - assert attributes["total_commits"] is None or isinstance(attributes["total_commits"], int), attributes["total_commits"] + assert attributes["total_commits"] is None or isinstance(attributes["total_commits"], (int, long)), attributes["total_commits"] self._total_commits = attributes["total_commits"] if "url" in attributes: # pragma no branch assert attributes["url"] is None or isinstance(attributes["url"], (str, unicode)), attributes["url"] diff --git a/github/ContentFile.py b/github/ContentFile.py index 1026e795..9c8ceca7 100644 --- a/github/ContentFile.py +++ b/github/ContentFile.py @@ -71,7 +71,7 @@ class ContentFile(GithubObject.BasicGithubObject): assert attributes["sha"] is None or isinstance(attributes["sha"], (str, unicode)), attributes["sha"] self._sha = attributes["sha"] if "size" in attributes: # pragma no branch - assert attributes["size"] is None or isinstance(attributes["size"], int), attributes["size"] + assert attributes["size"] is None or isinstance(attributes["size"], (int, long)), attributes["size"] self._size = attributes["size"] if "type" in attributes: # pragma no branch assert attributes["type"] is None or isinstance(attributes["type"], (str, unicode)), attributes["type"] diff --git a/github/Download.py b/github/Download.py index e54bbfbe..52ecc86f 100644 --- a/github/Download.py +++ b/github/Download.py @@ -167,7 +167,7 @@ class Download(GithubObject.GithubObject): assert attributes["description"] is None or isinstance(attributes["description"], (str, unicode)), attributes["description"] self._description = attributes["description"] if "download_count" in attributes: # pragma no branch - assert attributes["download_count"] is None or isinstance(attributes["download_count"], int), attributes["download_count"] + assert attributes["download_count"] is None or isinstance(attributes["download_count"], (int, long)), attributes["download_count"] self._download_count = attributes["download_count"] if "expirationdate" in attributes: # pragma no branch assert attributes["expirationdate"] is None or isinstance(attributes["expirationdate"], (str, unicode)), attributes["expirationdate"] @@ -176,7 +176,7 @@ class Download(GithubObject.GithubObject): assert attributes["html_url"] is None or isinstance(attributes["html_url"], (str, unicode)), attributes["html_url"] self._html_url = attributes["html_url"] if "id" in attributes: # pragma no branch - assert attributes["id"] is None or isinstance(attributes["id"], int), attributes["id"] + assert attributes["id"] is None or isinstance(attributes["id"], (int, long)), attributes["id"] self._id = attributes["id"] if "mime_type" in attributes: # pragma no branch assert attributes["mime_type"] is None or isinstance(attributes["mime_type"], (str, unicode)), attributes["mime_type"] @@ -203,7 +203,7 @@ class Download(GithubObject.GithubObject): assert attributes["signature"] is None or isinstance(attributes["signature"], (str, unicode)), attributes["signature"] self._signature = attributes["signature"] if "size" in attributes: # pragma no branch - assert attributes["size"] is None or isinstance(attributes["size"], int), attributes["size"] + assert attributes["size"] is None or isinstance(attributes["size"], (int, long)), attributes["size"] self._size = attributes["size"] if "url" in attributes: # pragma no branch assert attributes["url"] is None or isinstance(attributes["url"], (str, unicode)), attributes["url"] diff --git a/github/File.py b/github/File.py index 0dedb3cd..9a6a9d16 100644 --- a/github/File.py +++ b/github/File.py @@ -66,16 +66,16 @@ class File(GithubObject.BasicGithubObject): def _useAttributes(self, attributes): if "additions" in attributes: # pragma no branch - assert attributes["additions"] is None or isinstance(attributes["additions"], int), attributes["additions"] + assert attributes["additions"] is None or isinstance(attributes["additions"], (int, long)), attributes["additions"] self._additions = attributes["additions"] if "blob_url" in attributes: # pragma no branch assert attributes["blob_url"] is None or isinstance(attributes["blob_url"], (str, unicode)), attributes["blob_url"] self._blob_url = attributes["blob_url"] if "changes" in attributes: # pragma no branch - assert attributes["changes"] is None or isinstance(attributes["changes"], int), attributes["changes"] + assert attributes["changes"] is None or isinstance(attributes["changes"], (int, long)), attributes["changes"] self._changes = attributes["changes"] if "deletions" in attributes: # pragma no branch - assert attributes["deletions"] is None or isinstance(attributes["deletions"], int), attributes["deletions"] + assert attributes["deletions"] is None or isinstance(attributes["deletions"], (int, long)), attributes["deletions"] self._deletions = attributes["deletions"] if "filename" in attributes: # pragma no branch assert attributes["filename"] is None or isinstance(attributes["filename"], (str, unicode)), attributes["filename"] diff --git a/github/Gist.py b/github/Gist.py index 9f6de4d1..aa5256d5 100644 --- a/github/Gist.py +++ b/github/Gist.py @@ -147,7 +147,7 @@ class Gist(GithubObject.GithubObject): self._useAttributes(data) def get_comment(self, id): - assert isinstance(id, int), id + assert isinstance(id, (int, long)), id headers, data = self._requester.requestAndCheck( "GET", self.url + "/comments/" + str(id), @@ -208,7 +208,7 @@ class Gist(GithubObject.GithubObject): def _useAttributes(self, attributes): if "comments" in attributes: # pragma no branch - assert attributes["comments"] is None or isinstance(attributes["comments"], int), attributes["comments"] + assert attributes["comments"] is None or isinstance(attributes["comments"], (int, long)), attributes["comments"] self._comments = attributes["comments"] if "created_at" in attributes: # pragma no branch assert attributes["created_at"] is None or isinstance(attributes["created_at"], (str, unicode)), attributes["created_at"] diff --git a/github/GistComment.py b/github/GistComment.py index aa8f73cb..6cd36d49 100644 --- a/github/GistComment.py +++ b/github/GistComment.py @@ -86,7 +86,7 @@ class GistComment(GithubObject.GithubObject): assert attributes["created_at"] is None or isinstance(attributes["created_at"], (str, unicode)), attributes["created_at"] self._created_at = self._parseDatetime(attributes["created_at"]) if "id" in attributes: # pragma no branch - assert attributes["id"] is None or isinstance(attributes["id"], int), attributes["id"] + assert attributes["id"] is None or isinstance(attributes["id"], (int, long)), attributes["id"] self._id = attributes["id"] if "updated_at" in attributes: # pragma no branch assert attributes["updated_at"] is None or isinstance(attributes["updated_at"], (str, unicode)), attributes["updated_at"] diff --git a/github/GistFile.py b/github/GistFile.py index 1b8aba3e..c5011dca 100644 --- a/github/GistFile.py +++ b/github/GistFile.py @@ -58,5 +58,5 @@ class GistFile(GithubObject.BasicGithubObject): assert attributes["raw_url"] is None or isinstance(attributes["raw_url"], (str, unicode)), attributes["raw_url"] self._raw_url = attributes["raw_url"] if "size" in attributes: # pragma no branch - assert attributes["size"] is None or isinstance(attributes["size"], int), attributes["size"] + assert attributes["size"] is None or isinstance(attributes["size"], (int, long)), attributes["size"] self._size = attributes["size"] diff --git a/github/GitBlob.py b/github/GitBlob.py index 19b10589..9ab38b92 100644 --- a/github/GitBlob.py +++ b/github/GitBlob.py @@ -60,7 +60,7 @@ class GitBlob(GithubObject.GithubObject): assert attributes["sha"] is None or isinstance(attributes["sha"], (str, unicode)), attributes["sha"] self._sha = attributes["sha"] if "size" in attributes: # pragma no branch - assert attributes["size"] is None or isinstance(attributes["size"], int), attributes["size"] + assert attributes["size"] is None or isinstance(attributes["size"], (int, long)), attributes["size"] self._size = attributes["size"] if "url" in attributes: # pragma no branch assert attributes["url"] is None or isinstance(attributes["url"], (str, unicode)), attributes["url"] diff --git a/github/GitTreeElement.py b/github/GitTreeElement.py index e2b1a63e..6d0aa9ae 100644 --- a/github/GitTreeElement.py +++ b/github/GitTreeElement.py @@ -60,7 +60,7 @@ class GitTreeElement(GithubObject.BasicGithubObject): assert attributes["sha"] is None or isinstance(attributes["sha"], (str, unicode)), attributes["sha"] self._sha = attributes["sha"] if "size" in attributes: # pragma no branch - assert attributes["size"] is None or isinstance(attributes["size"], int), attributes["size"] + assert attributes["size"] is None or isinstance(attributes["size"], (int, long)), attributes["size"] self._size = attributes["size"] if "type" in attributes: # pragma no branch assert attributes["type"] is None or isinstance(attributes["type"], (str, unicode)), attributes["type"] diff --git a/github/Hook.py b/github/Hook.py index 9a0af68e..86fc0918 100644 --- a/github/Hook.py +++ b/github/Hook.py @@ -132,7 +132,7 @@ class Hook(GithubObject.GithubObject): assert attributes["events"] is None or all(isinstance(element, (str, unicode)) for element in attributes["events"]), attributes["events"] self._events = attributes["events"] if "id" in attributes: # pragma no branch - assert attributes["id"] is None or isinstance(attributes["id"], int), attributes["id"] + assert attributes["id"] is None or isinstance(attributes["id"], (int, long)), attributes["id"] self._id = attributes["id"] if "last_response" in attributes: # pragma no branch assert attributes["last_response"] is None or isinstance(attributes["last_response"], dict), attributes["last_response"] diff --git a/github/HookResponse.py b/github/HookResponse.py index a5f174cf..a280c785 100644 --- a/github/HookResponse.py +++ b/github/HookResponse.py @@ -36,7 +36,7 @@ class HookResponse(GithubObject.BasicGithubObject): def _useAttributes(self, attributes): if "code" in attributes: # pragma no branch - assert attributes["code"] is None or isinstance(attributes["code"], int), attributes["code"] + assert attributes["code"] is None or isinstance(attributes["code"], (int, long)), attributes["code"] self._code = attributes["code"] if "message" in attributes: # pragma no branch assert attributes["message"] is None or isinstance(attributes["message"], (str, unicode)), attributes["message"] diff --git a/github/Issue.py b/github/Issue.py index 282a6765..fa50729b 100644 --- a/github/Issue.py +++ b/github/Issue.py @@ -176,7 +176,7 @@ class Issue(GithubObject.GithubObject): self._useAttributes(data) def get_comment(self, id): - assert isinstance(id, int), id + assert isinstance(id, (int, long)), id headers, data = self._requester.requestAndCheck( "GET", self._parentUrl(self.url) + "/comments/" + str(id), @@ -266,7 +266,7 @@ class Issue(GithubObject.GithubObject): assert attributes["closed_by"] is None or isinstance(attributes["closed_by"], dict), attributes["closed_by"] self._closed_by = None if attributes["closed_by"] is None else NamedUser.NamedUser(self._requester, attributes["closed_by"], completed=False) if "comments" in attributes: # pragma no branch - assert attributes["comments"] is None or isinstance(attributes["comments"], int), attributes["comments"] + assert attributes["comments"] is None or isinstance(attributes["comments"], (int, long)), attributes["comments"] self._comments = attributes["comments"] if "created_at" in attributes: # pragma no branch assert attributes["created_at"] is None or isinstance(attributes["created_at"], (str, unicode)), attributes["created_at"] @@ -275,7 +275,7 @@ class Issue(GithubObject.GithubObject): assert attributes["html_url"] is None or isinstance(attributes["html_url"], (str, unicode)), attributes["html_url"] self._html_url = attributes["html_url"] if "id" in attributes: # pragma no branch - assert attributes["id"] is None or isinstance(attributes["id"], int), attributes["id"] + assert attributes["id"] is None or isinstance(attributes["id"], (int, long)), attributes["id"] self._id = attributes["id"] if "labels" in attributes: # pragma no branch assert attributes["labels"] is None or all(isinstance(element, dict) for element in attributes["labels"]), attributes["labels"] @@ -287,7 +287,7 @@ class Issue(GithubObject.GithubObject): assert attributes["milestone"] is None or isinstance(attributes["milestone"], dict), attributes["milestone"] self._milestone = None if attributes["milestone"] is None else Milestone.Milestone(self._requester, attributes["milestone"], completed=False) if "number" in attributes: # pragma no branch - assert attributes["number"] is None or isinstance(attributes["number"], int), attributes["number"] + assert attributes["number"] is None or isinstance(attributes["number"], (int, long)), attributes["number"] self._number = attributes["number"] if "pull_request" in attributes: # pragma no branch assert attributes["pull_request"] is None or isinstance(attributes["pull_request"], dict), attributes["pull_request"] diff --git a/github/IssueComment.py b/github/IssueComment.py index 68d44d14..e8f779c4 100644 --- a/github/IssueComment.py +++ b/github/IssueComment.py @@ -86,7 +86,7 @@ class IssueComment(GithubObject.GithubObject): assert attributes["created_at"] is None or isinstance(attributes["created_at"], (str, unicode)), attributes["created_at"] self._created_at = self._parseDatetime(attributes["created_at"]) if "id" in attributes: # pragma no branch - assert attributes["id"] is None or isinstance(attributes["id"], int), attributes["id"] + assert attributes["id"] is None or isinstance(attributes["id"], (int, long)), attributes["id"] self._id = attributes["id"] if "updated_at" in attributes: # pragma no branch assert attributes["updated_at"] is None or isinstance(attributes["updated_at"], (str, unicode)), attributes["updated_at"] diff --git a/github/IssueEvent.py b/github/IssueEvent.py index 5839ae8f..7dd49336 100644 --- a/github/IssueEvent.py +++ b/github/IssueEvent.py @@ -78,7 +78,7 @@ class IssueEvent(GithubObject.GithubObject): assert attributes["event"] is None or isinstance(attributes["event"], (str, unicode)), attributes["event"] self._event = attributes["event"] if "id" in attributes: # pragma no branch - assert attributes["id"] is None or isinstance(attributes["id"], int), attributes["id"] + assert attributes["id"] is None or isinstance(attributes["id"], (int, long)), attributes["id"] self._id = attributes["id"] if "issue" in attributes: # pragma no branch assert attributes["issue"] is None or isinstance(attributes["issue"], dict), attributes["issue"] diff --git a/github/Legacy.py b/github/Legacy.py index e09c79dc..264a0796 100644 --- a/github/Legacy.py +++ b/github/Legacy.py @@ -39,7 +39,7 @@ class PaginatedList(PaginatedListBase): return self.get_page(page) def get_page(self, page): - assert isinstance(page, int), page + assert isinstance(page, (int, long)), page args = dict(self.__args) if page != 0: args["start_page"] = page + 1 diff --git a/github/Milestone.py b/github/Milestone.py index b2528665..18e01865 100644 --- a/github/Milestone.py +++ b/github/Milestone.py @@ -135,7 +135,7 @@ class Milestone(GithubObject.GithubObject): def _useAttributes(self, attributes): if "closed_issues" in attributes: # pragma no branch - assert attributes["closed_issues"] is None or isinstance(attributes["closed_issues"], int), attributes["closed_issues"] + assert attributes["closed_issues"] is None or isinstance(attributes["closed_issues"], (int, long)), attributes["closed_issues"] self._closed_issues = attributes["closed_issues"] if "created_at" in attributes: # pragma no branch assert attributes["created_at"] is None or isinstance(attributes["created_at"], (str, unicode)), attributes["created_at"] @@ -150,13 +150,13 @@ class Milestone(GithubObject.GithubObject): assert attributes["due_on"] is None or isinstance(attributes["due_on"], (str, unicode)), attributes["due_on"] self._due_on = self._parseDatetime(attributes["due_on"]) if "id" in attributes: # pragma no branch - assert attributes["id"] is None or isinstance(attributes["id"], int), attributes["id"] + assert attributes["id"] is None or isinstance(attributes["id"], (int, long)), attributes["id"] self._id = attributes["id"] if "number" in attributes: # pragma no branch - assert attributes["number"] is None or isinstance(attributes["number"], int), attributes["number"] + assert attributes["number"] is None or isinstance(attributes["number"], (int, long)), attributes["number"] self._number = attributes["number"] if "open_issues" in attributes: # pragma no branch - assert attributes["open_issues"] is None or isinstance(attributes["open_issues"], int), attributes["open_issues"] + assert attributes["open_issues"] is None or isinstance(attributes["open_issues"], (int, long)), attributes["open_issues"] self._open_issues = attributes["open_issues"] if "state" in attributes: # pragma no branch assert attributes["state"] is None or isinstance(attributes["state"], (str, unicode)), attributes["state"] diff --git a/github/NamedUser.py b/github/NamedUser.py index 03c079dd..8269e2a5 100644 --- a/github/NamedUser.py +++ b/github/NamedUser.py @@ -327,28 +327,28 @@ class NamedUser(GithubObject.GithubObject): assert attributes["blog"] is None or isinstance(attributes["blog"], (str, unicode)), attributes["blog"] self._blog = attributes["blog"] if "collaborators" in attributes: # pragma no branch - assert attributes["collaborators"] is None or isinstance(attributes["collaborators"], int), attributes["collaborators"] + assert attributes["collaborators"] is None or isinstance(attributes["collaborators"], (int, long)), attributes["collaborators"] self._collaborators = attributes["collaborators"] if "company" in attributes: # pragma no branch assert attributes["company"] is None or isinstance(attributes["company"], (str, unicode)), attributes["company"] self._company = attributes["company"] if "contributions" in attributes: # pragma no branch - assert attributes["contributions"] is None or isinstance(attributes["contributions"], int), attributes["contributions"] + assert attributes["contributions"] is None or isinstance(attributes["contributions"], (int, long)), attributes["contributions"] self._contributions = attributes["contributions"] if "created_at" in attributes: # pragma no branch assert attributes["created_at"] is None or isinstance(attributes["created_at"], (str, unicode)), attributes["created_at"] self._created_at = self._parseDatetime(attributes["created_at"]) if "disk_usage" in attributes: # pragma no branch - assert attributes["disk_usage"] is None or isinstance(attributes["disk_usage"], int), attributes["disk_usage"] + assert attributes["disk_usage"] is None or isinstance(attributes["disk_usage"], (int, long)), attributes["disk_usage"] self._disk_usage = attributes["disk_usage"] if "email" in attributes: # pragma no branch assert attributes["email"] is None or isinstance(attributes["email"], (str, unicode)), attributes["email"] self._email = attributes["email"] if "followers" in attributes: # pragma no branch - assert attributes["followers"] is None or isinstance(attributes["followers"], int), attributes["followers"] + assert attributes["followers"] is None or isinstance(attributes["followers"], (int, long)), attributes["followers"] self._followers = attributes["followers"] if "following" in attributes: # pragma no branch - assert attributes["following"] is None or isinstance(attributes["following"], int), attributes["following"] + assert attributes["following"] is None or isinstance(attributes["following"], (int, long)), attributes["following"] self._following = attributes["following"] if "gravatar_id" in attributes: # pragma no branch assert attributes["gravatar_id"] is None or isinstance(attributes["gravatar_id"], (str, unicode)), attributes["gravatar_id"] @@ -360,7 +360,7 @@ class NamedUser(GithubObject.GithubObject): assert attributes["html_url"] is None or isinstance(attributes["html_url"], (str, unicode)), attributes["html_url"] self._html_url = attributes["html_url"] if "id" in attributes: # pragma no branch - assert attributes["id"] is None or isinstance(attributes["id"], int), attributes["id"] + assert attributes["id"] is None or isinstance(attributes["id"], (int, long)), attributes["id"] self._id = attributes["id"] if "location" in attributes: # pragma no branch assert attributes["location"] is None or isinstance(attributes["location"], (str, unicode)), attributes["location"] @@ -372,22 +372,22 @@ class NamedUser(GithubObject.GithubObject): assert attributes["name"] is None or isinstance(attributes["name"], (str, unicode)), attributes["name"] self._name = attributes["name"] if "owned_private_repos" in attributes: # pragma no branch - assert attributes["owned_private_repos"] is None or isinstance(attributes["owned_private_repos"], int), attributes["owned_private_repos"] + assert attributes["owned_private_repos"] is None or isinstance(attributes["owned_private_repos"], (int, long)), attributes["owned_private_repos"] self._owned_private_repos = attributes["owned_private_repos"] if "plan" in attributes: # pragma no branch assert attributes["plan"] is None or isinstance(attributes["plan"], dict), attributes["plan"] self._plan = None if attributes["plan"] is None else Plan.Plan(self._requester, attributes["plan"], completed=False) if "private_gists" in attributes: # pragma no branch - assert attributes["private_gists"] is None or isinstance(attributes["private_gists"], int), attributes["private_gists"] + assert attributes["private_gists"] is None or isinstance(attributes["private_gists"], (int, long)), attributes["private_gists"] self._private_gists = attributes["private_gists"] if "public_gists" in attributes: # pragma no branch - assert attributes["public_gists"] is None or isinstance(attributes["public_gists"], int), attributes["public_gists"] + assert attributes["public_gists"] is None or isinstance(attributes["public_gists"], (int, long)), attributes["public_gists"] self._public_gists = attributes["public_gists"] if "public_repos" in attributes: # pragma no branch - assert attributes["public_repos"] is None or isinstance(attributes["public_repos"], int), attributes["public_repos"] + assert attributes["public_repos"] is None or isinstance(attributes["public_repos"], (int, long)), attributes["public_repos"] self._public_repos = attributes["public_repos"] if "total_private_repos" in attributes: # pragma no branch - assert attributes["total_private_repos"] is None or isinstance(attributes["total_private_repos"], int), attributes["total_private_repos"] + assert attributes["total_private_repos"] is None or isinstance(attributes["total_private_repos"], (int, long)), attributes["total_private_repos"] self._total_private_repos = attributes["total_private_repos"] if "type" in attributes: # pragma no branch assert attributes["type"] is None or isinstance(attributes["type"], (str, unicode)), attributes["type"] diff --git a/github/Organization.py b/github/Organization.py index a64134fc..af39d730 100644 --- a/github/Organization.py +++ b/github/Organization.py @@ -300,7 +300,7 @@ class Organization(GithubObject.GithubObject): ) def get_team(self, id): - assert isinstance(id, int), id + assert isinstance(id, (int, long)), id headers, data = self._requester.requestAndCheck( "GET", "/teams/" + str(id), @@ -392,7 +392,7 @@ class Organization(GithubObject.GithubObject): assert attributes["blog"] is None or isinstance(attributes["blog"], (str, unicode)), attributes["blog"] self._blog = attributes["blog"] if "collaborators" in attributes: # pragma no branch - assert attributes["collaborators"] is None or isinstance(attributes["collaborators"], int), attributes["collaborators"] + assert attributes["collaborators"] is None or isinstance(attributes["collaborators"], (int, long)), attributes["collaborators"] self._collaborators = attributes["collaborators"] if "company" in attributes: # pragma no branch assert attributes["company"] is None or isinstance(attributes["company"], (str, unicode)), attributes["company"] @@ -401,16 +401,16 @@ class Organization(GithubObject.GithubObject): assert attributes["created_at"] is None or isinstance(attributes["created_at"], (str, unicode)), attributes["created_at"] self._created_at = self._parseDatetime(attributes["created_at"]) if "disk_usage" in attributes: # pragma no branch - assert attributes["disk_usage"] is None or isinstance(attributes["disk_usage"], int), attributes["disk_usage"] + assert attributes["disk_usage"] is None or isinstance(attributes["disk_usage"], (int, long)), attributes["disk_usage"] self._disk_usage = attributes["disk_usage"] if "email" in attributes: # pragma no branch assert attributes["email"] is None or isinstance(attributes["email"], (str, unicode)), attributes["email"] self._email = attributes["email"] if "followers" in attributes: # pragma no branch - assert attributes["followers"] is None or isinstance(attributes["followers"], int), attributes["followers"] + assert attributes["followers"] is None or isinstance(attributes["followers"], (int, long)), attributes["followers"] self._followers = attributes["followers"] if "following" in attributes: # pragma no branch - assert attributes["following"] is None or isinstance(attributes["following"], int), attributes["following"] + assert attributes["following"] is None or isinstance(attributes["following"], (int, long)), attributes["following"] self._following = attributes["following"] if "gravatar_id" in attributes: # pragma no branch assert attributes["gravatar_id"] is None or isinstance(attributes["gravatar_id"], (str, unicode)), attributes["gravatar_id"] @@ -419,7 +419,7 @@ class Organization(GithubObject.GithubObject): assert attributes["html_url"] is None or isinstance(attributes["html_url"], (str, unicode)), attributes["html_url"] self._html_url = attributes["html_url"] if "id" in attributes: # pragma no branch - assert attributes["id"] is None or isinstance(attributes["id"], int), attributes["id"] + assert attributes["id"] is None or isinstance(attributes["id"], (int, long)), attributes["id"] self._id = attributes["id"] if "location" in attributes: # pragma no branch assert attributes["location"] is None or isinstance(attributes["location"], (str, unicode)), attributes["location"] @@ -431,22 +431,22 @@ class Organization(GithubObject.GithubObject): assert attributes["name"] is None or isinstance(attributes["name"], (str, unicode)), attributes["name"] self._name = attributes["name"] if "owned_private_repos" in attributes: # pragma no branch - assert attributes["owned_private_repos"] is None or isinstance(attributes["owned_private_repos"], int), attributes["owned_private_repos"] + assert attributes["owned_private_repos"] is None or isinstance(attributes["owned_private_repos"], (int, long)), attributes["owned_private_repos"] self._owned_private_repos = attributes["owned_private_repos"] if "plan" in attributes: # pragma no branch assert attributes["plan"] is None or isinstance(attributes["plan"], dict), attributes["plan"] self._plan = None if attributes["plan"] is None else Plan.Plan(self._requester, attributes["plan"], completed=False) if "private_gists" in attributes: # pragma no branch - assert attributes["private_gists"] is None or isinstance(attributes["private_gists"], int), attributes["private_gists"] + assert attributes["private_gists"] is None or isinstance(attributes["private_gists"], (int, long)), attributes["private_gists"] self._private_gists = attributes["private_gists"] if "public_gists" in attributes: # pragma no branch - assert attributes["public_gists"] is None or isinstance(attributes["public_gists"], int), attributes["public_gists"] + assert attributes["public_gists"] is None or isinstance(attributes["public_gists"], (int, long)), attributes["public_gists"] self._public_gists = attributes["public_gists"] if "public_repos" in attributes: # pragma no branch - assert attributes["public_repos"] is None or isinstance(attributes["public_repos"], int), attributes["public_repos"] + assert attributes["public_repos"] is None or isinstance(attributes["public_repos"], (int, long)), attributes["public_repos"] self._public_repos = attributes["public_repos"] if "total_private_repos" in attributes: # pragma no branch - assert attributes["total_private_repos"] is None or isinstance(attributes["total_private_repos"], int), attributes["total_private_repos"] + assert attributes["total_private_repos"] is None or isinstance(attributes["total_private_repos"], (int, long)), attributes["total_private_repos"] self._total_private_repos = attributes["total_private_repos"] if "type" in attributes: # pragma no branch assert attributes["type"] is None or isinstance(attributes["type"], (str, unicode)), attributes["type"] diff --git a/github/PaginatedList.py b/github/PaginatedList.py index 80703413..dc876ff2 100644 --- a/github/PaginatedList.py +++ b/github/PaginatedList.py @@ -22,7 +22,7 @@ class PaginatedListBase: def __getitem__(self, index): assert isinstance(index, (int, slice)) - if isinstance(index, int): + if isinstance(index, (int, long)): self.__fetchToIndex(index) return self.__elements[index] else: diff --git a/github/Plan.py b/github/Plan.py index 9c9d6055..a7b23ffe 100644 --- a/github/Plan.py +++ b/github/Plan.py @@ -41,14 +41,14 @@ class Plan(GithubObject.BasicGithubObject): def _useAttributes(self, attributes): if "collaborators" in attributes: # pragma no branch - assert attributes["collaborators"] is None or isinstance(attributes["collaborators"], int), attributes["collaborators"] + assert attributes["collaborators"] is None or isinstance(attributes["collaborators"], (int, long)), attributes["collaborators"] self._collaborators = attributes["collaborators"] if "name" in attributes: # pragma no branch assert attributes["name"] is None or isinstance(attributes["name"], (str, unicode)), attributes["name"] self._name = attributes["name"] if "private_repos" in attributes: # pragma no branch - assert attributes["private_repos"] is None or isinstance(attributes["private_repos"], int), attributes["private_repos"] + assert attributes["private_repos"] is None or isinstance(attributes["private_repos"], (int, long)), attributes["private_repos"] self._private_repos = attributes["private_repos"] if "space" in attributes: # pragma no branch - assert attributes["space"] is None or isinstance(attributes["space"], int), attributes["space"] + assert attributes["space"] is None or isinstance(attributes["space"], (int, long)), attributes["space"] self._space = attributes["space"] diff --git a/github/PullRequest.py b/github/PullRequest.py index eae51cf4..0304fcfc 100644 --- a/github/PullRequest.py +++ b/github/PullRequest.py @@ -168,7 +168,7 @@ class PullRequest(GithubObject.GithubObject): assert isinstance(body, (str, unicode)), body assert isinstance(commit_id, Commit.Commit), commit_id assert isinstance(path, (str, unicode)), path - assert isinstance(position, int), position + assert isinstance(position, (int, long)), position post_parameters = { "body": body, "commit_id": commit_id._identity, @@ -219,7 +219,7 @@ class PullRequest(GithubObject.GithubObject): return self.get_review_comment(id) def get_review_comment(self, id): - assert isinstance(id, int), id + assert isinstance(id, (int, long)), id headers, data = self._requester.requestAndCheck( "GET", self._parentUrl(self.url) + "/comments/" + str(id), @@ -256,7 +256,7 @@ class PullRequest(GithubObject.GithubObject): ) def get_issue_comment(self, id): - assert isinstance(id, int), id + assert isinstance(id, (int, long)), id headers, data = self._requester.requestAndCheck( "GET", self._parentUrl(self._parentUrl(self.url)) + "/issues/comments/" + str(id), @@ -326,7 +326,7 @@ class PullRequest(GithubObject.GithubObject): def _useAttributes(self, attributes): if "additions" in attributes: # pragma no branch - assert attributes["additions"] is None or isinstance(attributes["additions"], int), attributes["additions"] + assert attributes["additions"] is None or isinstance(attributes["additions"], (int, long)), attributes["additions"] self._additions = attributes["additions"] if "assignee" in attributes: # pragma no branch assert attributes["assignee"] is None or isinstance(attributes["assignee"], dict), attributes["assignee"] @@ -338,22 +338,22 @@ class PullRequest(GithubObject.GithubObject): assert attributes["body"] is None or isinstance(attributes["body"], (str, unicode)), attributes["body"] self._body = attributes["body"] if "changed_files" in attributes: # pragma no branch - assert attributes["changed_files"] is None or isinstance(attributes["changed_files"], int), attributes["changed_files"] + assert attributes["changed_files"] is None or isinstance(attributes["changed_files"], (int, long)), attributes["changed_files"] self._changed_files = attributes["changed_files"] if "closed_at" in attributes: # pragma no branch assert attributes["closed_at"] is None or isinstance(attributes["closed_at"], (str, unicode)), attributes["closed_at"] self._closed_at = self._parseDatetime(attributes["closed_at"]) if "comments" in attributes: # pragma no branch - assert attributes["comments"] is None or isinstance(attributes["comments"], int), attributes["comments"] + assert attributes["comments"] is None or isinstance(attributes["comments"], (int, long)), attributes["comments"] self._comments = attributes["comments"] if "commits" in attributes: # pragma no branch - assert attributes["commits"] is None or isinstance(attributes["commits"], int), attributes["commits"] + assert attributes["commits"] is None or isinstance(attributes["commits"], (int, long)), attributes["commits"] self._commits = attributes["commits"] if "created_at" in attributes: # pragma no branch assert attributes["created_at"] is None or isinstance(attributes["created_at"], (str, unicode)), attributes["created_at"] self._created_at = self._parseDatetime(attributes["created_at"]) if "deletions" in attributes: # pragma no branch - assert attributes["deletions"] is None or isinstance(attributes["deletions"], int), attributes["deletions"] + assert attributes["deletions"] is None or isinstance(attributes["deletions"], (int, long)), attributes["deletions"] self._deletions = attributes["deletions"] if "diff_url" in attributes: # pragma no branch assert attributes["diff_url"] is None or isinstance(attributes["diff_url"], (str, unicode)), attributes["diff_url"] @@ -365,7 +365,7 @@ class PullRequest(GithubObject.GithubObject): assert attributes["html_url"] is None or isinstance(attributes["html_url"], (str, unicode)), attributes["html_url"] self._html_url = attributes["html_url"] if "id" in attributes: # pragma no branch - assert attributes["id"] is None or isinstance(attributes["id"], int), attributes["id"] + assert attributes["id"] is None or isinstance(attributes["id"], (int, long)), attributes["id"] self._id = attributes["id"] if "issue_url" in attributes: # pragma no branch assert attributes["issue_url"] is None or isinstance(attributes["issue_url"], (str, unicode)), attributes["issue_url"] @@ -383,13 +383,13 @@ class PullRequest(GithubObject.GithubObject): assert attributes["merged_by"] is None or isinstance(attributes["merged_by"], dict), attributes["merged_by"] self._merged_by = None if attributes["merged_by"] is None else NamedUser.NamedUser(self._requester, attributes["merged_by"], completed=False) if "number" in attributes: # pragma no branch - assert attributes["number"] is None or isinstance(attributes["number"], int), attributes["number"] + assert attributes["number"] is None or isinstance(attributes["number"], (int, long)), attributes["number"] self._number = attributes["number"] if "patch_url" in attributes: # pragma no branch assert attributes["patch_url"] is None or isinstance(attributes["patch_url"], (str, unicode)), attributes["patch_url"] self._patch_url = attributes["patch_url"] if "review_comments" in attributes: # pragma no branch - assert attributes["review_comments"] is None or isinstance(attributes["review_comments"], int), attributes["review_comments"] + assert attributes["review_comments"] is None or isinstance(attributes["review_comments"], (int, long)), attributes["review_comments"] self._review_comments = attributes["review_comments"] if "state" in attributes: # pragma no branch assert attributes["state"] is None or isinstance(attributes["state"], (str, unicode)), attributes["state"] diff --git a/github/PullRequestComment.py b/github/PullRequestComment.py index 6e6eb2a6..d9768a0d 100644 --- a/github/PullRequestComment.py +++ b/github/PullRequestComment.py @@ -119,19 +119,19 @@ class PullRequestComment(GithubObject.GithubObject): assert attributes["created_at"] is None or isinstance(attributes["created_at"], (str, unicode)), attributes["created_at"] self._created_at = self._parseDatetime(attributes["created_at"]) if "id" in attributes: # pragma no branch - assert attributes["id"] is None or isinstance(attributes["id"], int), attributes["id"] + assert attributes["id"] is None or isinstance(attributes["id"], (int, long)), attributes["id"] self._id = attributes["id"] if "original_commit_id" in attributes: # pragma no branch assert attributes["original_commit_id"] is None or isinstance(attributes["original_commit_id"], (str, unicode)), attributes["original_commit_id"] self._original_commit_id = attributes["original_commit_id"] if "original_position" in attributes: # pragma no branch - assert attributes["original_position"] is None or isinstance(attributes["original_position"], int), attributes["original_position"] + assert attributes["original_position"] is None or isinstance(attributes["original_position"], (int, long)), attributes["original_position"] self._original_position = attributes["original_position"] if "path" in attributes: # pragma no branch assert attributes["path"] is None or isinstance(attributes["path"], (str, unicode)), attributes["path"] self._path = attributes["path"] if "position" in attributes: # pragma no branch - assert attributes["position"] is None or isinstance(attributes["position"], int), attributes["position"] + assert attributes["position"] is None or isinstance(attributes["position"], (int, long)), attributes["position"] self._position = attributes["position"] if "updated_at" in attributes: # pragma no branch assert attributes["updated_at"] is None or isinstance(attributes["updated_at"], (str, unicode)), attributes["updated_at"] diff --git a/github/Repository.py b/github/Repository.py index b8311270..c4413a79 100644 --- a/github/Repository.py +++ b/github/Repository.py @@ -222,7 +222,7 @@ class Repository(GithubObject.GithubObject): def create_download(self, name, size, description=GithubObject.NotSet, content_type=GithubObject.NotSet): assert isinstance(name, (str, unicode)), name - assert isinstance(size, int), size + assert isinstance(size, (int, long)), size assert description is GithubObject.NotSet or isinstance(description, (str, unicode)), description assert content_type is GithubObject.NotSet or isinstance(content_type, (str, unicode)), content_type post_parameters = { @@ -550,7 +550,7 @@ class Repository(GithubObject.GithubObject): ) def get_comment(self, id): - assert isinstance(id, int), id + assert isinstance(id, (int, long)), id headers, data = self._requester.requestAndCheck( "GET", self.url + "/comments/" + str(id), @@ -611,7 +611,7 @@ class Repository(GithubObject.GithubObject): ) def get_download(self, id): - assert isinstance(id, int), id + assert isinstance(id, (int, long)), id headers, data = self._requester.requestAndCheck( "GET", self.url + "/downloads/" + str(id), @@ -710,7 +710,7 @@ class Repository(GithubObject.GithubObject): return GitTree.GitTree(self._requester, data, completed=True) def get_hook(self, id): - assert isinstance(id, int), id + assert isinstance(id, (int, long)), id headers, data = self._requester.requestAndCheck( "GET", self.url + "/hooks/" + str(id), @@ -728,7 +728,7 @@ class Repository(GithubObject.GithubObject): ) def get_issue(self, number): - assert isinstance(number, int), number + assert isinstance(number, (int, long)), number headers, data = self._requester.requestAndCheck( "GET", self.url + "/issues/" + str(number), @@ -777,7 +777,7 @@ class Repository(GithubObject.GithubObject): ) def get_issues_event(self, id): - assert isinstance(id, int), id + assert isinstance(id, (int, long)), id headers, data = self._requester.requestAndCheck( "GET", self.url + "/issues/events/" + str(id), @@ -795,7 +795,7 @@ class Repository(GithubObject.GithubObject): ) def get_key(self, id): - assert isinstance(id, int), id + assert isinstance(id, (int, long)), id headers, data = self._requester.requestAndCheck( "GET", self.url + "/keys/" + str(id), @@ -840,7 +840,7 @@ class Repository(GithubObject.GithubObject): return data def get_milestone(self, number): - assert isinstance(number, int), number + assert isinstance(number, (int, long)), number headers, data = self._requester.requestAndCheck( "GET", self.url + "/milestones/" + str(number), @@ -876,7 +876,7 @@ class Repository(GithubObject.GithubObject): ) def get_pull(self, number): - assert isinstance(number, int), number + assert isinstance(number, (int, long)), number headers, data = self._requester.requestAndCheck( "GET", self.url + "/pulls/" + str(number), @@ -1060,7 +1060,7 @@ class Repository(GithubObject.GithubObject): assert attributes["fork"] is None or isinstance(attributes["fork"], bool), attributes["fork"] self._fork = attributes["fork"] if "forks" in attributes: # pragma no branch - assert attributes["forks"] is None or isinstance(attributes["forks"], int), attributes["forks"] + assert attributes["forks"] is None or isinstance(attributes["forks"], (int, long)), attributes["forks"] self._forks = attributes["forks"] if "full_name" in attributes: # pragma no branch assert attributes["full_name"] is None or isinstance(attributes["full_name"], (str, unicode)), attributes["full_name"] @@ -1084,7 +1084,7 @@ class Repository(GithubObject.GithubObject): assert attributes["html_url"] is None or isinstance(attributes["html_url"], (str, unicode)), attributes["html_url"] self._html_url = attributes["html_url"] if "id" in attributes: # pragma no branch - assert attributes["id"] is None or isinstance(attributes["id"], int), attributes["id"] + assert attributes["id"] is None or isinstance(attributes["id"], (int, long)), attributes["id"] self._id = attributes["id"] if "language" in attributes: # pragma no branch assert attributes["language"] is None or isinstance(attributes["language"], (str, unicode)), attributes["language"] @@ -1096,7 +1096,7 @@ class Repository(GithubObject.GithubObject): assert attributes["name"] is None or isinstance(attributes["name"], (str, unicode)), attributes["name"] self._name = attributes["name"] if "open_issues" in attributes: # pragma no branch - assert attributes["open_issues"] is None or isinstance(attributes["open_issues"], int), attributes["open_issues"] + assert attributes["open_issues"] is None or isinstance(attributes["open_issues"], (int, long)), attributes["open_issues"] self._open_issues = attributes["open_issues"] if "organization" in attributes: # pragma no branch assert attributes["organization"] is None or isinstance(attributes["organization"], dict), attributes["organization"] @@ -1117,7 +1117,7 @@ class Repository(GithubObject.GithubObject): assert attributes["pushed_at"] is None or isinstance(attributes["pushed_at"], (str, unicode)), attributes["pushed_at"] self._pushed_at = self._parseDatetime(attributes["pushed_at"]) if "size" in attributes: # pragma no branch - assert attributes["size"] is None or isinstance(attributes["size"], int), attributes["size"] + assert attributes["size"] is None or isinstance(attributes["size"], (int, long)), attributes["size"] self._size = attributes["size"] if "source" in attributes: # pragma no branch assert attributes["source"] is None or isinstance(attributes["source"], dict), attributes["source"] @@ -1135,5 +1135,5 @@ class Repository(GithubObject.GithubObject): assert attributes["url"] is None or isinstance(attributes["url"], (str, unicode)), attributes["url"] self._url = attributes["url"] if "watchers" in attributes: # pragma no branch - assert attributes["watchers"] is None or isinstance(attributes["watchers"], int), attributes["watchers"] + assert attributes["watchers"] is None or isinstance(attributes["watchers"], (int, long)), attributes["watchers"] self._watchers = attributes["watchers"] diff --git a/github/RepositoryKey.py b/github/RepositoryKey.py index ef92ad80..dc759180 100644 --- a/github/RepositoryKey.py +++ b/github/RepositoryKey.py @@ -83,7 +83,7 @@ class RepositoryKey(GithubObject.GithubObject): def _useAttributes(self, attributes): if "id" in attributes: # pragma no branch - assert attributes["id"] is None or isinstance(attributes["id"], int), attributes["id"] + assert attributes["id"] is None or isinstance(attributes["id"], (int, long)), attributes["id"] self._id = attributes["id"] if "key" in attributes: # pragma no branch assert attributes["key"] is None or isinstance(attributes["key"], (str, unicode)), attributes["key"] diff --git a/github/Team.py b/github/Team.py index b89a5ba8..9dea6f09 100644 --- a/github/Team.py +++ b/github/Team.py @@ -161,10 +161,10 @@ class Team(GithubObject.GithubObject): def _useAttributes(self, attributes): if "id" in attributes: # pragma no branch - assert attributes["id"] is None or isinstance(attributes["id"], int), attributes["id"] + assert attributes["id"] is None or isinstance(attributes["id"], (int, long)), attributes["id"] self._id = attributes["id"] if "members_count" in attributes: # pragma no branch - assert attributes["members_count"] is None or isinstance(attributes["members_count"], int), attributes["members_count"] + assert attributes["members_count"] is None or isinstance(attributes["members_count"], (int, long)), attributes["members_count"] self._members_count = attributes["members_count"] if "name" in attributes: # pragma no branch assert attributes["name"] is None or isinstance(attributes["name"], (str, unicode)), attributes["name"] @@ -173,7 +173,7 @@ class Team(GithubObject.GithubObject): assert attributes["permission"] is None or isinstance(attributes["permission"], (str, unicode)), attributes["permission"] self._permission = attributes["permission"] if "repos_count" in attributes: # pragma no branch - assert attributes["repos_count"] is None or isinstance(attributes["repos_count"], int), attributes["repos_count"] + assert attributes["repos_count"] is None or isinstance(attributes["repos_count"], (int, long)), attributes["repos_count"] self._repos_count = attributes["repos_count"] if "url" in attributes: # pragma no branch assert attributes["url"] is None or isinstance(attributes["url"], (str, unicode)), attributes["url"] diff --git a/github/UserKey.py b/github/UserKey.py index ed2691af..53ca3841 100644 --- a/github/UserKey.py +++ b/github/UserKey.py @@ -75,7 +75,7 @@ class UserKey(GithubObject.GithubObject): def _useAttributes(self, attributes): if "id" in attributes: # pragma no branch - assert attributes["id"] is None or isinstance(attributes["id"], int), attributes["id"] + assert attributes["id"] is None or isinstance(attributes["id"], (int, long)), attributes["id"] self._id = attributes["id"] if "key" in attributes: # pragma no branch assert attributes["key"] is None or isinstance(attributes["key"], (str, unicode)), attributes["key"] From a922319db0037babe9919a83b8b69efebcf942ea Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Tue, 20 Nov 2012 19:36:28 +0100 Subject: [PATCH 44/62] Publish version 1.9.1 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 79c9c382..e645e5d3 100755 --- a/setup.py +++ b/setup.py @@ -53,7 +53,7 @@ class test( Command ): setup( name = "PyGithub", - version = "1.9.0", + version = "1.9.1", description = "Use the full Github API v3", author = "Vincent Jacques", author_email = "vincent@vincent-jacques.net", From 335e5a36e79d2a1468b12576d56e10fec201bf55 Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Tue, 20 Nov 2012 19:43:35 +0100 Subject: [PATCH 45/62] Minor fixes --- ReadMe.md | 2 +- doc/ChangeLog.md | 2 +- publish.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ReadMe.md b/ReadMe.md index effb87e7..db758ce1 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -13,7 +13,7 @@ What's new? [![Build Status](https://secure.travis-ci.org/jacquev6/PyGithub.png)](http://travis-ci.org/jacquev6/PyGithub) -[Version 1.9.1](https://github.com/jacquev6/PyGithub/issues?milestone=16&state=closed) (November 20th, 2012) +[Version 1.9.1](https://github.com/jacquev6/PyGithub/issues?milestone=17&state=closed) (November 20th, 2012) ------------------------------------------------------------------------------------------------------------ * Fix an assertion failure when integers returned by Github do not fit in a Python `int` diff --git a/doc/ChangeLog.md b/doc/ChangeLog.md index c8742c6b..e2b1689c 100644 --- a/doc/ChangeLog.md +++ b/doc/ChangeLog.md @@ -1,4 +1,4 @@ -[Version 1.9.1](https://github.com/jacquev6/PyGithub/issues?milestone=16&state=closed) (November 20th, 2012) +[Version 1.9.1](https://github.com/jacquev6/PyGithub/issues?milestone=17&state=closed) (November 20th, 2012) ------------------------------------------------------------------------------------------------------------ * Fix an assertion failure when integers returned by Github do not fit in a Python `int` diff --git a/publish.sh b/publish.sh index 23cef761..db2d94d5 100755 --- a/publish.sh +++ b/publish.sh @@ -26,5 +26,5 @@ cp -r *.md doc COPYING* github python setup.py sdist upload rm -rf github/*.md github/doc github/COPYING* -git push origin master master:develop +git push github master master:develop git push --tags From 065cd9123e81d6f3b6c5a2ac13ef0e2b66e8aa47 Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Wed, 21 Nov 2012 19:06:24 +0100 Subject: [PATCH 46/62] Remove unused file --- github/tests/IntegrationTest.py | 66 --------------------------------- 1 file changed, 66 deletions(-) delete mode 100755 github/tests/IntegrationTest.py diff --git a/github/tests/IntegrationTest.py b/github/tests/IntegrationTest.py deleted file mode 100755 index 3fbaabb6..00000000 --- a/github/tests/IntegrationTest.py +++ /dev/null @@ -1,66 +0,0 @@ -# -*- coding: utf-8 -*- - -#!/bin/env python - -# Copyright 2012 Vincent Jacques -# vincent@vincent-jacques.net - -# This file is part of PyGithub. http://vincent-jacques.net/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 Framework - - -from AuthenticatedUser import * -from Authentication import * -from Authorization import * -from Branch import * -from Commit import * -from CommitComment import * -from CommitStatus import * -from ContentFile import * -from Download import * -from Event import * -from Gist import * -from GistComment import * -from GitBlob import * -from GitCommit import * -from Github import * -from GitRef import * -from GitTag import * -from GitTree import * -from Hook import * -from Issue import * -from IssueComment import * -from IssueEvent import * -from Label import * -from Milestone import * -from NamedUser import * -from Organization import * -from PullRequest import * -from PullRequestComment import * -from PullRequestFile import * -from RateLimiting import * -from Repository import * -from RepositoryKey import * -from Tag import * -from Team import * -from UserKey import * -from Markdown import * - -from PaginatedList import * -from Issue33 import * -from Issue50 import * -from Issue54 import * -from Exceptions import * -from Enterprise import * -from Issue80 import * - -Framework.main() From 9a03610f7bd9143c1ec738afcbcf072274cf0324 Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Wed, 21 Nov 2012 20:13:12 +0100 Subject: [PATCH 47/62] Use absolute imports. May help with Python 3 --- github/AuthenticatedUser.py | 277 ++++++++--------- github/Authorization.py | 48 +-- github/AuthorizationApplication.py | 8 +- github/Branch.py | 12 +- github/Commit.py | 81 +++-- github/CommitComment.py | 30 +- github/CommitStats.py | 10 +- github/CommitStatus.py | 22 +- github/Comparison.py | 38 +-- github/ContentFile.py | 18 +- github/Download.py | 44 +-- github/Event.py | 32 +- github/File.py | 22 +- github/Gist.py | 70 ++--- github/GistComment.py | 20 +- github/GistFile.py | 14 +- github/GistHistoryState.py | 22 +- github/GitAuthor.py | 10 +- github/GitBlob.py | 14 +- github/GitCommit.py | 29 +- github/GitObject.py | 10 +- github/GitRef.py | 20 +- github/GitTag.py | 24 +- github/GitTree.py | 14 +- github/GitTreeElement.py | 16 +- github/Github.py | 38 +-- github/Hook.py | 44 +-- github/HookDescription.py | 12 +- github/HookResponse.py | 10 +- github/InputGitTreeElement.py | 8 +- github/Issue.py | 118 +++---- github/IssueComment.py | 20 +- github/IssueEvent.py | 26 +- github/IssuePullRequest.py | 10 +- github/Label.py | 10 +- github/Legacy.py | 6 +- github/Milestone.py | 52 ++-- github/NamedUser.py | 135 ++++---- github/Organization.py | 188 +++++------ github/PaginatedList.py | 2 +- github/Permissions.py | 10 +- github/Plan.py | 12 +- github/PullRequest.py | 132 ++++---- github/PullRequestComment.py | 30 +- github/PullRequestMergeStatus.py | 10 +- github/PullRequestPart.py | 22 +- github/Repository.py | 484 ++++++++++++++--------------- github/RepositoryKey.py | 26 +- github/Tag.py | 16 +- github/Team.py | 48 +-- github/UserKey.py | 24 +- 51 files changed, 1195 insertions(+), 1203 deletions(-) diff --git a/github/AuthenticatedUser.py b/github/AuthenticatedUser.py index e450d5bc..81b14754 100644 --- a/github/AuthenticatedUser.py +++ b/github/AuthenticatedUser.py @@ -13,22 +13,21 @@ # You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see . -import GithubObject -import PaginatedList +import github.GithubObject +import github.PaginatedList -import InputFileContent -import Gist -import Repository -import NamedUser -import Plan -import Organization -import UserKey -import Issue -import Event -import Authorization +import github.Gist +import github.Repository +import github.NamedUser +import github.Plan +import github.Organization +import github.UserKey +import github.Issue +import github.Event +import github.Authorization -class AuthenticatedUser(GithubObject.GithubObject): +class AuthenticatedUser(github.GithubObject.GithubObject): @property def avatar_url(self): self._completeIfNotSet(self._avatar_url) @@ -165,7 +164,7 @@ class AuthenticatedUser(GithubObject.GithubObject): ) def add_to_following(self, following): - assert isinstance(following, NamedUser.NamedUser), following + assert isinstance(following, github.NamedUser.NamedUser), following headers, data = self._requester.requestAndCheck( "PUT", "/user/following/" + following._identity, @@ -174,7 +173,7 @@ class AuthenticatedUser(GithubObject.GithubObject): ) def add_to_starred(self, starred): - assert isinstance(starred, Repository.Repository), starred + assert isinstance(starred, github.Repository.Repository), starred headers, data = self._requester.requestAndCheck( "PUT", "/user/starred/" + starred._identity, @@ -183,7 +182,7 @@ class AuthenticatedUser(GithubObject.GithubObject): ) def add_to_subscriptions(self, subscription): - assert isinstance(subscription, Repository.Repository), subscription + assert isinstance(subscription, github.Repository.Repository), subscription headers, data = self._requester.requestAndCheck( "PUT", "/user/subscriptions/" + subscription._identity, @@ -192,7 +191,7 @@ class AuthenticatedUser(GithubObject.GithubObject): ) def add_to_watched(self, watched): - assert isinstance(watched, Repository.Repository), watched + assert isinstance(watched, github.Repository.Repository), watched headers, data = self._requester.requestAndCheck( "PUT", "/user/watched/" + watched._identity, @@ -200,16 +199,16 @@ class AuthenticatedUser(GithubObject.GithubObject): None ) - def create_authorization(self, scopes=GithubObject.NotSet, note=GithubObject.NotSet, note_url=GithubObject.NotSet): - assert scopes is GithubObject.NotSet or all(isinstance(element, (str, unicode)) for element in scopes), scopes - assert note is GithubObject.NotSet or isinstance(note, (str, unicode)), note - assert note_url is GithubObject.NotSet or isinstance(note_url, (str, unicode)), note_url + def create_authorization(self, scopes=github.GithubObject.NotSet, note=github.GithubObject.NotSet, note_url=github.GithubObject.NotSet): + assert scopes is github.GithubObject.NotSet or all(isinstance(element, (str, unicode)) for element in scopes), scopes + assert note is github.GithubObject.NotSet or isinstance(note, (str, unicode)), note + assert note_url is github.GithubObject.NotSet or isinstance(note_url, (str, unicode)), note_url post_parameters = dict() - if scopes is not GithubObject.NotSet: + if scopes is not github.GithubObject.NotSet: post_parameters["scopes"] = scopes - if note is not GithubObject.NotSet: + if note is not github.GithubObject.NotSet: post_parameters["note"] = note - if note_url is not GithubObject.NotSet: + if note_url is not github.GithubObject.NotSet: post_parameters["note_url"] = note_url headers, data = self._requester.requestAndCheck( "POST", @@ -217,27 +216,27 @@ class AuthenticatedUser(GithubObject.GithubObject): None, post_parameters ) - return Authorization.Authorization(self._requester, data, completed=True) + return github.Authorization.Authorization(self._requester, data, completed=True) def create_fork(self, repo): - assert isinstance(repo, Repository.Repository), repo + assert isinstance(repo, github.Repository.Repository), repo headers, data = self._requester.requestAndCheck( "POST", "/repos/" + repo.owner.login + "/" + repo.name + "/forks", None, None ) - return Repository.Repository(self._requester, data, completed=True) + return github.Repository.Repository(self._requester, data, completed=True) - def create_gist(self, public, files, description=GithubObject.NotSet): + def create_gist(self, public, files, description=github.GithubObject.NotSet): assert isinstance(public, bool), public - assert all(isinstance(element, InputFileContent.InputFileContent) for element in files.itervalues()), files - assert description is GithubObject.NotSet or isinstance(description, (str, unicode)), description + assert all(isinstance(element, github.InputFileContent) for element in files.itervalues()), files + assert description is github.GithubObject.NotSet or isinstance(description, (str, unicode)), description post_parameters = { "public": public, "files": dict((key, value._identity) for key, value in files.iteritems()), } - if description is not GithubObject.NotSet: + if description is not github.GithubObject.NotSet: post_parameters["description"] = description headers, data = self._requester.requestAndCheck( "POST", @@ -245,7 +244,7 @@ class AuthenticatedUser(GithubObject.GithubObject): None, post_parameters ) - return Gist.Gist(self._requester, data, completed=True) + return github.Gist.Gist(self._requester, data, completed=True) def create_key(self, title, key): assert isinstance(title, (str, unicode)), title @@ -260,36 +259,36 @@ class AuthenticatedUser(GithubObject.GithubObject): None, post_parameters ) - return UserKey.UserKey(self._requester, data, completed=True) + return github.UserKey.UserKey(self._requester, data, completed=True) - def create_repo(self, name, description=GithubObject.NotSet, homepage=GithubObject.NotSet, private=GithubObject.NotSet, has_issues=GithubObject.NotSet, has_wiki=GithubObject.NotSet, has_downloads=GithubObject.NotSet, auto_init=GithubObject.NotSet, gitignore_template=GithubObject.NotSet): + def create_repo(self, name, description=github.GithubObject.NotSet, homepage=github.GithubObject.NotSet, private=github.GithubObject.NotSet, has_issues=github.GithubObject.NotSet, has_wiki=github.GithubObject.NotSet, has_downloads=github.GithubObject.NotSet, auto_init=github.GithubObject.NotSet, gitignore_template=github.GithubObject.NotSet): assert isinstance(name, (str, unicode)), name - assert description is GithubObject.NotSet or isinstance(description, (str, unicode)), description - assert homepage is GithubObject.NotSet or isinstance(homepage, (str, unicode)), homepage - assert private is GithubObject.NotSet or isinstance(private, bool), private - assert has_issues is GithubObject.NotSet or isinstance(has_issues, bool), has_issues - assert has_wiki is GithubObject.NotSet or isinstance(has_wiki, bool), has_wiki - assert has_downloads is GithubObject.NotSet or isinstance(has_downloads, bool), has_downloads - assert auto_init is GithubObject.NotSet or isinstance(auto_init, bool), auto_init - assert gitignore_template is GithubObject.NotSet or isinstance(gitignore_template, (str, unicode)), gitignore_template + assert description is github.GithubObject.NotSet or isinstance(description, (str, unicode)), description + assert homepage is github.GithubObject.NotSet or isinstance(homepage, (str, unicode)), homepage + assert private is github.GithubObject.NotSet or isinstance(private, bool), private + assert has_issues is github.GithubObject.NotSet or isinstance(has_issues, bool), has_issues + assert has_wiki is github.GithubObject.NotSet or isinstance(has_wiki, bool), has_wiki + assert has_downloads is github.GithubObject.NotSet or isinstance(has_downloads, bool), has_downloads + assert auto_init is github.GithubObject.NotSet or isinstance(auto_init, bool), auto_init + assert gitignore_template is github.GithubObject.NotSet or isinstance(gitignore_template, (str, unicode)), gitignore_template post_parameters = { "name": name, } - if description is not GithubObject.NotSet: + if description is not github.GithubObject.NotSet: post_parameters["description"] = description - if homepage is not GithubObject.NotSet: + if homepage is not github.GithubObject.NotSet: post_parameters["homepage"] = homepage - if private is not GithubObject.NotSet: + if private is not github.GithubObject.NotSet: post_parameters["private"] = private - if has_issues is not GithubObject.NotSet: + if has_issues is not github.GithubObject.NotSet: post_parameters["has_issues"] = has_issues - if has_wiki is not GithubObject.NotSet: + if has_wiki is not github.GithubObject.NotSet: post_parameters["has_wiki"] = has_wiki - if has_downloads is not GithubObject.NotSet: + if has_downloads is not github.GithubObject.NotSet: post_parameters["has_downloads"] = has_downloads - if auto_init is not GithubObject.NotSet: + if auto_init is not github.GithubObject.NotSet: post_parameters["auto_init"] = auto_init - if gitignore_template is not GithubObject.NotSet: + if gitignore_template is not github.GithubObject.NotSet: post_parameters["gitignore_template"] = gitignore_template headers, data = self._requester.requestAndCheck( "POST", @@ -297,30 +296,30 @@ class AuthenticatedUser(GithubObject.GithubObject): None, post_parameters ) - return Repository.Repository(self._requester, data, completed=True) + return github.Repository.Repository(self._requester, data, completed=True) - def edit(self, name=GithubObject.NotSet, email=GithubObject.NotSet, blog=GithubObject.NotSet, company=GithubObject.NotSet, location=GithubObject.NotSet, hireable=GithubObject.NotSet, bio=GithubObject.NotSet): - assert name is GithubObject.NotSet or isinstance(name, (str, unicode)), name - assert email is GithubObject.NotSet or isinstance(email, (str, unicode)), email - assert blog is GithubObject.NotSet or isinstance(blog, (str, unicode)), blog - assert company is GithubObject.NotSet or isinstance(company, (str, unicode)), company - assert location is GithubObject.NotSet or isinstance(location, (str, unicode)), location - assert hireable is GithubObject.NotSet or isinstance(hireable, bool), hireable - assert bio is GithubObject.NotSet or isinstance(bio, (str, unicode)), bio + def edit(self, name=github.GithubObject.NotSet, email=github.GithubObject.NotSet, blog=github.GithubObject.NotSet, company=github.GithubObject.NotSet, location=github.GithubObject.NotSet, hireable=github.GithubObject.NotSet, bio=github.GithubObject.NotSet): + assert name is github.GithubObject.NotSet or isinstance(name, (str, unicode)), name + assert email is github.GithubObject.NotSet or isinstance(email, (str, unicode)), email + assert blog is github.GithubObject.NotSet or isinstance(blog, (str, unicode)), blog + assert company is github.GithubObject.NotSet or isinstance(company, (str, unicode)), company + assert location is github.GithubObject.NotSet or isinstance(location, (str, unicode)), location + assert hireable is github.GithubObject.NotSet or isinstance(hireable, bool), hireable + assert bio is github.GithubObject.NotSet or isinstance(bio, (str, unicode)), bio post_parameters = dict() - if name is not GithubObject.NotSet: + if name is not github.GithubObject.NotSet: post_parameters["name"] = name - if email is not GithubObject.NotSet: + if email is not github.GithubObject.NotSet: post_parameters["email"] = email - if blog is not GithubObject.NotSet: + if blog is not github.GithubObject.NotSet: post_parameters["blog"] = blog - if company is not GithubObject.NotSet: + if company is not github.GithubObject.NotSet: post_parameters["company"] = company - if location is not GithubObject.NotSet: + if location is not github.GithubObject.NotSet: post_parameters["location"] = location - if hireable is not GithubObject.NotSet: + if hireable is not github.GithubObject.NotSet: post_parameters["hireable"] = hireable - if bio is not GithubObject.NotSet: + if bio is not github.GithubObject.NotSet: post_parameters["bio"] = bio headers, data = self._requester.requestAndCheck( "PATCH", @@ -338,11 +337,11 @@ class AuthenticatedUser(GithubObject.GithubObject): None, None ) - return Authorization.Authorization(self._requester, data, completed=True) + return github.Authorization.Authorization(self._requester, data, completed=True) def get_authorizations(self): - return PaginatedList.PaginatedList( - Authorization.Authorization, + return github.PaginatedList.PaginatedList( + github.Authorization.Authorization, self._requester, "/authorizations", None @@ -358,40 +357,40 @@ class AuthenticatedUser(GithubObject.GithubObject): return data def get_events(self): - return PaginatedList.PaginatedList( - Event.Event, + return github.PaginatedList.PaginatedList( + github.Event.Event, self._requester, "/events", None ) def get_followers(self): - return PaginatedList.PaginatedList( - NamedUser.NamedUser, + return github.PaginatedList.PaginatedList( + github.NamedUser.NamedUser, self._requester, "/user/followers", None ) def get_following(self): - return PaginatedList.PaginatedList( - NamedUser.NamedUser, + return github.PaginatedList.PaginatedList( + github.NamedUser.NamedUser, self._requester, "/user/following", None ) def get_gists(self): - return PaginatedList.PaginatedList( - Gist.Gist, + return github.PaginatedList.PaginatedList( + github.Gist.Gist, self._requester, "/gists", None ) def get_issues(self): - return PaginatedList.PaginatedList( - Issue.Issue, + return github.PaginatedList.PaginatedList( + github.Issue.Issue, self._requester, "/issues", None @@ -405,28 +404,28 @@ class AuthenticatedUser(GithubObject.GithubObject): None, None ) - return UserKey.UserKey(self._requester, data, completed=True) + return github.UserKey.UserKey(self._requester, data, completed=True) def get_keys(self): - return PaginatedList.PaginatedList( - UserKey.UserKey, + return github.PaginatedList.PaginatedList( + github.UserKey.UserKey, self._requester, "/user/keys", None ) def get_organization_events(self, org): - assert isinstance(org, Organization.Organization), org - return PaginatedList.PaginatedList( - Event.Event, + assert isinstance(org, github.Organization.Organization), org + return github.PaginatedList.PaginatedList( + github.Event.Event, self._requester, "/users/" + self.login + "/events/orgs/" + org.login, None ) def get_orgs(self): - return PaginatedList.PaginatedList( - Organization.Organization, + return github.PaginatedList.PaginatedList( + github.Organization.Organization, self._requester, "/user/orgs", None @@ -440,60 +439,60 @@ class AuthenticatedUser(GithubObject.GithubObject): None, None ) - return Repository.Repository(self._requester, data, completed=True) + return github.Repository.Repository(self._requester, data, completed=True) - def get_repos(self, type=GithubObject.NotSet, sort=GithubObject.NotSet, direction=GithubObject.NotSet): - assert type is GithubObject.NotSet or isinstance(type, (str, unicode)), type - assert sort is GithubObject.NotSet or isinstance(sort, (str, unicode)), sort - assert direction is GithubObject.NotSet or isinstance(direction, (str, unicode)), direction + def get_repos(self, type=github.GithubObject.NotSet, sort=github.GithubObject.NotSet, direction=github.GithubObject.NotSet): + assert type is github.GithubObject.NotSet or isinstance(type, (str, unicode)), type + assert sort is github.GithubObject.NotSet or isinstance(sort, (str, unicode)), sort + assert direction is github.GithubObject.NotSet or isinstance(direction, (str, unicode)), direction url_parameters = dict() - if type is not GithubObject.NotSet: + if type is not github.GithubObject.NotSet: url_parameters["type"] = type - if sort is not GithubObject.NotSet: + if sort is not github.GithubObject.NotSet: url_parameters["sort"] = sort - if direction is not GithubObject.NotSet: + if direction is not github.GithubObject.NotSet: url_parameters["direction"] = direction - return PaginatedList.PaginatedList( - Repository.Repository, + return github.PaginatedList.PaginatedList( + github.Repository.Repository, self._requester, "/user/repos", url_parameters ) def get_starred(self): - return PaginatedList.PaginatedList( - Repository.Repository, + return github.PaginatedList.PaginatedList( + github.Repository.Repository, self._requester, "/user/starred", None ) def get_starred_gists(self): - return PaginatedList.PaginatedList( - Gist.Gist, + return github.PaginatedList.PaginatedList( + github.Gist.Gist, self._requester, "/gists/starred", None ) def get_subscriptions(self): - return PaginatedList.PaginatedList( - Repository.Repository, + return github.PaginatedList.PaginatedList( + github.Repository.Repository, self._requester, "/user/subscriptions", None ) def get_watched(self): - return PaginatedList.PaginatedList( - Repository.Repository, + return github.PaginatedList.PaginatedList( + github.Repository.Repository, self._requester, "/user/watched", None ) def has_in_following(self, following): - assert isinstance(following, NamedUser.NamedUser), following + assert isinstance(following, github.NamedUser.NamedUser), following status, headers, data = self._requester.requestRaw( "GET", "/user/following/" + following._identity, @@ -503,7 +502,7 @@ class AuthenticatedUser(GithubObject.GithubObject): return status == 204 def has_in_starred(self, starred): - assert isinstance(starred, Repository.Repository), starred + assert isinstance(starred, github.Repository.Repository), starred status, headers, data = self._requester.requestRaw( "GET", "/user/starred/" + starred._identity, @@ -513,7 +512,7 @@ class AuthenticatedUser(GithubObject.GithubObject): return status == 204 def has_in_subscriptions(self, subscription): - assert isinstance(subscription, Repository.Repository), subscription + assert isinstance(subscription, github.Repository.Repository), subscription status, headers, data = self._requester.requestRaw( "GET", "/user/subscriptions/" + subscription._identity, @@ -523,7 +522,7 @@ class AuthenticatedUser(GithubObject.GithubObject): return status == 204 def has_in_watched(self, watched): - assert isinstance(watched, Repository.Repository), watched + assert isinstance(watched, github.Repository.Repository), watched status, headers, data = self._requester.requestRaw( "GET", "/user/watched/" + watched._identity, @@ -543,7 +542,7 @@ class AuthenticatedUser(GithubObject.GithubObject): ) def remove_from_following(self, following): - assert isinstance(following, NamedUser.NamedUser), following + assert isinstance(following, github.NamedUser.NamedUser), following headers, data = self._requester.requestAndCheck( "DELETE", "/user/following/" + following._identity, @@ -552,7 +551,7 @@ class AuthenticatedUser(GithubObject.GithubObject): ) def remove_from_starred(self, starred): - assert isinstance(starred, Repository.Repository), starred + assert isinstance(starred, github.Repository.Repository), starred headers, data = self._requester.requestAndCheck( "DELETE", "/user/starred/" + starred._identity, @@ -561,7 +560,7 @@ class AuthenticatedUser(GithubObject.GithubObject): ) def remove_from_subscriptions(self, subscription): - assert isinstance(subscription, Repository.Repository), subscription + assert isinstance(subscription, github.Repository.Repository), subscription headers, data = self._requester.requestAndCheck( "DELETE", "/user/subscriptions/" + subscription._identity, @@ -570,7 +569,7 @@ class AuthenticatedUser(GithubObject.GithubObject): ) def remove_from_watched(self, watched): - assert isinstance(watched, Repository.Repository), watched + assert isinstance(watched, github.Repository.Repository), watched headers, data = self._requester.requestAndCheck( "DELETE", "/user/watched/" + watched._identity, @@ -579,31 +578,31 @@ class AuthenticatedUser(GithubObject.GithubObject): ) def _initAttributes(self): - self._avatar_url = GithubObject.NotSet - self._bio = GithubObject.NotSet - self._blog = GithubObject.NotSet - self._collaborators = GithubObject.NotSet - self._company = GithubObject.NotSet - self._created_at = GithubObject.NotSet - self._disk_usage = GithubObject.NotSet - self._email = GithubObject.NotSet - self._followers = GithubObject.NotSet - self._following = GithubObject.NotSet - self._gravatar_id = GithubObject.NotSet - self._hireable = GithubObject.NotSet - self._html_url = GithubObject.NotSet - self._id = GithubObject.NotSet - self._location = GithubObject.NotSet - self._login = GithubObject.NotSet - self._name = GithubObject.NotSet - self._owned_private_repos = GithubObject.NotSet - self._plan = GithubObject.NotSet - self._private_gists = GithubObject.NotSet - self._public_gists = GithubObject.NotSet - self._public_repos = GithubObject.NotSet - self._total_private_repos = GithubObject.NotSet - self._type = GithubObject.NotSet - self._url = GithubObject.NotSet + self._avatar_url = github.GithubObject.NotSet + self._bio = github.GithubObject.NotSet + self._blog = github.GithubObject.NotSet + self._collaborators = github.GithubObject.NotSet + self._company = github.GithubObject.NotSet + self._created_at = github.GithubObject.NotSet + self._disk_usage = github.GithubObject.NotSet + self._email = github.GithubObject.NotSet + self._followers = github.GithubObject.NotSet + self._following = github.GithubObject.NotSet + self._gravatar_id = github.GithubObject.NotSet + self._hireable = github.GithubObject.NotSet + self._html_url = github.GithubObject.NotSet + self._id = github.GithubObject.NotSet + self._location = github.GithubObject.NotSet + self._login = github.GithubObject.NotSet + self._name = github.GithubObject.NotSet + self._owned_private_repos = github.GithubObject.NotSet + self._plan = github.GithubObject.NotSet + self._private_gists = github.GithubObject.NotSet + self._public_gists = github.GithubObject.NotSet + self._public_repos = github.GithubObject.NotSet + self._total_private_repos = github.GithubObject.NotSet + self._type = github.GithubObject.NotSet + self._url = github.GithubObject.NotSet def _useAttributes(self, attributes): if "avatar_url" in attributes: # pragma no branch @@ -662,7 +661,7 @@ class AuthenticatedUser(GithubObject.GithubObject): self._owned_private_repos = attributes["owned_private_repos"] if "plan" in attributes: # pragma no branch assert attributes["plan"] is None or isinstance(attributes["plan"], dict), attributes["plan"] - self._plan = None if attributes["plan"] is None else Plan.Plan(self._requester, attributes["plan"], completed=False) + self._plan = None if attributes["plan"] is None else github.Plan.Plan(self._requester, attributes["plan"], completed=False) if "private_gists" in attributes: # pragma no branch assert attributes["private_gists"] is None or isinstance(attributes["private_gists"], (int, long)), attributes["private_gists"] self._private_gists = attributes["private_gists"] diff --git a/github/Authorization.py b/github/Authorization.py index 4ee1a008..e6876565 100644 --- a/github/Authorization.py +++ b/github/Authorization.py @@ -13,12 +13,12 @@ # You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see . -import GithubObject +import github.GithubObject -import AuthorizationApplication +import github.AuthorizationApplication -class Authorization(GithubObject.GithubObject): +class Authorization(github.GithubObject.GithubObject): @property def app(self): self._completeIfNotSet(self._app) @@ -72,22 +72,22 @@ class Authorization(GithubObject.GithubObject): None ) - def edit(self, scopes=GithubObject.NotSet, add_scopes=GithubObject.NotSet, remove_scopes=GithubObject.NotSet, note=GithubObject.NotSet, note_url=GithubObject.NotSet): - assert scopes is GithubObject.NotSet or all(isinstance(element, (str, unicode)) for element in scopes), scopes - assert add_scopes is GithubObject.NotSet or all(isinstance(element, (str, unicode)) for element in add_scopes), add_scopes - assert remove_scopes is GithubObject.NotSet or all(isinstance(element, (str, unicode)) for element in remove_scopes), remove_scopes - assert note is GithubObject.NotSet or isinstance(note, (str, unicode)), note - assert note_url is GithubObject.NotSet or isinstance(note_url, (str, unicode)), note_url + def edit(self, scopes=github.GithubObject.NotSet, add_scopes=github.GithubObject.NotSet, remove_scopes=github.GithubObject.NotSet, note=github.GithubObject.NotSet, note_url=github.GithubObject.NotSet): + assert scopes is github.GithubObject.NotSet or all(isinstance(element, (str, unicode)) for element in scopes), scopes + assert add_scopes is github.GithubObject.NotSet or all(isinstance(element, (str, unicode)) for element in add_scopes), add_scopes + assert remove_scopes is github.GithubObject.NotSet or all(isinstance(element, (str, unicode)) for element in remove_scopes), remove_scopes + assert note is github.GithubObject.NotSet or isinstance(note, (str, unicode)), note + assert note_url is github.GithubObject.NotSet or isinstance(note_url, (str, unicode)), note_url post_parameters = dict() - if scopes is not GithubObject.NotSet: + if scopes is not github.GithubObject.NotSet: post_parameters["scopes"] = scopes - if add_scopes is not GithubObject.NotSet: + if add_scopes is not github.GithubObject.NotSet: post_parameters["add_scopes"] = add_scopes - if remove_scopes is not GithubObject.NotSet: + if remove_scopes is not github.GithubObject.NotSet: post_parameters["remove_scopes"] = remove_scopes - if note is not GithubObject.NotSet: + if note is not github.GithubObject.NotSet: post_parameters["note"] = note - if note_url is not GithubObject.NotSet: + if note_url is not github.GithubObject.NotSet: post_parameters["note_url"] = note_url headers, data = self._requester.requestAndCheck( "PATCH", @@ -98,20 +98,20 @@ class Authorization(GithubObject.GithubObject): self._useAttributes(data) def _initAttributes(self): - self._app = GithubObject.NotSet - self._created_at = GithubObject.NotSet - self._id = GithubObject.NotSet - self._note = GithubObject.NotSet - self._note_url = GithubObject.NotSet - self._scopes = GithubObject.NotSet - self._token = GithubObject.NotSet - self._updated_at = GithubObject.NotSet - self._url = GithubObject.NotSet + self._app = github.GithubObject.NotSet + self._created_at = github.GithubObject.NotSet + self._id = github.GithubObject.NotSet + self._note = github.GithubObject.NotSet + self._note_url = github.GithubObject.NotSet + self._scopes = github.GithubObject.NotSet + self._token = github.GithubObject.NotSet + self._updated_at = github.GithubObject.NotSet + self._url = github.GithubObject.NotSet def _useAttributes(self, attributes): if "app" in attributes: # pragma no branch assert attributes["app"] is None or isinstance(attributes["app"], dict), attributes["app"] - self._app = None if attributes["app"] is None else AuthorizationApplication.AuthorizationApplication(self._requester, attributes["app"], completed=False) + self._app = None if attributes["app"] is None else github.AuthorizationApplication.AuthorizationApplication(self._requester, attributes["app"], completed=False) if "created_at" in attributes: # pragma no branch assert attributes["created_at"] is None or isinstance(attributes["created_at"], (str, unicode)), attributes["created_at"] self._created_at = self._parseDatetime(attributes["created_at"]) diff --git a/github/AuthorizationApplication.py b/github/AuthorizationApplication.py index e99844dc..15326561 100644 --- a/github/AuthorizationApplication.py +++ b/github/AuthorizationApplication.py @@ -13,10 +13,10 @@ # You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see . -import GithubObject +import github.GithubObject -class AuthorizationApplication(GithubObject.GithubObject): +class AuthorizationApplication(github.GithubObject.GithubObject): @property def name(self): self._completeIfNotSet(self._name) @@ -28,8 +28,8 @@ class AuthorizationApplication(GithubObject.GithubObject): return self._NoneIfNotSet(self._url) def _initAttributes(self): - self._name = GithubObject.NotSet - self._url = GithubObject.NotSet + self._name = github.GithubObject.NotSet + self._url = github.GithubObject.NotSet def _useAttributes(self, attributes): if "name" in attributes: # pragma no branch diff --git a/github/Branch.py b/github/Branch.py index a49e9a7a..c843d54e 100644 --- a/github/Branch.py +++ b/github/Branch.py @@ -13,12 +13,12 @@ # You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see . -import GithubObject +import github.GithubObject -import Commit +import github.Commit -class Branch(GithubObject.BasicGithubObject): +class Branch(github.GithubObject.BasicGithubObject): @property def commit(self): return self._NoneIfNotSet(self._commit) @@ -28,13 +28,13 @@ class Branch(GithubObject.BasicGithubObject): return self._NoneIfNotSet(self._name) def _initAttributes(self): - self._commit = GithubObject.NotSet - self._name = GithubObject.NotSet + self._commit = github.GithubObject.NotSet + self._name = github.GithubObject.NotSet def _useAttributes(self, attributes): if "commit" in attributes: # pragma no branch assert attributes["commit"] is None or isinstance(attributes["commit"], dict), attributes["commit"] - self._commit = None if attributes["commit"] is None else Commit.Commit(self._requester, attributes["commit"], completed=False) + self._commit = None if attributes["commit"] is None else github.Commit.Commit(self._requester, attributes["commit"], completed=False) if "name" in attributes: # pragma no branch assert attributes["name"] is None or isinstance(attributes["name"], (str, unicode)), attributes["name"] self._name = attributes["name"] diff --git a/github/Commit.py b/github/Commit.py index 88610b1a..6998596e 100644 --- a/github/Commit.py +++ b/github/Commit.py @@ -13,19 +13,18 @@ # You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see . -import GithubObject -import PaginatedList +import github.GithubObject +import github.PaginatedList -import GitCommit -import NamedUser -import CommitStatus -import File -import CommitStats -import Commit -import CommitComment +import github.GitCommit +import github.NamedUser +import github.CommitStatus +import github.File +import github.CommitStats +import github.CommitComment -class Commit(GithubObject.GithubObject): +class Commit(github.GithubObject.GithubObject): @property def author(self): self._completeIfNotSet(self._author) @@ -66,19 +65,19 @@ class Commit(GithubObject.GithubObject): self._completeIfNotSet(self._url) return self._NoneIfNotSet(self._url) - def create_comment(self, body, line=GithubObject.NotSet, path=GithubObject.NotSet, position=GithubObject.NotSet): + def create_comment(self, body, line=github.GithubObject.NotSet, path=github.GithubObject.NotSet, position=github.GithubObject.NotSet): assert isinstance(body, (str, unicode)), body - assert line is GithubObject.NotSet or isinstance(line, (int, long)), line - assert path is GithubObject.NotSet or isinstance(path, (str, unicode)), path - assert position is GithubObject.NotSet or isinstance(position, (int, long)), position + assert line is github.GithubObject.NotSet or isinstance(line, (int, long)), line + assert path is github.GithubObject.NotSet or isinstance(path, (str, unicode)), path + assert position is github.GithubObject.NotSet or isinstance(position, (int, long)), position post_parameters = { "body": body, } - if line is not GithubObject.NotSet: + if line is not github.GithubObject.NotSet: post_parameters["line"] = line - if path is not GithubObject.NotSet: + if path is not github.GithubObject.NotSet: post_parameters["path"] = path - if position is not GithubObject.NotSet: + if position is not github.GithubObject.NotSet: post_parameters["position"] = position headers, data = self._requester.requestAndCheck( "POST", @@ -86,18 +85,18 @@ class Commit(GithubObject.GithubObject): None, post_parameters ) - return CommitComment.CommitComment(self._requester, data, completed=True) + return github.CommitComment.CommitComment(self._requester, data, completed=True) - def create_status(self, state, target_url=GithubObject.NotSet, description=GithubObject.NotSet): + def create_status(self, state, target_url=github.GithubObject.NotSet, description=github.GithubObject.NotSet): assert isinstance(state, (str, unicode)), state - assert target_url is GithubObject.NotSet or isinstance(target_url, (str, unicode)), target_url - assert description is GithubObject.NotSet or isinstance(description, (str, unicode)), description + assert target_url is github.GithubObject.NotSet or isinstance(target_url, (str, unicode)), target_url + assert description is github.GithubObject.NotSet or isinstance(description, (str, unicode)), description post_parameters = { "state": state, } - if target_url is not GithubObject.NotSet: + if target_url is not github.GithubObject.NotSet: post_parameters["target_url"] = target_url - if description is not GithubObject.NotSet: + if description is not github.GithubObject.NotSet: post_parameters["description"] = description headers, data = self._requester.requestAndCheck( "POST", @@ -105,19 +104,19 @@ class Commit(GithubObject.GithubObject): None, post_parameters ) - return CommitStatus.CommitStatus(self._requester, data, completed=True) + return github.CommitStatus.CommitStatus(self._requester, data, completed=True) def get_comments(self): - return PaginatedList.PaginatedList( - CommitComment.CommitComment, + return github.PaginatedList.PaginatedList( + github.CommitComment.CommitComment, self._requester, self.url + "/comments", None ) def get_statuses(self): - return PaginatedList.PaginatedList( - CommitStatus.CommitStatus, + return github.PaginatedList.PaginatedList( + github.CommitStatus.CommitStatus, self._requester, self._parentUrl(self._parentUrl(self.url)) + "/statuses/" + self.sha, None @@ -128,29 +127,29 @@ class Commit(GithubObject.GithubObject): return self.sha def _initAttributes(self): - self._author = GithubObject.NotSet - self._commit = GithubObject.NotSet - self._committer = GithubObject.NotSet - self._files = GithubObject.NotSet - self._parents = GithubObject.NotSet - self._sha = GithubObject.NotSet - self._stats = GithubObject.NotSet - self._url = GithubObject.NotSet + self._author = github.GithubObject.NotSet + self._commit = github.GithubObject.NotSet + self._committer = github.GithubObject.NotSet + self._files = github.GithubObject.NotSet + self._parents = github.GithubObject.NotSet + self._sha = github.GithubObject.NotSet + self._stats = github.GithubObject.NotSet + self._url = github.GithubObject.NotSet def _useAttributes(self, attributes): if "author" in attributes: # pragma no branch assert attributes["author"] is None or isinstance(attributes["author"], dict), attributes["author"] - self._author = None if attributes["author"] is None else NamedUser.NamedUser(self._requester, attributes["author"], completed=False) + self._author = None if attributes["author"] is None else github.NamedUser.NamedUser(self._requester, attributes["author"], completed=False) if "commit" in attributes: # pragma no branch assert attributes["commit"] is None or isinstance(attributes["commit"], dict), attributes["commit"] - self._commit = None if attributes["commit"] is None else GitCommit.GitCommit(self._requester, attributes["commit"], completed=False) + self._commit = None if attributes["commit"] is None else github.GitCommit.GitCommit(self._requester, attributes["commit"], completed=False) if "committer" in attributes: # pragma no branch assert attributes["committer"] is None or isinstance(attributes["committer"], dict), attributes["committer"] - self._committer = None if attributes["committer"] is None else NamedUser.NamedUser(self._requester, attributes["committer"], completed=False) + self._committer = None if attributes["committer"] is None else github.NamedUser.NamedUser(self._requester, attributes["committer"], completed=False) if "files" in attributes: # pragma no branch assert attributes["files"] is None or all(isinstance(element, dict) for element in attributes["files"]), attributes["files"] self._files = None if attributes["files"] is None else [ - File.File(self._requester, element, completed=False) + github.File.File(self._requester, element, completed=False) for element in attributes["files"] ] if "parents" in attributes: # pragma no branch @@ -164,7 +163,7 @@ class Commit(GithubObject.GithubObject): self._sha = attributes["sha"] if "stats" in attributes: # pragma no branch assert attributes["stats"] is None or isinstance(attributes["stats"], dict), attributes["stats"] - self._stats = None if attributes["stats"] is None else CommitStats.CommitStats(self._requester, attributes["stats"], completed=False) + self._stats = None if attributes["stats"] is None else github.CommitStats.CommitStats(self._requester, attributes["stats"], completed=False) if "url" in attributes: # pragma no branch assert attributes["url"] is None or isinstance(attributes["url"], (str, unicode)), attributes["url"] self._url = attributes["url"] diff --git a/github/CommitComment.py b/github/CommitComment.py index 335285de..f5d93c72 100644 --- a/github/CommitComment.py +++ b/github/CommitComment.py @@ -13,12 +13,12 @@ # You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see . -import GithubObject +import github.GithubObject -import NamedUser +import github.NamedUser -class CommitComment(GithubObject.GithubObject): +class CommitComment(github.GithubObject.GithubObject): @property def body(self): self._completeIfNotSet(self._body) @@ -96,17 +96,17 @@ class CommitComment(GithubObject.GithubObject): self._useAttributes(data) def _initAttributes(self): - self._body = GithubObject.NotSet - self._commit_id = GithubObject.NotSet - self._created_at = GithubObject.NotSet - self._html_url = GithubObject.NotSet - self._id = GithubObject.NotSet - self._line = GithubObject.NotSet - self._path = GithubObject.NotSet - self._position = GithubObject.NotSet - self._updated_at = GithubObject.NotSet - self._url = GithubObject.NotSet - self._user = GithubObject.NotSet + self._body = github.GithubObject.NotSet + self._commit_id = github.GithubObject.NotSet + self._created_at = github.GithubObject.NotSet + self._html_url = github.GithubObject.NotSet + self._id = github.GithubObject.NotSet + self._line = github.GithubObject.NotSet + self._path = github.GithubObject.NotSet + self._position = github.GithubObject.NotSet + self._updated_at = github.GithubObject.NotSet + self._url = github.GithubObject.NotSet + self._user = github.GithubObject.NotSet def _useAttributes(self, attributes): if "body" in attributes: # pragma no branch @@ -141,4 +141,4 @@ class CommitComment(GithubObject.GithubObject): self._url = attributes["url"] if "user" in attributes: # pragma no branch assert attributes["user"] is None or isinstance(attributes["user"], dict), attributes["user"] - self._user = None if attributes["user"] is None else NamedUser.NamedUser(self._requester, attributes["user"], completed=False) + self._user = None if attributes["user"] is None else github.NamedUser.NamedUser(self._requester, attributes["user"], completed=False) diff --git a/github/CommitStats.py b/github/CommitStats.py index 0fed5814..7740614b 100644 --- a/github/CommitStats.py +++ b/github/CommitStats.py @@ -13,10 +13,10 @@ # You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see . -import GithubObject +import github.GithubObject -class CommitStats(GithubObject.BasicGithubObject): +class CommitStats(github.GithubObject.BasicGithubObject): @property def additions(self): return self._NoneIfNotSet(self._additions) @@ -30,9 +30,9 @@ class CommitStats(GithubObject.BasicGithubObject): return self._NoneIfNotSet(self._total) def _initAttributes(self): - self._additions = GithubObject.NotSet - self._deletions = GithubObject.NotSet - self._total = GithubObject.NotSet + self._additions = github.GithubObject.NotSet + self._deletions = github.GithubObject.NotSet + self._total = github.GithubObject.NotSet def _useAttributes(self, attributes): if "additions" in attributes: # pragma no branch diff --git a/github/CommitStatus.py b/github/CommitStatus.py index 62e367d4..29b7e43b 100644 --- a/github/CommitStatus.py +++ b/github/CommitStatus.py @@ -13,12 +13,12 @@ # You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see . -import GithubObject +import github.GithubObject -import NamedUser +import github.NamedUser -class CommitStatus(GithubObject.BasicGithubObject): +class CommitStatus(github.GithubObject.BasicGithubObject): @property def created_at(self): return self._NoneIfNotSet(self._created_at) @@ -48,13 +48,13 @@ class CommitStatus(GithubObject.BasicGithubObject): return self._NoneIfNotSet(self._updated_at) def _initAttributes(self): - self._created_at = GithubObject.NotSet - self._creator = GithubObject.NotSet - self._description = GithubObject.NotSet - self._id = GithubObject.NotSet - self._state = GithubObject.NotSet - self._target_url = GithubObject.NotSet - self._updated_at = GithubObject.NotSet + self._created_at = github.GithubObject.NotSet + self._creator = github.GithubObject.NotSet + self._description = github.GithubObject.NotSet + self._id = github.GithubObject.NotSet + self._state = github.GithubObject.NotSet + self._target_url = github.GithubObject.NotSet + self._updated_at = github.GithubObject.NotSet def _useAttributes(self, attributes): if "created_at" in attributes: # pragma no branch @@ -62,7 +62,7 @@ class CommitStatus(GithubObject.BasicGithubObject): self._created_at = self._parseDatetime(attributes["created_at"]) if "creator" in attributes: # pragma no branch assert attributes["creator"] is None or isinstance(attributes["creator"], dict), attributes["creator"] - self._creator = None if attributes["creator"] is None else NamedUser.NamedUser(self._requester, attributes["creator"], completed=False) + self._creator = None if attributes["creator"] is None else github.NamedUser.NamedUser(self._requester, attributes["creator"], completed=False) if "description" in attributes: # pragma no branch assert attributes["description"] is None or isinstance(attributes["description"], (str, unicode)), attributes["description"] self._description = attributes["description"] diff --git a/github/Comparison.py b/github/Comparison.py index c4007f5e..8fe9771e 100644 --- a/github/Comparison.py +++ b/github/Comparison.py @@ -13,13 +13,13 @@ # You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see . -import GithubObject +import github.GithubObject -import Commit -import File +import github.Commit +import github.File -class Comparison(GithubObject.GithubObject): +class Comparison(github.GithubObject.GithubObject): @property def ahead_by(self): self._completeIfNotSet(self._ahead_by) @@ -81,18 +81,18 @@ class Comparison(GithubObject.GithubObject): return self._NoneIfNotSet(self._url) def _initAttributes(self): - self._ahead_by = GithubObject.NotSet - self._base_commit = GithubObject.NotSet - self._behind_by = GithubObject.NotSet - self._commits = GithubObject.NotSet - self._diff_url = GithubObject.NotSet - self._files = GithubObject.NotSet - self._html_url = GithubObject.NotSet - self._patch_url = GithubObject.NotSet - self._permalink_url = GithubObject.NotSet - self._status = GithubObject.NotSet - self._total_commits = GithubObject.NotSet - self._url = GithubObject.NotSet + self._ahead_by = github.GithubObject.NotSet + self._base_commit = github.GithubObject.NotSet + self._behind_by = github.GithubObject.NotSet + self._commits = github.GithubObject.NotSet + self._diff_url = github.GithubObject.NotSet + self._files = github.GithubObject.NotSet + self._html_url = github.GithubObject.NotSet + self._patch_url = github.GithubObject.NotSet + self._permalink_url = github.GithubObject.NotSet + self._status = github.GithubObject.NotSet + self._total_commits = github.GithubObject.NotSet + self._url = github.GithubObject.NotSet def _useAttributes(self, attributes): if "ahead_by" in attributes: # pragma no branch @@ -100,14 +100,14 @@ class Comparison(GithubObject.GithubObject): self._ahead_by = attributes["ahead_by"] if "base_commit" in attributes: # pragma no branch assert attributes["base_commit"] is None or isinstance(attributes["base_commit"], dict), attributes["base_commit"] - self._base_commit = None if attributes["base_commit"] is None else Commit.Commit(self._requester, attributes["base_commit"], completed=False) + self._base_commit = None if attributes["base_commit"] is None else github.Commit.Commit(self._requester, attributes["base_commit"], completed=False) if "behind_by" in attributes: # pragma no branch assert attributes["behind_by"] is None or isinstance(attributes["behind_by"], (int, long)), attributes["behind_by"] self._behind_by = attributes["behind_by"] if "commits" in attributes: # pragma no branch assert attributes["commits"] is None or all(isinstance(element, dict) for element in attributes["commits"]), attributes["commits"] self._commits = None if attributes["commits"] is None else [ - Commit.Commit(self._requester, element, completed=False) + github.Commit.Commit(self._requester, element, completed=False) for element in attributes["commits"] ] if "diff_url" in attributes: # pragma no branch @@ -116,7 +116,7 @@ class Comparison(GithubObject.GithubObject): if "files" in attributes: # pragma no branch assert attributes["files"] is None or all(isinstance(element, dict) for element in attributes["files"]), attributes["files"] self._files = None if attributes["files"] is None else [ - File.File(self._requester, element, completed=False) + github.File.File(self._requester, element, completed=False) for element in attributes["files"] ] if "html_url" in attributes: # pragma no branch diff --git a/github/ContentFile.py b/github/ContentFile.py index 9c8ceca7..4f43188c 100644 --- a/github/ContentFile.py +++ b/github/ContentFile.py @@ -13,10 +13,10 @@ # You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see . -import GithubObject +import github.GithubObject -class ContentFile(GithubObject.BasicGithubObject): +class ContentFile(github.GithubObject.BasicGithubObject): @property def content(self): return self._NoneIfNotSet(self._content) @@ -46,13 +46,13 @@ class ContentFile(GithubObject.BasicGithubObject): return self._NoneIfNotSet(self._type) def _initAttributes(self): - self._content = GithubObject.NotSet - self._encoding = GithubObject.NotSet - self._name = GithubObject.NotSet - self._path = GithubObject.NotSet - self._sha = GithubObject.NotSet - self._size = GithubObject.NotSet - self._type = GithubObject.NotSet + self._content = github.GithubObject.NotSet + self._encoding = github.GithubObject.NotSet + self._name = github.GithubObject.NotSet + self._path = github.GithubObject.NotSet + self._sha = github.GithubObject.NotSet + self._size = github.GithubObject.NotSet + self._type = github.GithubObject.NotSet def _useAttributes(self, attributes): if "content" in attributes: # pragma no branch diff --git a/github/Download.py b/github/Download.py index 52ecc86f..6e172a1e 100644 --- a/github/Download.py +++ b/github/Download.py @@ -13,10 +13,10 @@ # You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see . -import GithubObject +import github.GithubObject -class Download(GithubObject.GithubObject): +class Download(github.GithubObject.GithubObject): @property def accesskeyid(self): self._completeIfNotSet(self._accesskeyid) @@ -126,26 +126,26 @@ class Download(GithubObject.GithubObject): ) def _initAttributes(self): - self._accesskeyid = GithubObject.NotSet - self._acl = GithubObject.NotSet - self._bucket = GithubObject.NotSet - self._content_type = GithubObject.NotSet - self._created_at = GithubObject.NotSet - self._description = GithubObject.NotSet - self._download_count = GithubObject.NotSet - self._expirationdate = GithubObject.NotSet - self._html_url = GithubObject.NotSet - self._id = GithubObject.NotSet - self._mime_type = GithubObject.NotSet - self._name = GithubObject.NotSet - self._path = GithubObject.NotSet - self._policy = GithubObject.NotSet - self._prefix = GithubObject.NotSet - self._redirect = GithubObject.NotSet - self._s3_url = GithubObject.NotSet - self._signature = GithubObject.NotSet - self._size = GithubObject.NotSet - self._url = GithubObject.NotSet + self._accesskeyid = github.GithubObject.NotSet + self._acl = github.GithubObject.NotSet + self._bucket = github.GithubObject.NotSet + self._content_type = github.GithubObject.NotSet + self._created_at = github.GithubObject.NotSet + self._description = github.GithubObject.NotSet + self._download_count = github.GithubObject.NotSet + self._expirationdate = github.GithubObject.NotSet + self._html_url = github.GithubObject.NotSet + self._id = github.GithubObject.NotSet + self._mime_type = github.GithubObject.NotSet + self._name = github.GithubObject.NotSet + self._path = github.GithubObject.NotSet + self._policy = github.GithubObject.NotSet + self._prefix = github.GithubObject.NotSet + self._redirect = github.GithubObject.NotSet + self._s3_url = github.GithubObject.NotSet + self._signature = github.GithubObject.NotSet + self._size = github.GithubObject.NotSet + self._url = github.GithubObject.NotSet def _useAttributes(self, attributes): if "accesskeyid" in attributes: # pragma no branch diff --git a/github/Event.py b/github/Event.py index 4c8b3b3b..238907d2 100644 --- a/github/Event.py +++ b/github/Event.py @@ -13,14 +13,14 @@ # You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see . -import GithubObject +import github.GithubObject -import Organization -import Repository -import NamedUser +import github.Organization +import github.Repository +import github.NamedUser -class Event(GithubObject.BasicGithubObject): +class Event(github.GithubObject.BasicGithubObject): @property def actor(self): return self._NoneIfNotSet(self._actor) @@ -54,19 +54,19 @@ class Event(GithubObject.BasicGithubObject): return self._NoneIfNotSet(self._type) def _initAttributes(self): - self._actor = GithubObject.NotSet - self._created_at = GithubObject.NotSet - self._id = GithubObject.NotSet - self._org = GithubObject.NotSet - self._payload = GithubObject.NotSet - self._public = GithubObject.NotSet - self._repo = GithubObject.NotSet - self._type = GithubObject.NotSet + self._actor = github.GithubObject.NotSet + self._created_at = github.GithubObject.NotSet + self._id = github.GithubObject.NotSet + self._org = github.GithubObject.NotSet + self._payload = github.GithubObject.NotSet + self._public = github.GithubObject.NotSet + self._repo = github.GithubObject.NotSet + self._type = github.GithubObject.NotSet def _useAttributes(self, attributes): if "actor" in attributes: # pragma no branch assert attributes["actor"] is None or isinstance(attributes["actor"], dict), attributes["actor"] - self._actor = None if attributes["actor"] is None else NamedUser.NamedUser(self._requester, attributes["actor"], completed=False) + self._actor = None if attributes["actor"] is None else github.NamedUser.NamedUser(self._requester, attributes["actor"], completed=False) if "created_at" in attributes: # pragma no branch assert attributes["created_at"] is None or isinstance(attributes["created_at"], (str, unicode)), attributes["created_at"] self._created_at = self._parseDatetime(attributes["created_at"]) @@ -75,7 +75,7 @@ class Event(GithubObject.BasicGithubObject): self._id = attributes["id"] if "org" in attributes: # pragma no branch assert attributes["org"] is None or isinstance(attributes["org"], dict), attributes["org"] - self._org = None if attributes["org"] is None else Organization.Organization(self._requester, attributes["org"], completed=False) + self._org = None if attributes["org"] is None else github.Organization.Organization(self._requester, attributes["org"], completed=False) if "payload" in attributes: # pragma no branch assert attributes["payload"] is None or isinstance(attributes["payload"], dict), attributes["payload"] self._payload = attributes["payload"] @@ -84,7 +84,7 @@ class Event(GithubObject.BasicGithubObject): self._public = attributes["public"] if "repo" in attributes: # pragma no branch assert attributes["repo"] is None or isinstance(attributes["repo"], dict), attributes["repo"] - self._repo = None if attributes["repo"] is None else Repository.Repository(self._requester, attributes["repo"], completed=False) + self._repo = None if attributes["repo"] is None else github.Repository.Repository(self._requester, attributes["repo"], completed=False) if "type" in attributes: # pragma no branch assert attributes["type"] is None or isinstance(attributes["type"], (str, unicode)), attributes["type"] self._type = attributes["type"] diff --git a/github/File.py b/github/File.py index 9a6a9d16..f01f0183 100644 --- a/github/File.py +++ b/github/File.py @@ -13,10 +13,10 @@ # You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see . -import GithubObject +import github.GithubObject -class File(GithubObject.BasicGithubObject): +class File(github.GithubObject.BasicGithubObject): @property def additions(self): return self._NoneIfNotSet(self._additions) @@ -54,15 +54,15 @@ class File(GithubObject.BasicGithubObject): return self._NoneIfNotSet(self._status) def _initAttributes(self): - self._additions = GithubObject.NotSet - self._blob_url = GithubObject.NotSet - self._changes = GithubObject.NotSet - self._deletions = GithubObject.NotSet - self._filename = GithubObject.NotSet - self._patch = GithubObject.NotSet - self._raw_url = GithubObject.NotSet - self._sha = GithubObject.NotSet - self._status = GithubObject.NotSet + self._additions = github.GithubObject.NotSet + self._blob_url = github.GithubObject.NotSet + self._changes = github.GithubObject.NotSet + self._deletions = github.GithubObject.NotSet + self._filename = github.GithubObject.NotSet + self._patch = github.GithubObject.NotSet + self._raw_url = github.GithubObject.NotSet + self._sha = github.GithubObject.NotSet + self._status = github.GithubObject.NotSet def _useAttributes(self, attributes): if "additions" in attributes: # pragma no branch diff --git a/github/Gist.py b/github/Gist.py index aa5256d5..cdf7339a 100644 --- a/github/Gist.py +++ b/github/Gist.py @@ -13,18 +13,16 @@ # You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see . -import GithubObject -import PaginatedList +import github.GithubObject +import github.PaginatedList -import Gist -import GistComment -import NamedUser -import GistFile -import InputFileContent -import GistHistoryState +import github.GistComment +import github.NamedUser +import github.GistFile +import github.GistHistoryState -class Gist(GithubObject.GithubObject): +class Gist(github.GithubObject.GithubObject): @property def comments(self): self._completeIfNotSet(self._comments) @@ -111,7 +109,7 @@ class Gist(GithubObject.GithubObject): None, post_parameters ) - return GistComment.GistComment(self._requester, data, completed=True) + return github.GistComment.GistComment(self._requester, data, completed=True) def create_fork(self): headers, data = self._requester.requestAndCheck( @@ -130,13 +128,13 @@ class Gist(GithubObject.GithubObject): None ) - def edit(self, description=GithubObject.NotSet, files=GithubObject.NotSet): - assert description is GithubObject.NotSet or isinstance(description, (str, unicode)), description - assert files is GithubObject.NotSet or all(isinstance(element, InputFileContent.InputFileContent) for element in files.itervalues()), files + def edit(self, description=github.GithubObject.NotSet, files=github.GithubObject.NotSet): + assert description is github.GithubObject.NotSet or isinstance(description, (str, unicode)), description + assert files is github.GithubObject.NotSet or all(isinstance(element, github.InputFileContent) for element in files.itervalues()), files post_parameters = dict() - if description is not GithubObject.NotSet: + if description is not github.GithubObject.NotSet: post_parameters["description"] = description - if files is not GithubObject.NotSet: + if files is not github.GithubObject.NotSet: post_parameters["files"] = dict((key, value._identity) for key, value in files.iteritems()) headers, data = self._requester.requestAndCheck( "PATCH", @@ -154,11 +152,11 @@ class Gist(GithubObject.GithubObject): None, None ) - return GistComment.GistComment(self._requester, data, completed=True) + return github.GistComment.GistComment(self._requester, data, completed=True) def get_comments(self): - return PaginatedList.PaginatedList( - GistComment.GistComment, + return github.PaginatedList.PaginatedList( + github.GistComment.GistComment, self._requester, self.url + "/comments", None @@ -190,21 +188,21 @@ class Gist(GithubObject.GithubObject): ) def _initAttributes(self): - self._comments = GithubObject.NotSet - self._created_at = GithubObject.NotSet - self._description = GithubObject.NotSet - self._files = GithubObject.NotSet - self._fork_of = GithubObject.NotSet - self._forks = GithubObject.NotSet - self._git_pull_url = GithubObject.NotSet - self._git_push_url = GithubObject.NotSet - self._history = GithubObject.NotSet - self._html_url = GithubObject.NotSet - self._id = GithubObject.NotSet - self._public = GithubObject.NotSet - self._updated_at = GithubObject.NotSet - self._url = GithubObject.NotSet - self._user = GithubObject.NotSet + self._comments = github.GithubObject.NotSet + self._created_at = github.GithubObject.NotSet + self._description = github.GithubObject.NotSet + self._files = github.GithubObject.NotSet + self._fork_of = github.GithubObject.NotSet + self._forks = github.GithubObject.NotSet + self._git_pull_url = github.GithubObject.NotSet + self._git_push_url = github.GithubObject.NotSet + self._history = github.GithubObject.NotSet + self._html_url = github.GithubObject.NotSet + self._id = github.GithubObject.NotSet + self._public = github.GithubObject.NotSet + self._updated_at = github.GithubObject.NotSet + self._url = github.GithubObject.NotSet + self._user = github.GithubObject.NotSet def _useAttributes(self, attributes): if "comments" in attributes: # pragma no branch @@ -219,7 +217,7 @@ class Gist(GithubObject.GithubObject): if "files" in attributes: # pragma no branch assert attributes["files"] is None or all(isinstance(element, dict) for element in attributes["files"].itervalues()), attributes["files"] self._files = None if attributes["files"] is None else dict( - (key, GistFile.GistFile(self._requester, element, completed=False)) + (key, github.GistFile.GistFile(self._requester, element, completed=False)) for key, element in attributes["files"].iteritems() ) if "fork_of" in attributes: # pragma no branch @@ -240,7 +238,7 @@ class Gist(GithubObject.GithubObject): if "history" in attributes: # pragma no branch assert attributes["history"] is None or all(isinstance(element, dict) for element in attributes["history"]), attributes["history"] self._history = None if attributes["history"] is None else [ - GistHistoryState.GistHistoryState(self._requester, element, completed=False) + github.GistHistoryState.GistHistoryState(self._requester, element, completed=False) for element in attributes["history"] ] if "html_url" in attributes: # pragma no branch @@ -260,4 +258,4 @@ class Gist(GithubObject.GithubObject): self._url = attributes["url"] if "user" in attributes: # pragma no branch assert attributes["user"] is None or isinstance(attributes["user"], dict), attributes["user"] - self._user = None if attributes["user"] is None else NamedUser.NamedUser(self._requester, attributes["user"], completed=False) + self._user = None if attributes["user"] is None else github.NamedUser.NamedUser(self._requester, attributes["user"], completed=False) diff --git a/github/GistComment.py b/github/GistComment.py index 6cd36d49..1d0a573c 100644 --- a/github/GistComment.py +++ b/github/GistComment.py @@ -13,12 +13,12 @@ # You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see . -import GithubObject +import github.GithubObject -import NamedUser +import github.NamedUser -class GistComment(GithubObject.GithubObject): +class GistComment(github.GithubObject.GithubObject): @property def body(self): self._completeIfNotSet(self._body) @@ -71,12 +71,12 @@ class GistComment(GithubObject.GithubObject): self._useAttributes(data) def _initAttributes(self): - self._body = GithubObject.NotSet - self._created_at = GithubObject.NotSet - self._id = GithubObject.NotSet - self._updated_at = GithubObject.NotSet - self._url = GithubObject.NotSet - self._user = GithubObject.NotSet + self._body = github.GithubObject.NotSet + self._created_at = github.GithubObject.NotSet + self._id = github.GithubObject.NotSet + self._updated_at = github.GithubObject.NotSet + self._url = github.GithubObject.NotSet + self._user = github.GithubObject.NotSet def _useAttributes(self, attributes): if "body" in attributes: # pragma no branch @@ -96,4 +96,4 @@ class GistComment(GithubObject.GithubObject): self._url = attributes["url"] if "user" in attributes: # pragma no branch assert attributes["user"] is None or isinstance(attributes["user"], dict), attributes["user"] - self._user = None if attributes["user"] is None else NamedUser.NamedUser(self._requester, attributes["user"], completed=False) + self._user = None if attributes["user"] is None else github.NamedUser.NamedUser(self._requester, attributes["user"], completed=False) diff --git a/github/GistFile.py b/github/GistFile.py index c5011dca..4e2fb323 100644 --- a/github/GistFile.py +++ b/github/GistFile.py @@ -13,10 +13,10 @@ # You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see . -import GithubObject +import github.GithubObject -class GistFile(GithubObject.BasicGithubObject): +class GistFile(github.GithubObject.BasicGithubObject): @property def content(self): return self._NoneIfNotSet(self._content) @@ -38,11 +38,11 @@ class GistFile(GithubObject.BasicGithubObject): return self._NoneIfNotSet(self._size) def _initAttributes(self): - self._content = GithubObject.NotSet - self._filename = GithubObject.NotSet - self._language = GithubObject.NotSet - self._raw_url = GithubObject.NotSet - self._size = GithubObject.NotSet + self._content = github.GithubObject.NotSet + self._filename = github.GithubObject.NotSet + self._language = github.GithubObject.NotSet + self._raw_url = github.GithubObject.NotSet + self._size = github.GithubObject.NotSet def _useAttributes(self, attributes): if "content" in attributes: # pragma no branch diff --git a/github/GistHistoryState.py b/github/GistHistoryState.py index 0c214fff..89c8349e 100644 --- a/github/GistHistoryState.py +++ b/github/GistHistoryState.py @@ -13,13 +13,13 @@ # You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see . -import GithubObject +import github.GithubObject -import NamedUser -import CommitStats +import github.NamedUser +import github.CommitStats -class GistHistoryState(GithubObject.GithubObject): +class GistHistoryState(github.GithubObject.GithubObject): @property def change_status(self): self._completeIfNotSet(self._change_status) @@ -46,16 +46,16 @@ class GistHistoryState(GithubObject.GithubObject): return self._NoneIfNotSet(self._version) def _initAttributes(self): - self._change_status = GithubObject.NotSet - self._committed_at = GithubObject.NotSet - self._url = GithubObject.NotSet - self._user = GithubObject.NotSet - self._version = GithubObject.NotSet + self._change_status = github.GithubObject.NotSet + self._committed_at = github.GithubObject.NotSet + self._url = github.GithubObject.NotSet + self._user = github.GithubObject.NotSet + self._version = github.GithubObject.NotSet def _useAttributes(self, attributes): if "change_status" in attributes: # pragma no branch assert attributes["change_status"] is None or isinstance(attributes["change_status"], dict), attributes["change_status"] - self._change_status = None if attributes["change_status"] is None else CommitStats.CommitStats(self._requester, attributes["change_status"], completed=False) + self._change_status = None if attributes["change_status"] is None else github.CommitStats.CommitStats(self._requester, attributes["change_status"], completed=False) if "committed_at" in attributes: # pragma no branch assert attributes["committed_at"] is None or isinstance(attributes["committed_at"], (str, unicode)), attributes["committed_at"] self._committed_at = self._parseDatetime(attributes["committed_at"]) @@ -64,7 +64,7 @@ class GistHistoryState(GithubObject.GithubObject): self._url = attributes["url"] if "user" in attributes: # pragma no branch assert attributes["user"] is None or isinstance(attributes["user"], dict), attributes["user"] - self._user = None if attributes["user"] is None else NamedUser.NamedUser(self._requester, attributes["user"], completed=False) + self._user = None if attributes["user"] is None else github.NamedUser.NamedUser(self._requester, attributes["user"], completed=False) if "version" in attributes: # pragma no branch assert attributes["version"] is None or isinstance(attributes["version"], (str, unicode)), attributes["version"] self._version = attributes["version"] diff --git a/github/GitAuthor.py b/github/GitAuthor.py index a14f31c9..fe378303 100644 --- a/github/GitAuthor.py +++ b/github/GitAuthor.py @@ -13,10 +13,10 @@ # You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see . -import GithubObject +import github.GithubObject -class GitAuthor(GithubObject.BasicGithubObject): +class GitAuthor(github.GithubObject.BasicGithubObject): @property def date(self): return self._NoneIfNotSet(self._date) @@ -30,9 +30,9 @@ class GitAuthor(GithubObject.BasicGithubObject): return self._NoneIfNotSet(self._name) def _initAttributes(self): - self._date = GithubObject.NotSet - self._email = GithubObject.NotSet - self._name = GithubObject.NotSet + self._date = github.GithubObject.NotSet + self._email = github.GithubObject.NotSet + self._name = github.GithubObject.NotSet def _useAttributes(self, attributes): if "date" in attributes: # pragma no branch diff --git a/github/GitBlob.py b/github/GitBlob.py index 9ab38b92..bd5a304f 100644 --- a/github/GitBlob.py +++ b/github/GitBlob.py @@ -13,10 +13,10 @@ # You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see . -import GithubObject +import github.GithubObject -class GitBlob(GithubObject.GithubObject): +class GitBlob(github.GithubObject.GithubObject): @property def content(self): self._completeIfNotSet(self._content) @@ -43,11 +43,11 @@ class GitBlob(GithubObject.GithubObject): return self._NoneIfNotSet(self._url) def _initAttributes(self): - self._content = GithubObject.NotSet - self._encoding = GithubObject.NotSet - self._sha = GithubObject.NotSet - self._size = GithubObject.NotSet - self._url = GithubObject.NotSet + self._content = github.GithubObject.NotSet + self._encoding = github.GithubObject.NotSet + self._sha = github.GithubObject.NotSet + self._size = github.GithubObject.NotSet + self._url = github.GithubObject.NotSet def _useAttributes(self, attributes): if "content" in attributes: # pragma no branch diff --git a/github/GitCommit.py b/github/GitCommit.py index 0dcf1de5..3e3afe88 100644 --- a/github/GitCommit.py +++ b/github/GitCommit.py @@ -13,14 +13,13 @@ # You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see . -import GithubObject +import github.GithubObject -import GitAuthor -import GitCommit -import GitTree +import github.GitAuthor +import github.GitTree -class GitCommit(GithubObject.GithubObject): +class GitCommit(github.GithubObject.GithubObject): @property def author(self): self._completeIfNotSet(self._author) @@ -61,21 +60,21 @@ class GitCommit(GithubObject.GithubObject): return self.sha def _initAttributes(self): - self._author = GithubObject.NotSet - self._committer = GithubObject.NotSet - self._message = GithubObject.NotSet - self._parents = GithubObject.NotSet - self._sha = GithubObject.NotSet - self._tree = GithubObject.NotSet - self._url = GithubObject.NotSet + self._author = github.GithubObject.NotSet + self._committer = github.GithubObject.NotSet + self._message = github.GithubObject.NotSet + self._parents = github.GithubObject.NotSet + self._sha = github.GithubObject.NotSet + self._tree = github.GithubObject.NotSet + self._url = github.GithubObject.NotSet def _useAttributes(self, attributes): if "author" in attributes: # pragma no branch assert attributes["author"] is None or isinstance(attributes["author"], dict), attributes["author"] - self._author = None if attributes["author"] is None else GitAuthor.GitAuthor(self._requester, attributes["author"], completed=False) + self._author = None if attributes["author"] is None else github.GitAuthor.GitAuthor(self._requester, attributes["author"], completed=False) if "committer" in attributes: # pragma no branch assert attributes["committer"] is None or isinstance(attributes["committer"], dict), attributes["committer"] - self._committer = None if attributes["committer"] is None else GitAuthor.GitAuthor(self._requester, attributes["committer"], completed=False) + self._committer = None if attributes["committer"] is None else github.GitAuthor.GitAuthor(self._requester, attributes["committer"], completed=False) if "message" in attributes: # pragma no branch assert attributes["message"] is None or isinstance(attributes["message"], (str, unicode)), attributes["message"] self._message = attributes["message"] @@ -90,7 +89,7 @@ class GitCommit(GithubObject.GithubObject): self._sha = attributes["sha"] if "tree" in attributes: # pragma no branch assert attributes["tree"] is None or isinstance(attributes["tree"], dict), attributes["tree"] - self._tree = None if attributes["tree"] is None else GitTree.GitTree(self._requester, attributes["tree"], completed=False) + self._tree = None if attributes["tree"] is None else github.GitTree.GitTree(self._requester, attributes["tree"], completed=False) if "url" in attributes: # pragma no branch assert attributes["url"] is None or isinstance(attributes["url"], (str, unicode)), attributes["url"] self._url = attributes["url"] diff --git a/github/GitObject.py b/github/GitObject.py index 5b6b308b..e5a2db27 100644 --- a/github/GitObject.py +++ b/github/GitObject.py @@ -13,10 +13,10 @@ # You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see . -import GithubObject +import github.GithubObject -class GitObject(GithubObject.BasicGithubObject): +class GitObject(github.GithubObject.BasicGithubObject): @property def sha(self): return self._NoneIfNotSet(self._sha) @@ -30,9 +30,9 @@ class GitObject(GithubObject.BasicGithubObject): return self._NoneIfNotSet(self._url) def _initAttributes(self): - self._sha = GithubObject.NotSet - self._type = GithubObject.NotSet - self._url = GithubObject.NotSet + self._sha = github.GithubObject.NotSet + self._type = github.GithubObject.NotSet + self._url = github.GithubObject.NotSet def _useAttributes(self, attributes): if "sha" in attributes: # pragma no branch diff --git a/github/GitRef.py b/github/GitRef.py index 58b2426f..ce6a0904 100644 --- a/github/GitRef.py +++ b/github/GitRef.py @@ -13,12 +13,12 @@ # You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see . -import GithubObject +import github.GithubObject -import GitObject +import github.GitObject -class GitRef(GithubObject.GithubObject): +class GitRef(github.GithubObject.GithubObject): @property def object(self): self._completeIfNotSet(self._object) @@ -42,13 +42,13 @@ class GitRef(GithubObject.GithubObject): None ) - def edit(self, sha, force=GithubObject.NotSet): + def edit(self, sha, force=github.GithubObject.NotSet): assert isinstance(sha, (str, unicode)), sha - assert force is GithubObject.NotSet or isinstance(force, bool), force + assert force is github.GithubObject.NotSet or isinstance(force, bool), force post_parameters = { "sha": sha, } - if force is not GithubObject.NotSet: + if force is not github.GithubObject.NotSet: post_parameters["force"] = force headers, data = self._requester.requestAndCheck( "PATCH", @@ -59,14 +59,14 @@ class GitRef(GithubObject.GithubObject): self._useAttributes(data) def _initAttributes(self): - self._object = GithubObject.NotSet - self._ref = GithubObject.NotSet - self._url = GithubObject.NotSet + self._object = github.GithubObject.NotSet + self._ref = github.GithubObject.NotSet + self._url = github.GithubObject.NotSet def _useAttributes(self, attributes): if "object" in attributes: # pragma no branch assert attributes["object"] is None or isinstance(attributes["object"], dict), attributes["object"] - self._object = None if attributes["object"] is None else GitObject.GitObject(self._requester, attributes["object"], completed=False) + self._object = None if attributes["object"] is None else github.GitObject.GitObject(self._requester, attributes["object"], completed=False) if "ref" in attributes: # pragma no branch assert attributes["ref"] is None or isinstance(attributes["ref"], (str, unicode)), attributes["ref"] self._ref = attributes["ref"] diff --git a/github/GitTag.py b/github/GitTag.py index 664bc8aa..fa16597e 100644 --- a/github/GitTag.py +++ b/github/GitTag.py @@ -13,13 +13,13 @@ # You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see . -import GithubObject +import github.GithubObject -import GitAuthor -import GitObject +import github.GitAuthor +import github.GitObject -class GitTag(GithubObject.GithubObject): +class GitTag(github.GithubObject.GithubObject): @property def message(self): self._completeIfNotSet(self._message) @@ -51,12 +51,12 @@ class GitTag(GithubObject.GithubObject): return self._NoneIfNotSet(self._url) def _initAttributes(self): - self._message = GithubObject.NotSet - self._object = GithubObject.NotSet - self._sha = GithubObject.NotSet - self._tag = GithubObject.NotSet - self._tagger = GithubObject.NotSet - self._url = GithubObject.NotSet + self._message = github.GithubObject.NotSet + self._object = github.GithubObject.NotSet + self._sha = github.GithubObject.NotSet + self._tag = github.GithubObject.NotSet + self._tagger = github.GithubObject.NotSet + self._url = github.GithubObject.NotSet def _useAttributes(self, attributes): if "message" in attributes: # pragma no branch @@ -64,7 +64,7 @@ class GitTag(GithubObject.GithubObject): self._message = attributes["message"] if "object" in attributes: # pragma no branch assert attributes["object"] is None or isinstance(attributes["object"], dict), attributes["object"] - self._object = None if attributes["object"] is None else GitObject.GitObject(self._requester, attributes["object"], completed=False) + self._object = None if attributes["object"] is None else github.GitObject.GitObject(self._requester, attributes["object"], completed=False) if "sha" in attributes: # pragma no branch assert attributes["sha"] is None or isinstance(attributes["sha"], (str, unicode)), attributes["sha"] self._sha = attributes["sha"] @@ -73,7 +73,7 @@ class GitTag(GithubObject.GithubObject): self._tag = attributes["tag"] if "tagger" in attributes: # pragma no branch assert attributes["tagger"] is None or isinstance(attributes["tagger"], dict), attributes["tagger"] - self._tagger = None if attributes["tagger"] is None else GitAuthor.GitAuthor(self._requester, attributes["tagger"], completed=False) + self._tagger = None if attributes["tagger"] is None else github.GitAuthor.GitAuthor(self._requester, attributes["tagger"], completed=False) if "url" in attributes: # pragma no branch assert attributes["url"] is None or isinstance(attributes["url"], (str, unicode)), attributes["url"] self._url = attributes["url"] diff --git a/github/GitTree.py b/github/GitTree.py index 3af066ab..926776f9 100644 --- a/github/GitTree.py +++ b/github/GitTree.py @@ -13,12 +13,12 @@ # You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see . -import GithubObject +import github.GithubObject -import GitTreeElement +import github.GitTreeElement -class GitTree(GithubObject.GithubObject): +class GitTree(github.GithubObject.GithubObject): @property def sha(self): self._completeIfNotSet(self._sha) @@ -39,9 +39,9 @@ class GitTree(GithubObject.GithubObject): return self.sha def _initAttributes(self): - self._sha = GithubObject.NotSet - self._tree = GithubObject.NotSet - self._url = GithubObject.NotSet + self._sha = github.GithubObject.NotSet + self._tree = github.GithubObject.NotSet + self._url = github.GithubObject.NotSet def _useAttributes(self, attributes): if "sha" in attributes: # pragma no branch @@ -50,7 +50,7 @@ class GitTree(GithubObject.GithubObject): if "tree" in attributes: # pragma no branch assert attributes["tree"] is None or all(isinstance(element, dict) for element in attributes["tree"]), attributes["tree"] self._tree = None if attributes["tree"] is None else [ - GitTreeElement.GitTreeElement(self._requester, element, completed=False) + github.GitTreeElement.GitTreeElement(self._requester, element, completed=False) for element in attributes["tree"] ] if "url" in attributes: # pragma no branch diff --git a/github/GitTreeElement.py b/github/GitTreeElement.py index 6d0aa9ae..d2ec2027 100644 --- a/github/GitTreeElement.py +++ b/github/GitTreeElement.py @@ -13,10 +13,10 @@ # You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see . -import GithubObject +import github.GithubObject -class GitTreeElement(GithubObject.BasicGithubObject): +class GitTreeElement(github.GithubObject.BasicGithubObject): @property def mode(self): return self._NoneIfNotSet(self._mode) @@ -42,12 +42,12 @@ class GitTreeElement(GithubObject.BasicGithubObject): return self._NoneIfNotSet(self._url) def _initAttributes(self): - self._mode = GithubObject.NotSet - self._path = GithubObject.NotSet - self._sha = GithubObject.NotSet - self._size = GithubObject.NotSet - self._type = GithubObject.NotSet - self._url = GithubObject.NotSet + self._mode = github.GithubObject.NotSet + self._path = github.GithubObject.NotSet + self._sha = github.GithubObject.NotSet + self._size = github.GithubObject.NotSet + self._type = github.GithubObject.NotSet + self._url = github.GithubObject.NotSet def _useAttributes(self, attributes): if "mode" in attributes: # pragma no branch diff --git a/github/Github.py b/github/Github.py index 32d69c91..e4e548f6 100644 --- a/github/Github.py +++ b/github/Github.py @@ -20,10 +20,10 @@ import AuthenticatedUser import NamedUser import Organization import Gist -import PaginatedList +import github.PaginatedList import Repository import Legacy -import GithubObject +import github.GithubObject import HookDescription @@ -47,9 +47,9 @@ class Github(object): def rate_limiting(self): return self.__requester.rate_limiting - def get_user(self, login=GithubObject.NotSet): - assert login is GithubObject.NotSet or isinstance(login, (str, unicode)), login - if login is GithubObject.NotSet: + def get_user(self, login=github.GithubObject.NotSet): + assert login is github.GithubObject.NotSet or isinstance(login, (str, unicode)), login + if login is github.GithubObject.NotSet: return AuthenticatedUser.AuthenticatedUser(self.__requester, {"url": "/user"}, completed=False) else: headers, data = self.__requester.requestAndCheck( @@ -58,7 +58,7 @@ class Github(object): None, None ) - return NamedUser.NamedUser(self.__requester, data, completed=True) + return github.NamedUser.NamedUser(self.__requester, data, completed=True) def get_organization(self, login): assert isinstance(login, (str, unicode)), login @@ -68,7 +68,7 @@ class Github(object): None, None ) - return Organization.Organization(self.__requester, data, completed=True) + return github.Organization.Organization(self.__requester, data, completed=True) def get_gist(self, id): assert isinstance(id, (str, unicode)), id @@ -78,27 +78,27 @@ class Github(object): None, None ) - return Gist.Gist(self.__requester, data, completed=True) + return github.Gist.Gist(self.__requester, data, completed=True) def get_gists(self): - return PaginatedList.PaginatedList( - Gist.Gist, + return github.PaginatedList.PaginatedList( + github.Gist.Gist, self.__requester, "/gists/public", None ) - def legacy_search_repos(self, keyword, language=GithubObject.NotSet): + def legacy_search_repos(self, keyword, language=github.GithubObject.NotSet): assert isinstance(keyword, (str, unicode)), keyword - assert language is GithubObject.NotSet or isinstance(language, (str, unicode)), language - args = {} if language is GithubObject.NotSet else {"language": language} + assert language is github.GithubObject.NotSet or isinstance(language, (str, unicode)), language + args = {} if language is github.GithubObject.NotSet else {"language": language} return Legacy.PaginatedList( "/legacy/repos/search/" + urllib.quote(keyword), args, self.__requester, "repositories", Legacy.convertRepo, - Repository.Repository, + github.Repository.Repository, ) def legacy_search_users(self, keyword): @@ -109,7 +109,7 @@ class Github(object): self.__requester, "users", Legacy.convertUser, - NamedUser.NamedUser, + github.NamedUser.NamedUser, ) def legacy_search_user_by_email(self, email): @@ -120,15 +120,15 @@ class Github(object): None, None ) - return NamedUser.NamedUser(self.__requester, Legacy.convertUser(data["user"]), completed=False) + return github.NamedUser.NamedUser(self.__requester, Legacy.convertUser(data["user"]), completed=False) - def render_markdown(self, text, context=GithubObject.NotSet): + def render_markdown(self, text, context=github.GithubObject.NotSet): assert isinstance(text, (str, unicode)), text - assert context is GithubObject.NotSet or isinstance(context, Repository.Repository), context + assert context is github.GithubObject.NotSet or isinstance(context, github.Repository.Repository), context post_parameters = { "text": text } - if context is not GithubObject.NotSet: + if context is not github.GithubObject.NotSet: post_parameters["mode"] = "gfm" post_parameters["context"] = context._identity status, headers, data = self.__requester.requestRaw( diff --git a/github/Hook.py b/github/Hook.py index 86fc0918..a1faccb1 100644 --- a/github/Hook.py +++ b/github/Hook.py @@ -13,12 +13,12 @@ # You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see . -import GithubObject +import github.GithubObject -import HookResponse +import github.HookResponse -class Hook(GithubObject.GithubObject): +class Hook(github.GithubObject.GithubObject): @property def active(self): self._completeIfNotSet(self._active) @@ -72,24 +72,24 @@ class Hook(GithubObject.GithubObject): None ) - def edit(self, name, config, events=GithubObject.NotSet, add_events=GithubObject.NotSet, remove_events=GithubObject.NotSet, active=GithubObject.NotSet): + def edit(self, name, config, events=github.GithubObject.NotSet, add_events=github.GithubObject.NotSet, remove_events=github.GithubObject.NotSet, active=github.GithubObject.NotSet): assert isinstance(name, (str, unicode)), name assert isinstance(config, dict), config - assert events is GithubObject.NotSet or all(isinstance(element, (str, unicode)) for element in events), events - assert add_events is GithubObject.NotSet or all(isinstance(element, (str, unicode)) for element in add_events), add_events - assert remove_events is GithubObject.NotSet or all(isinstance(element, (str, unicode)) for element in remove_events), remove_events - assert active is GithubObject.NotSet or isinstance(active, bool), active + assert events is github.GithubObject.NotSet or all(isinstance(element, (str, unicode)) for element in events), events + assert add_events is github.GithubObject.NotSet or all(isinstance(element, (str, unicode)) for element in add_events), add_events + assert remove_events is github.GithubObject.NotSet or all(isinstance(element, (str, unicode)) for element in remove_events), remove_events + assert active is github.GithubObject.NotSet or isinstance(active, bool), active post_parameters = { "name": name, "config": config, } - if events is not GithubObject.NotSet: + if events is not github.GithubObject.NotSet: post_parameters["events"] = events - if add_events is not GithubObject.NotSet: + if add_events is not github.GithubObject.NotSet: post_parameters["add_events"] = add_events - if remove_events is not GithubObject.NotSet: + if remove_events is not github.GithubObject.NotSet: post_parameters["remove_events"] = remove_events - if active is not GithubObject.NotSet: + if active is not github.GithubObject.NotSet: post_parameters["active"] = active headers, data = self._requester.requestAndCheck( "PATCH", @@ -108,15 +108,15 @@ class Hook(GithubObject.GithubObject): ) def _initAttributes(self): - self._active = GithubObject.NotSet - self._config = GithubObject.NotSet - self._created_at = GithubObject.NotSet - self._events = GithubObject.NotSet - self._id = GithubObject.NotSet - self._last_response = GithubObject.NotSet - self._name = GithubObject.NotSet - self._updated_at = GithubObject.NotSet - self._url = GithubObject.NotSet + self._active = github.GithubObject.NotSet + self._config = github.GithubObject.NotSet + self._created_at = github.GithubObject.NotSet + self._events = github.GithubObject.NotSet + self._id = github.GithubObject.NotSet + self._last_response = github.GithubObject.NotSet + self._name = github.GithubObject.NotSet + self._updated_at = github.GithubObject.NotSet + self._url = github.GithubObject.NotSet def _useAttributes(self, attributes): if "active" in attributes: # pragma no branch @@ -136,7 +136,7 @@ class Hook(GithubObject.GithubObject): self._id = attributes["id"] if "last_response" in attributes: # pragma no branch assert attributes["last_response"] is None or isinstance(attributes["last_response"], dict), attributes["last_response"] - self._last_response = None if attributes["last_response"] is None else HookResponse.HookResponse(self._requester, attributes["last_response"], completed=False) + self._last_response = None if attributes["last_response"] is None else github.HookResponse.HookResponse(self._requester, attributes["last_response"], completed=False) if "name" in attributes: # pragma no branch assert attributes["name"] is None or isinstance(attributes["name"], (str, unicode)), attributes["name"] self._name = attributes["name"] diff --git a/github/HookDescription.py b/github/HookDescription.py index 28e4e654..68fd4269 100644 --- a/github/HookDescription.py +++ b/github/HookDescription.py @@ -13,10 +13,10 @@ # You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see . -import GithubObject +import github.GithubObject -class HookDescription(GithubObject.BasicGithubObject): +class HookDescription(github.GithubObject.BasicGithubObject): @property def events(self): return self._NoneIfNotSet(self._events) @@ -34,10 +34,10 @@ class HookDescription(GithubObject.BasicGithubObject): return self._NoneIfNotSet(self._supported_events) def _initAttributes(self): - self._events = GithubObject.NotSet - self._name = GithubObject.NotSet - self._schema = GithubObject.NotSet - self._supported_events = GithubObject.NotSet + self._events = github.GithubObject.NotSet + self._name = github.GithubObject.NotSet + self._schema = github.GithubObject.NotSet + self._supported_events = github.GithubObject.NotSet def _useAttributes(self, attributes): if "events" in attributes: # pragma no branch diff --git a/github/HookResponse.py b/github/HookResponse.py index a280c785..3554c481 100644 --- a/github/HookResponse.py +++ b/github/HookResponse.py @@ -13,10 +13,10 @@ # You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see . -import GithubObject +import github.GithubObject -class HookResponse(GithubObject.BasicGithubObject): +class HookResponse(github.GithubObject.BasicGithubObject): @property def code(self): return self._NoneIfNotSet(self._code) @@ -30,9 +30,9 @@ class HookResponse(GithubObject.BasicGithubObject): return self._NoneIfNotSet(self._status) def _initAttributes(self): - self._code = GithubObject.NotSet - self._message = GithubObject.NotSet - self._status = GithubObject.NotSet + self._code = github.GithubObject.NotSet + self._message = github.GithubObject.NotSet + self._status = github.GithubObject.NotSet def _useAttributes(self, attributes): if "code" in attributes: # pragma no branch diff --git a/github/InputGitTreeElement.py b/github/InputGitTreeElement.py index edf56150..5211fa99 100644 --- a/github/InputGitTreeElement.py +++ b/github/InputGitTreeElement.py @@ -13,11 +13,11 @@ # You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see . -import GithubObject +import github.GithubObject class InputGitTreeElement(object): - def __init__(self, path, mode, type, content=GithubObject.NotSet, sha=GithubObject.NotSet): + def __init__(self, path, mode, type, content=github.GithubObject.NotSet, sha=github.GithubObject.NotSet): self.__path = path self.__mode = mode self.__type = type @@ -31,8 +31,8 @@ class InputGitTreeElement(object): "mode": self.__mode, "type": self.__type, } - if self.__sha is not GithubObject.NotSet: + if self.__sha is not github.GithubObject.NotSet: identity["sha"] = self.__sha - if self.__content is not GithubObject.NotSet: + if self.__content is not github.GithubObject.NotSet: identity["content"] = self.__content return identity diff --git a/github/Issue.py b/github/Issue.py index fa50729b..c502f30e 100644 --- a/github/Issue.py +++ b/github/Issue.py @@ -13,19 +13,19 @@ # You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see . -import GithubObject -import PaginatedList +import github.GithubObject +import github.PaginatedList -import Repository -import IssueEvent -import Label -import NamedUser -import Milestone -import IssueComment -import IssuePullRequest +import github.Repository +import github.IssueEvent +import github.Label +import github.NamedUser +import github.Milestone +import github.IssueComment +import github.IssuePullRequest -class Issue(GithubObject.GithubObject): +class Issue(github.GithubObject.GithubObject): @property def assignee(self): self._completeIfNotSet(self._assignee) @@ -117,7 +117,7 @@ class Issue(GithubObject.GithubObject): return self._NoneIfNotSet(self._user) def add_to_labels(self, *labels): - assert all(isinstance(element, Label.Label) for element in labels), labels + assert all(isinstance(element, github.Label.Label) for element in labels), labels post_parameters = [label.name for label in labels] headers, data = self._requester.requestAndCheck( "POST", @@ -137,7 +137,7 @@ class Issue(GithubObject.GithubObject): None, post_parameters ) - return IssueComment.IssueComment(self._requester, data, completed=True) + return github.IssueComment.IssueComment(self._requester, data, completed=True) def delete_labels(self): headers, data = self._requester.requestAndCheck( @@ -147,25 +147,25 @@ class Issue(GithubObject.GithubObject): None ) - def edit(self, title=GithubObject.NotSet, body=GithubObject.NotSet, assignee=GithubObject.NotSet, state=GithubObject.NotSet, milestone=GithubObject.NotSet, labels=GithubObject.NotSet): - assert title is GithubObject.NotSet or isinstance(title, (str, unicode)), title - assert body is GithubObject.NotSet or isinstance(body, (str, unicode)), body - assert assignee is GithubObject.NotSet or assignee is None or isinstance(assignee, NamedUser.NamedUser), assignee - assert state is GithubObject.NotSet or isinstance(state, (str, unicode)), state - assert milestone is GithubObject.NotSet or milestone is None or isinstance(milestone, Milestone.Milestone), milestone - assert labels is GithubObject.NotSet or all(isinstance(element, (str, unicode)) for element in labels), labels + def edit(self, title=github.GithubObject.NotSet, body=github.GithubObject.NotSet, assignee=github.GithubObject.NotSet, state=github.GithubObject.NotSet, milestone=github.GithubObject.NotSet, labels=github.GithubObject.NotSet): + 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 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 post_parameters = dict() - if title is not GithubObject.NotSet: + if title is not github.GithubObject.NotSet: post_parameters["title"] = title - if body is not GithubObject.NotSet: + if body is not github.GithubObject.NotSet: post_parameters["body"] = body - if assignee is not GithubObject.NotSet: + if assignee is not github.GithubObject.NotSet: post_parameters["assignee"] = assignee._identity if assignee else '' - if state is not GithubObject.NotSet: + if state is not github.GithubObject.NotSet: post_parameters["state"] = state - if milestone is not GithubObject.NotSet: + if milestone is not github.GithubObject.NotSet: post_parameters["milestone"] = milestone._identity if milestone else '' - if labels is not GithubObject.NotSet: + if labels is not github.GithubObject.NotSet: post_parameters["labels"] = labels headers, data = self._requester.requestAndCheck( "PATCH", @@ -183,34 +183,34 @@ class Issue(GithubObject.GithubObject): None, None ) - return IssueComment.IssueComment(self._requester, data, completed=True) + return github.IssueComment.IssueComment(self._requester, data, completed=True) def get_comments(self): - return PaginatedList.PaginatedList( - IssueComment.IssueComment, + return github.PaginatedList.PaginatedList( + github.IssueComment.IssueComment, self._requester, self.url + "/comments", None ) def get_events(self): - return PaginatedList.PaginatedList( - IssueEvent.IssueEvent, + return github.PaginatedList.PaginatedList( + github.IssueEvent.IssueEvent, self._requester, self.url + "/events", None ) def get_labels(self): - return PaginatedList.PaginatedList( - Label.Label, + return github.PaginatedList.PaginatedList( + github.Label.Label, self._requester, self.url + "/labels", None ) def remove_from_labels(self, label): - assert isinstance(label, Label.Label), label + assert isinstance(label, github.Label.Label), label headers, data = self._requester.requestAndCheck( "DELETE", self.url + "/labels/" + label._identity, @@ -219,7 +219,7 @@ class Issue(GithubObject.GithubObject): ) def set_labels(self, *labels): - assert all(isinstance(element, Label.Label) for element in labels), labels + assert all(isinstance(element, github.Label.Label) for element in labels), labels post_parameters = [label.name for label in labels] headers, data = self._requester.requestAndCheck( "PUT", @@ -233,29 +233,29 @@ class Issue(GithubObject.GithubObject): return self.number def _initAttributes(self): - self._assignee = GithubObject.NotSet - self._body = GithubObject.NotSet - self._closed_at = GithubObject.NotSet - self._closed_by = GithubObject.NotSet - self._comments = GithubObject.NotSet - self._created_at = GithubObject.NotSet - self._html_url = GithubObject.NotSet - self._id = GithubObject.NotSet - self._labels = GithubObject.NotSet - self._milestone = GithubObject.NotSet - self._number = GithubObject.NotSet - self._pull_request = GithubObject.NotSet - self._repository = GithubObject.NotSet - self._state = GithubObject.NotSet - self._title = GithubObject.NotSet - self._updated_at = GithubObject.NotSet - self._url = GithubObject.NotSet - self._user = GithubObject.NotSet + self._assignee = github.GithubObject.NotSet + self._body = github.GithubObject.NotSet + self._closed_at = github.GithubObject.NotSet + self._closed_by = github.GithubObject.NotSet + self._comments = github.GithubObject.NotSet + self._created_at = github.GithubObject.NotSet + self._html_url = github.GithubObject.NotSet + self._id = github.GithubObject.NotSet + self._labels = github.GithubObject.NotSet + self._milestone = github.GithubObject.NotSet + self._number = github.GithubObject.NotSet + self._pull_request = github.GithubObject.NotSet + self._repository = github.GithubObject.NotSet + self._state = github.GithubObject.NotSet + self._title = github.GithubObject.NotSet + self._updated_at = github.GithubObject.NotSet + self._url = github.GithubObject.NotSet + self._user = github.GithubObject.NotSet def _useAttributes(self, attributes): if "assignee" in attributes: # pragma no branch assert attributes["assignee"] is None or isinstance(attributes["assignee"], dict), attributes["assignee"] - self._assignee = None if attributes["assignee"] is None else NamedUser.NamedUser(self._requester, attributes["assignee"], completed=False) + self._assignee = None if attributes["assignee"] is None else github.NamedUser.NamedUser(self._requester, attributes["assignee"], completed=False) if "body" in attributes: # pragma no branch assert attributes["body"] is None or isinstance(attributes["body"], (str, unicode)), attributes["body"] self._body = attributes["body"] @@ -264,7 +264,7 @@ class Issue(GithubObject.GithubObject): self._closed_at = self._parseDatetime(attributes["closed_at"]) if "closed_by" in attributes: # pragma no branch assert attributes["closed_by"] is None or isinstance(attributes["closed_by"], dict), attributes["closed_by"] - self._closed_by = None if attributes["closed_by"] is None else NamedUser.NamedUser(self._requester, attributes["closed_by"], completed=False) + self._closed_by = None if attributes["closed_by"] is None else github.NamedUser.NamedUser(self._requester, attributes["closed_by"], completed=False) if "comments" in attributes: # pragma no branch assert attributes["comments"] is None or isinstance(attributes["comments"], (int, long)), attributes["comments"] self._comments = attributes["comments"] @@ -280,21 +280,21 @@ class Issue(GithubObject.GithubObject): if "labels" in attributes: # pragma no branch assert attributes["labels"] is None or all(isinstance(element, dict) for element in attributes["labels"]), attributes["labels"] self._labels = None if attributes["labels"] is None else [ - Label.Label(self._requester, element, completed=False) + github.Label.Label(self._requester, element, completed=False) for element in attributes["labels"] ] if "milestone" in attributes: # pragma no branch assert attributes["milestone"] is None or isinstance(attributes["milestone"], dict), attributes["milestone"] - self._milestone = None if attributes["milestone"] is None else Milestone.Milestone(self._requester, attributes["milestone"], completed=False) + self._milestone = None if attributes["milestone"] is None else github.Milestone.Milestone(self._requester, attributes["milestone"], completed=False) if "number" in attributes: # pragma no branch assert attributes["number"] is None or isinstance(attributes["number"], (int, long)), attributes["number"] self._number = attributes["number"] if "pull_request" in attributes: # pragma no branch assert attributes["pull_request"] is None or isinstance(attributes["pull_request"], dict), attributes["pull_request"] - self._pull_request = None if attributes["pull_request"] is None else IssuePullRequest.IssuePullRequest(self._requester, attributes["pull_request"], completed=False) + self._pull_request = None if attributes["pull_request"] is None else github.IssuePullRequest.IssuePullRequest(self._requester, attributes["pull_request"], completed=False) if "repository" in attributes: # pragma no branch assert attributes["repository"] is None or isinstance(attributes["repository"], dict), attributes["repository"] - self._repository = None if attributes["repository"] is None else Repository.Repository(self._requester, attributes["repository"], completed=False) + self._repository = None if attributes["repository"] is None else github.Repository.Repository(self._requester, attributes["repository"], completed=False) if "state" in attributes: # pragma no branch assert attributes["state"] is None or isinstance(attributes["state"], (str, unicode)), attributes["state"] self._state = attributes["state"] @@ -309,4 +309,4 @@ class Issue(GithubObject.GithubObject): self._url = attributes["url"] if "user" in attributes: # pragma no branch assert attributes["user"] is None or isinstance(attributes["user"], dict), attributes["user"] - self._user = None if attributes["user"] is None else NamedUser.NamedUser(self._requester, attributes["user"], completed=False) + self._user = None if attributes["user"] is None else github.NamedUser.NamedUser(self._requester, attributes["user"], completed=False) diff --git a/github/IssueComment.py b/github/IssueComment.py index e8f779c4..aab643a4 100644 --- a/github/IssueComment.py +++ b/github/IssueComment.py @@ -13,12 +13,12 @@ # You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see . -import GithubObject +import github.GithubObject -import NamedUser +import github.NamedUser -class IssueComment(GithubObject.GithubObject): +class IssueComment(github.GithubObject.GithubObject): @property def body(self): self._completeIfNotSet(self._body) @@ -71,12 +71,12 @@ class IssueComment(GithubObject.GithubObject): self._useAttributes(data) def _initAttributes(self): - self._body = GithubObject.NotSet - self._created_at = GithubObject.NotSet - self._id = GithubObject.NotSet - self._updated_at = GithubObject.NotSet - self._url = GithubObject.NotSet - self._user = GithubObject.NotSet + self._body = github.GithubObject.NotSet + self._created_at = github.GithubObject.NotSet + self._id = github.GithubObject.NotSet + self._updated_at = github.GithubObject.NotSet + self._url = github.GithubObject.NotSet + self._user = github.GithubObject.NotSet def _useAttributes(self, attributes): if "body" in attributes: # pragma no branch @@ -96,4 +96,4 @@ class IssueComment(GithubObject.GithubObject): self._url = attributes["url"] if "user" in attributes: # pragma no branch assert attributes["user"] is None or isinstance(attributes["user"], dict), attributes["user"] - self._user = None if attributes["user"] is None else NamedUser.NamedUser(self._requester, attributes["user"], completed=False) + self._user = None if attributes["user"] is None else github.NamedUser.NamedUser(self._requester, attributes["user"], completed=False) diff --git a/github/IssueEvent.py b/github/IssueEvent.py index 7dd49336..08992044 100644 --- a/github/IssueEvent.py +++ b/github/IssueEvent.py @@ -13,13 +13,13 @@ # You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see . -import GithubObject +import github.GithubObject -import Issue -import NamedUser +import github.Issue +import github.NamedUser -class IssueEvent(GithubObject.GithubObject): +class IssueEvent(github.GithubObject.GithubObject): @property def actor(self): self._completeIfNotSet(self._actor) @@ -56,18 +56,18 @@ class IssueEvent(GithubObject.GithubObject): return self._NoneIfNotSet(self._url) def _initAttributes(self): - self._actor = GithubObject.NotSet - self._commit_id = GithubObject.NotSet - self._created_at = GithubObject.NotSet - self._event = GithubObject.NotSet - self._id = GithubObject.NotSet - self._issue = GithubObject.NotSet - self._url = GithubObject.NotSet + self._actor = github.GithubObject.NotSet + self._commit_id = github.GithubObject.NotSet + self._created_at = github.GithubObject.NotSet + self._event = github.GithubObject.NotSet + self._id = github.GithubObject.NotSet + self._issue = github.GithubObject.NotSet + self._url = github.GithubObject.NotSet def _useAttributes(self, attributes): if "actor" in attributes: # pragma no branch assert attributes["actor"] is None or isinstance(attributes["actor"], dict), attributes["actor"] - self._actor = None if attributes["actor"] is None else NamedUser.NamedUser(self._requester, attributes["actor"], completed=False) + self._actor = None if attributes["actor"] is None else github.NamedUser.NamedUser(self._requester, attributes["actor"], completed=False) if "commit_id" in attributes: # pragma no branch assert attributes["commit_id"] is None or isinstance(attributes["commit_id"], (str, unicode)), attributes["commit_id"] self._commit_id = attributes["commit_id"] @@ -82,7 +82,7 @@ class IssueEvent(GithubObject.GithubObject): self._id = attributes["id"] if "issue" in attributes: # pragma no branch assert attributes["issue"] is None or isinstance(attributes["issue"], dict), attributes["issue"] - self._issue = None if attributes["issue"] is None else Issue.Issue(self._requester, attributes["issue"], completed=False) + self._issue = None if attributes["issue"] is None else github.Issue.Issue(self._requester, attributes["issue"], completed=False) if "url" in attributes: # pragma no branch assert attributes["url"] is None or isinstance(attributes["url"], (str, unicode)), attributes["url"] self._url = attributes["url"] diff --git a/github/IssuePullRequest.py b/github/IssuePullRequest.py index e5b94375..3ca15e69 100644 --- a/github/IssuePullRequest.py +++ b/github/IssuePullRequest.py @@ -13,10 +13,10 @@ # You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see . -import GithubObject +import github.GithubObject -class IssuePullRequest(GithubObject.BasicGithubObject): +class IssuePullRequest(github.GithubObject.BasicGithubObject): @property def diff_url(self): return self._NoneIfNotSet(self._diff_url) @@ -30,9 +30,9 @@ class IssuePullRequest(GithubObject.BasicGithubObject): return self._NoneIfNotSet(self._patch_url) def _initAttributes(self): - self._diff_url = GithubObject.NotSet - self._html_url = GithubObject.NotSet - self._patch_url = GithubObject.NotSet + self._diff_url = github.GithubObject.NotSet + self._html_url = github.GithubObject.NotSet + self._patch_url = github.GithubObject.NotSet def _useAttributes(self, attributes): if "diff_url" in attributes: # pragma no branch diff --git a/github/Label.py b/github/Label.py index 1d8e7dd8..5e5410ee 100644 --- a/github/Label.py +++ b/github/Label.py @@ -15,10 +15,10 @@ import urllib -import GithubObject +import github.GithubObject -class Label(GithubObject.GithubObject): +class Label(github.GithubObject.GithubObject): @property def color(self): self._completeIfNotSet(self._color) @@ -62,9 +62,9 @@ class Label(GithubObject.GithubObject): return urllib.quote(self.name) def _initAttributes(self): - self._color = GithubObject.NotSet - self._name = GithubObject.NotSet - self._url = GithubObject.NotSet + self._color = github.GithubObject.NotSet + self._name = github.GithubObject.NotSet + self._url = github.GithubObject.NotSet def _useAttributes(self, attributes): if "color" in attributes: # pragma no branch diff --git a/github/Legacy.py b/github/Legacy.py index 264a0796..f9567610 100644 --- a/github/Legacy.py +++ b/github/Legacy.py @@ -15,12 +15,12 @@ import urlparse -from PaginatedList import PaginatedListBase +import github.PaginatedList -class PaginatedList(PaginatedListBase): +class PaginatedList(github.PaginatedList.PaginatedListBase): def __init__(self, url, args, requester, key, convert, contentClass): - PaginatedListBase.__init__(self) + github.PaginatedList.PaginatedListBase.__init__(self) self.__url = url self.__args = args self.__requester = requester diff --git a/github/Milestone.py b/github/Milestone.py index 18e01865..e646a225 100644 --- a/github/Milestone.py +++ b/github/Milestone.py @@ -15,14 +15,14 @@ import datetime -import GithubObject -import PaginatedList +import github.GithubObject +import github.PaginatedList -import NamedUser -import Label +import github.NamedUser +import github.Label -class Milestone(GithubObject.GithubObject): +class Milestone(github.GithubObject.GithubObject): @property def closed_issues(self): self._completeIfNotSet(self._closed_issues) @@ -86,19 +86,19 @@ class Milestone(GithubObject.GithubObject): None ) - def edit(self, title, state=GithubObject.NotSet, description=GithubObject.NotSet, due_on=GithubObject.NotSet): + def edit(self, title, state=github.GithubObject.NotSet, description=github.GithubObject.NotSet, due_on=github.GithubObject.NotSet): assert isinstance(title, (str, unicode)), title - assert state is GithubObject.NotSet or isinstance(state, (str, unicode)), state - assert description is GithubObject.NotSet or isinstance(description, (str, unicode)), description - assert due_on is GithubObject.NotSet or isinstance(due_on, datetime.date), due_on + assert state is github.GithubObject.NotSet or isinstance(state, (str, unicode)), state + assert description is github.GithubObject.NotSet or isinstance(description, (str, unicode)), description + assert due_on is github.GithubObject.NotSet or isinstance(due_on, datetime.date), due_on post_parameters = { "title": title, } - if state is not GithubObject.NotSet: + if state is not github.GithubObject.NotSet: post_parameters["state"] = state - if description is not GithubObject.NotSet: + if description is not github.GithubObject.NotSet: post_parameters["description"] = description - if due_on is not GithubObject.NotSet: + if due_on is not github.GithubObject.NotSet: post_parameters["due_on"] = due_on.strftime("%Y-%m-%d") headers, data = self._requester.requestAndCheck( "PATCH", @@ -109,8 +109,8 @@ class Milestone(GithubObject.GithubObject): self._useAttributes(data) def get_labels(self): - return PaginatedList.PaginatedList( - Label.Label, + return github.PaginatedList.PaginatedList( + github.Label.Label, self._requester, self.url + "/labels", None @@ -121,17 +121,17 @@ class Milestone(GithubObject.GithubObject): return self.number def _initAttributes(self): - self._closed_issues = GithubObject.NotSet - self._created_at = GithubObject.NotSet - self._creator = GithubObject.NotSet - self._description = GithubObject.NotSet - self._due_on = GithubObject.NotSet - self._id = GithubObject.NotSet - self._number = GithubObject.NotSet - self._open_issues = GithubObject.NotSet - self._state = GithubObject.NotSet - self._title = GithubObject.NotSet - self._url = GithubObject.NotSet + self._closed_issues = github.GithubObject.NotSet + self._created_at = github.GithubObject.NotSet + self._creator = github.GithubObject.NotSet + self._description = github.GithubObject.NotSet + self._due_on = github.GithubObject.NotSet + self._id = github.GithubObject.NotSet + self._number = github.GithubObject.NotSet + self._open_issues = github.GithubObject.NotSet + self._state = github.GithubObject.NotSet + self._title = github.GithubObject.NotSet + self._url = github.GithubObject.NotSet def _useAttributes(self, attributes): if "closed_issues" in attributes: # pragma no branch @@ -142,7 +142,7 @@ class Milestone(GithubObject.GithubObject): self._created_at = self._parseDatetime(attributes["created_at"]) if "creator" in attributes: # pragma no branch assert attributes["creator"] is None or isinstance(attributes["creator"], dict), attributes["creator"] - self._creator = None if attributes["creator"] is None else NamedUser.NamedUser(self._requester, attributes["creator"], completed=False) + self._creator = None if attributes["creator"] is None else github.NamedUser.NamedUser(self._requester, attributes["creator"], completed=False) if "description" in attributes: # pragma no branch assert attributes["description"] is None or isinstance(attributes["description"], (str, unicode)), attributes["description"] self._description = attributes["description"] diff --git a/github/NamedUser.py b/github/NamedUser.py index 8269e2a5..15df5907 100644 --- a/github/NamedUser.py +++ b/github/NamedUser.py @@ -13,19 +13,18 @@ # You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see . -import GithubObject -import PaginatedList +import github.GithubObject +import github.PaginatedList -import Gist -import Repository -import NamedUser -import Plan -import Organization -import InputFileContent -import Event +import github.Gist +import github.Repository +import github.NamedUser +import github.Plan +import github.Organization +import github.Event -class NamedUser(GithubObject.GithubObject): +class NamedUser(github.GithubObject.GithubObject): @property def avatar_url(self): self._completeIfNotSet(self._avatar_url) @@ -156,15 +155,15 @@ class NamedUser(GithubObject.GithubObject): self._completeIfNotSet(self._url) return self._NoneIfNotSet(self._url) - def create_gist(self, public, files, description=GithubObject.NotSet): + def create_gist(self, public, files, description=github.GithubObject.NotSet): assert isinstance(public, bool), public - assert all(isinstance(element, InputFileContent.InputFileContent) for element in files.itervalues()), files - assert description is GithubObject.NotSet or isinstance(description, (str, unicode)), description + assert all(isinstance(element, github.InputFileContent) for element in files.itervalues()), files + assert description is github.GithubObject.NotSet or isinstance(description, (str, unicode)), description post_parameters = { "public": public, "files": dict((key, value._identity) for key, value in files.iteritems()), } - if description is not GithubObject.NotSet: + if description is not github.GithubObject.NotSet: post_parameters["description"] = description headers, data = self._requester.requestAndCheck( "POST", @@ -172,18 +171,18 @@ class NamedUser(GithubObject.GithubObject): None, post_parameters ) - return Gist.Gist(self._requester, data, completed=True) + return github.Gist.Gist(self._requester, data, completed=True) def get_events(self): - return PaginatedList.PaginatedList( - Event.Event, + return github.PaginatedList.PaginatedList( + github.Event.Event, self._requester, self.url + "/events", None ) def get_followers(self): - return PaginatedList.PaginatedList( + return github.PaginatedList.PaginatedList( NamedUser, self._requester, self.url + "/followers", @@ -191,7 +190,7 @@ class NamedUser(GithubObject.GithubObject): ) def get_following(self): - return PaginatedList.PaginatedList( + return github.PaginatedList.PaginatedList( NamedUser, self._requester, self.url + "/following", @@ -199,40 +198,40 @@ class NamedUser(GithubObject.GithubObject): ) def get_gists(self): - return PaginatedList.PaginatedList( - Gist.Gist, + return github.PaginatedList.PaginatedList( + github.Gist.Gist, self._requester, self.url + "/gists", None ) def get_orgs(self): - return PaginatedList.PaginatedList( - Organization.Organization, + return github.PaginatedList.PaginatedList( + github.Organization.Organization, self._requester, self.url + "/orgs", None ) def get_public_events(self): - return PaginatedList.PaginatedList( - Event.Event, + return github.PaginatedList.PaginatedList( + github.Event.Event, self._requester, self.url + "/events/public", None ) def get_public_received_events(self): - return PaginatedList.PaginatedList( - Event.Event, + return github.PaginatedList.PaginatedList( + github.Event.Event, self._requester, self.url + "/received_events/public", None ) def get_received_events(self): - return PaginatedList.PaginatedList( - Event.Event, + return github.PaginatedList.PaginatedList( + github.Event.Event, self._requester, self.url + "/received_events", None @@ -246,39 +245,39 @@ class NamedUser(GithubObject.GithubObject): None, None ) - return Repository.Repository(self._requester, data, completed=True) + return github.Repository.Repository(self._requester, data, completed=True) - def get_repos(self, type=GithubObject.NotSet): - assert type is GithubObject.NotSet or isinstance(type, (str, unicode)), type + def get_repos(self, type=github.GithubObject.NotSet): + assert type is github.GithubObject.NotSet or isinstance(type, (str, unicode)), type url_parameters = dict() - if type is not GithubObject.NotSet: + if type is not github.GithubObject.NotSet: url_parameters["type"] = type - return PaginatedList.PaginatedList( - Repository.Repository, + return github.PaginatedList.PaginatedList( + github.Repository.Repository, self._requester, self.url + "/repos", url_parameters ) def get_starred(self): - return PaginatedList.PaginatedList( - Repository.Repository, + return github.PaginatedList.PaginatedList( + github.Repository.Repository, self._requester, self.url + "/starred", None ) def get_subscriptions(self): - return PaginatedList.PaginatedList( - Repository.Repository, + return github.PaginatedList.PaginatedList( + github.Repository.Repository, self._requester, self.url + "/subscriptions", None ) def get_watched(self): - return PaginatedList.PaginatedList( - Repository.Repository, + return github.PaginatedList.PaginatedList( + github.Repository.Repository, self._requester, self.url + "/watched", None @@ -289,32 +288,32 @@ class NamedUser(GithubObject.GithubObject): return self.login def _initAttributes(self): - self._avatar_url = GithubObject.NotSet - self._bio = GithubObject.NotSet - self._blog = GithubObject.NotSet - self._collaborators = GithubObject.NotSet - self._company = GithubObject.NotSet - self._contributions = GithubObject.NotSet - self._created_at = GithubObject.NotSet - self._disk_usage = GithubObject.NotSet - self._email = GithubObject.NotSet - self._followers = GithubObject.NotSet - self._following = GithubObject.NotSet - self._gravatar_id = GithubObject.NotSet - self._hireable = GithubObject.NotSet - self._html_url = GithubObject.NotSet - self._id = GithubObject.NotSet - self._location = GithubObject.NotSet - self._login = GithubObject.NotSet - self._name = GithubObject.NotSet - self._owned_private_repos = GithubObject.NotSet - self._plan = GithubObject.NotSet - self._private_gists = GithubObject.NotSet - self._public_gists = GithubObject.NotSet - self._public_repos = GithubObject.NotSet - self._total_private_repos = GithubObject.NotSet - self._type = GithubObject.NotSet - self._url = GithubObject.NotSet + self._avatar_url = github.GithubObject.NotSet + self._bio = github.GithubObject.NotSet + self._blog = github.GithubObject.NotSet + self._collaborators = github.GithubObject.NotSet + self._company = github.GithubObject.NotSet + self._contributions = github.GithubObject.NotSet + self._created_at = github.GithubObject.NotSet + self._disk_usage = github.GithubObject.NotSet + self._email = github.GithubObject.NotSet + self._followers = github.GithubObject.NotSet + self._following = github.GithubObject.NotSet + self._gravatar_id = github.GithubObject.NotSet + self._hireable = github.GithubObject.NotSet + self._html_url = github.GithubObject.NotSet + self._id = github.GithubObject.NotSet + self._location = github.GithubObject.NotSet + self._login = github.GithubObject.NotSet + self._name = github.GithubObject.NotSet + self._owned_private_repos = github.GithubObject.NotSet + self._plan = github.GithubObject.NotSet + self._private_gists = github.GithubObject.NotSet + self._public_gists = github.GithubObject.NotSet + self._public_repos = github.GithubObject.NotSet + self._total_private_repos = github.GithubObject.NotSet + self._type = github.GithubObject.NotSet + self._url = github.GithubObject.NotSet def _useAttributes(self, attributes): if "avatar_url" in attributes: # pragma no branch @@ -376,7 +375,7 @@ class NamedUser(GithubObject.GithubObject): self._owned_private_repos = attributes["owned_private_repos"] if "plan" in attributes: # pragma no branch assert attributes["plan"] is None or isinstance(attributes["plan"], dict), attributes["plan"] - self._plan = None if attributes["plan"] is None else Plan.Plan(self._requester, attributes["plan"], completed=False) + self._plan = None if attributes["plan"] is None else github.Plan.Plan(self._requester, attributes["plan"], completed=False) if "private_gists" in attributes: # pragma no branch assert attributes["private_gists"] is None or isinstance(attributes["private_gists"], (int, long)), attributes["private_gists"] self._private_gists = attributes["private_gists"] diff --git a/github/Organization.py b/github/Organization.py index af39d730..c6aadb54 100644 --- a/github/Organization.py +++ b/github/Organization.py @@ -13,17 +13,17 @@ # You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see . -import GithubObject -import PaginatedList +import github.GithubObject +import github.PaginatedList -import Plan -import Team -import Event -import Repository -import NamedUser +import github.Plan +import github.Team +import github.Event +import github.Repository +import github.NamedUser -class Organization(GithubObject.GithubObject): +class Organization(github.GithubObject.GithubObject): @property def avatar_url(self): self._completeIfNotSet(self._avatar_url) @@ -145,7 +145,7 @@ class Organization(GithubObject.GithubObject): return self._NoneIfNotSet(self._url) def add_to_public_members(self, public_member): - assert isinstance(public_member, NamedUser.NamedUser), public_member + assert isinstance(public_member, github.NamedUser.NamedUser), public_member headers, data = self._requester.requestAndCheck( "PUT", self.url + "/public_members/" + public_member._identity, @@ -154,7 +154,7 @@ class Organization(GithubObject.GithubObject): ) def create_fork(self, repo): - assert isinstance(repo, Repository.Repository), repo + assert isinstance(repo, github.Repository.Repository), repo url_parameters = { "org": self.login, } @@ -164,39 +164,39 @@ class Organization(GithubObject.GithubObject): url_parameters, None ) - return Repository.Repository(self._requester, data, completed=True) + return github.Repository.Repository(self._requester, data, completed=True) - def create_repo(self, name, description=GithubObject.NotSet, homepage=GithubObject.NotSet, private=GithubObject.NotSet, has_issues=GithubObject.NotSet, has_wiki=GithubObject.NotSet, has_downloads=GithubObject.NotSet, team_id=GithubObject.NotSet, auto_init=GithubObject.NotSet, gitignore_template=GithubObject.NotSet): + def create_repo(self, name, description=github.GithubObject.NotSet, homepage=github.GithubObject.NotSet, private=github.GithubObject.NotSet, has_issues=github.GithubObject.NotSet, has_wiki=github.GithubObject.NotSet, has_downloads=github.GithubObject.NotSet, team_id=github.GithubObject.NotSet, auto_init=github.GithubObject.NotSet, gitignore_template=github.GithubObject.NotSet): assert isinstance(name, (str, unicode)), name - assert description is GithubObject.NotSet or isinstance(description, (str, unicode)), description - assert homepage is GithubObject.NotSet or isinstance(homepage, (str, unicode)), homepage - assert private is GithubObject.NotSet or isinstance(private, bool), private - assert has_issues is GithubObject.NotSet or isinstance(has_issues, bool), has_issues - assert has_wiki is GithubObject.NotSet or isinstance(has_wiki, bool), has_wiki - assert has_downloads is GithubObject.NotSet or isinstance(has_downloads, bool), has_downloads - assert team_id is GithubObject.NotSet or isinstance(team_id, Team.Team), team_id - assert auto_init is GithubObject.NotSet or isinstance(auto_init, bool), auto_init - assert gitignore_template is GithubObject.NotSet or isinstance(gitignore_template, (str, unicode)), gitignore_template + assert description is github.GithubObject.NotSet or isinstance(description, (str, unicode)), description + assert homepage is github.GithubObject.NotSet or isinstance(homepage, (str, unicode)), homepage + assert private is github.GithubObject.NotSet or isinstance(private, bool), private + assert has_issues is github.GithubObject.NotSet or isinstance(has_issues, bool), has_issues + assert has_wiki is github.GithubObject.NotSet or isinstance(has_wiki, bool), has_wiki + assert has_downloads is github.GithubObject.NotSet or isinstance(has_downloads, bool), has_downloads + assert team_id is github.GithubObject.NotSet or isinstance(team_id, github.Team.Team), team_id + assert auto_init is github.GithubObject.NotSet or isinstance(auto_init, bool), auto_init + assert gitignore_template is github.GithubObject.NotSet or isinstance(gitignore_template, (str, unicode)), gitignore_template post_parameters = { "name": name, } - if description is not GithubObject.NotSet: + if description is not github.GithubObject.NotSet: post_parameters["description"] = description - if homepage is not GithubObject.NotSet: + if homepage is not github.GithubObject.NotSet: post_parameters["homepage"] = homepage - if private is not GithubObject.NotSet: + if private is not github.GithubObject.NotSet: post_parameters["private"] = private - if has_issues is not GithubObject.NotSet: + if has_issues is not github.GithubObject.NotSet: post_parameters["has_issues"] = has_issues - if has_wiki is not GithubObject.NotSet: + if has_wiki is not github.GithubObject.NotSet: post_parameters["has_wiki"] = has_wiki - if has_downloads is not GithubObject.NotSet: + if has_downloads is not github.GithubObject.NotSet: post_parameters["has_downloads"] = has_downloads - if team_id is not GithubObject.NotSet: + if team_id is not github.GithubObject.NotSet: post_parameters["team_id"] = team_id._identity - if auto_init is not GithubObject.NotSet: + if auto_init is not github.GithubObject.NotSet: post_parameters["auto_init"] = auto_init - if gitignore_template is not GithubObject.NotSet: + if gitignore_template is not github.GithubObject.NotSet: post_parameters["gitignore_template"] = gitignore_template headers, data = self._requester.requestAndCheck( "POST", @@ -204,18 +204,18 @@ class Organization(GithubObject.GithubObject): None, post_parameters ) - return Repository.Repository(self._requester, data, completed=True) + return github.Repository.Repository(self._requester, data, completed=True) - def create_team(self, name, repo_names=GithubObject.NotSet, permission=GithubObject.NotSet): + def create_team(self, name, repo_names=github.GithubObject.NotSet, permission=github.GithubObject.NotSet): assert isinstance(name, (str, unicode)), name - assert repo_names is GithubObject.NotSet or all(isinstance(element, Repository.Repository) for element in repo_names), repo_names - assert permission is GithubObject.NotSet or isinstance(permission, (str, unicode)), permission + assert repo_names is github.GithubObject.NotSet or all(isinstance(element, github.Repository.Repository) for element in repo_names), repo_names + assert permission is github.GithubObject.NotSet or isinstance(permission, (str, unicode)), permission post_parameters = { "name": name, } - if repo_names is not GithubObject.NotSet: + if repo_names is not github.GithubObject.NotSet: post_parameters["repo_names"] = [element._identity for element in repo_names] - if permission is not GithubObject.NotSet: + if permission is not github.GithubObject.NotSet: post_parameters["permission"] = permission headers, data = self._requester.requestAndCheck( "POST", @@ -223,27 +223,27 @@ class Organization(GithubObject.GithubObject): None, post_parameters ) - return Team.Team(self._requester, data, completed=True) + return github.Team.Team(self._requester, data, completed=True) - def edit(self, billing_email=GithubObject.NotSet, blog=GithubObject.NotSet, company=GithubObject.NotSet, email=GithubObject.NotSet, location=GithubObject.NotSet, name=GithubObject.NotSet): - assert billing_email is GithubObject.NotSet or isinstance(billing_email, (str, unicode)), billing_email - assert blog is GithubObject.NotSet or isinstance(blog, (str, unicode)), blog - assert company is GithubObject.NotSet or isinstance(company, (str, unicode)), company - assert email is GithubObject.NotSet or isinstance(email, (str, unicode)), email - assert location is GithubObject.NotSet or isinstance(location, (str, unicode)), location - assert name is GithubObject.NotSet or isinstance(name, (str, unicode)), name + def edit(self, billing_email=github.GithubObject.NotSet, blog=github.GithubObject.NotSet, company=github.GithubObject.NotSet, email=github.GithubObject.NotSet, location=github.GithubObject.NotSet, name=github.GithubObject.NotSet): + assert billing_email is github.GithubObject.NotSet or isinstance(billing_email, (str, unicode)), billing_email + assert blog is github.GithubObject.NotSet or isinstance(blog, (str, unicode)), blog + assert company is github.GithubObject.NotSet or isinstance(company, (str, unicode)), company + assert email is github.GithubObject.NotSet or isinstance(email, (str, unicode)), email + assert location is github.GithubObject.NotSet or isinstance(location, (str, unicode)), location + assert name is github.GithubObject.NotSet or isinstance(name, (str, unicode)), name post_parameters = dict() - if billing_email is not GithubObject.NotSet: + if billing_email is not github.GithubObject.NotSet: post_parameters["billing_email"] = billing_email - if blog is not GithubObject.NotSet: + if blog is not github.GithubObject.NotSet: post_parameters["blog"] = blog - if company is not GithubObject.NotSet: + if company is not github.GithubObject.NotSet: post_parameters["company"] = company - if email is not GithubObject.NotSet: + if email is not github.GithubObject.NotSet: post_parameters["email"] = email - if location is not GithubObject.NotSet: + if location is not github.GithubObject.NotSet: post_parameters["location"] = location - if name is not GithubObject.NotSet: + if name is not github.GithubObject.NotSet: post_parameters["name"] = name headers, data = self._requester.requestAndCheck( "PATCH", @@ -254,24 +254,24 @@ class Organization(GithubObject.GithubObject): self._useAttributes(data) def get_events(self): - return PaginatedList.PaginatedList( - Event.Event, + return github.PaginatedList.PaginatedList( + github.Event.Event, self._requester, self.url + "/events", None ) def get_members(self): - return PaginatedList.PaginatedList( - NamedUser.NamedUser, + return github.PaginatedList.PaginatedList( + github.NamedUser.NamedUser, self._requester, self.url + "/members", None ) def get_public_members(self): - return PaginatedList.PaginatedList( - NamedUser.NamedUser, + return github.PaginatedList.PaginatedList( + github.NamedUser.NamedUser, self._requester, self.url + "/public_members", None @@ -285,15 +285,15 @@ class Organization(GithubObject.GithubObject): None, None ) - return Repository.Repository(self._requester, data, completed=True) + return github.Repository.Repository(self._requester, data, completed=True) - def get_repos(self, type=GithubObject.NotSet): - assert type is GithubObject.NotSet or isinstance(type, (str, unicode)), type + def get_repos(self, type=github.GithubObject.NotSet): + assert type is github.GithubObject.NotSet or isinstance(type, (str, unicode)), type url_parameters = dict() - if type is not GithubObject.NotSet: + if type is not github.GithubObject.NotSet: url_parameters["type"] = type - return PaginatedList.PaginatedList( - Repository.Repository, + return github.PaginatedList.PaginatedList( + github.Repository.Repository, self._requester, self.url + "/repos", url_parameters @@ -307,18 +307,18 @@ class Organization(GithubObject.GithubObject): None, None ) - return Team.Team(self._requester, data, completed=True) + return github.Team.Team(self._requester, data, completed=True) def get_teams(self): - return PaginatedList.PaginatedList( - Team.Team, + return github.PaginatedList.PaginatedList( + github.Team.Team, self._requester, self.url + "/teams", None ) def has_in_members(self, member): - assert isinstance(member, NamedUser.NamedUser), member + assert isinstance(member, github.NamedUser.NamedUser), member status, headers, data = self._requester.requestRaw( "GET", self.url + "/members/" + member._identity, @@ -328,7 +328,7 @@ class Organization(GithubObject.GithubObject): return status == 204 def has_in_public_members(self, public_member): - assert isinstance(public_member, NamedUser.NamedUser), public_member + assert isinstance(public_member, github.NamedUser.NamedUser), public_member status, headers, data = self._requester.requestRaw( "GET", self.url + "/public_members/" + public_member._identity, @@ -338,7 +338,7 @@ class Organization(GithubObject.GithubObject): return status == 204 def remove_from_members(self, member): - assert isinstance(member, NamedUser.NamedUser), member + assert isinstance(member, github.NamedUser.NamedUser), member headers, data = self._requester.requestAndCheck( "DELETE", self.url + "/members/" + member._identity, @@ -347,7 +347,7 @@ class Organization(GithubObject.GithubObject): ) def remove_from_public_members(self, public_member): - assert isinstance(public_member, NamedUser.NamedUser), public_member + assert isinstance(public_member, github.NamedUser.NamedUser), public_member headers, data = self._requester.requestAndCheck( "DELETE", self.url + "/public_members/" + public_member._identity, @@ -356,30 +356,30 @@ class Organization(GithubObject.GithubObject): ) def _initAttributes(self): - self._avatar_url = GithubObject.NotSet - self._billing_email = GithubObject.NotSet - self._blog = GithubObject.NotSet - self._collaborators = GithubObject.NotSet - self._company = GithubObject.NotSet - self._created_at = GithubObject.NotSet - self._disk_usage = GithubObject.NotSet - self._email = GithubObject.NotSet - self._followers = GithubObject.NotSet - self._following = GithubObject.NotSet - self._gravatar_id = GithubObject.NotSet - self._html_url = GithubObject.NotSet - self._id = GithubObject.NotSet - self._location = GithubObject.NotSet - self._login = GithubObject.NotSet - self._name = GithubObject.NotSet - self._owned_private_repos = GithubObject.NotSet - self._plan = GithubObject.NotSet - self._private_gists = GithubObject.NotSet - self._public_gists = GithubObject.NotSet - self._public_repos = GithubObject.NotSet - self._total_private_repos = GithubObject.NotSet - self._type = GithubObject.NotSet - self._url = GithubObject.NotSet + self._avatar_url = github.GithubObject.NotSet + self._billing_email = github.GithubObject.NotSet + self._blog = github.GithubObject.NotSet + self._collaborators = github.GithubObject.NotSet + self._company = github.GithubObject.NotSet + self._created_at = github.GithubObject.NotSet + self._disk_usage = github.GithubObject.NotSet + self._email = github.GithubObject.NotSet + self._followers = github.GithubObject.NotSet + self._following = github.GithubObject.NotSet + self._gravatar_id = github.GithubObject.NotSet + self._html_url = github.GithubObject.NotSet + self._id = github.GithubObject.NotSet + self._location = github.GithubObject.NotSet + self._login = github.GithubObject.NotSet + self._name = github.GithubObject.NotSet + self._owned_private_repos = github.GithubObject.NotSet + self._plan = github.GithubObject.NotSet + self._private_gists = github.GithubObject.NotSet + self._public_gists = github.GithubObject.NotSet + self._public_repos = github.GithubObject.NotSet + self._total_private_repos = github.GithubObject.NotSet + self._type = github.GithubObject.NotSet + self._url = github.GithubObject.NotSet def _useAttributes(self, attributes): if "avatar_url" in attributes: # pragma no branch @@ -435,7 +435,7 @@ class Organization(GithubObject.GithubObject): self._owned_private_repos = attributes["owned_private_repos"] if "plan" in attributes: # pragma no branch assert attributes["plan"] is None or isinstance(attributes["plan"], dict), attributes["plan"] - self._plan = None if attributes["plan"] is None else Plan.Plan(self._requester, attributes["plan"], completed=False) + self._plan = None if attributes["plan"] is None else github.Plan.Plan(self._requester, attributes["plan"], completed=False) if "private_gists" in attributes: # pragma no branch assert attributes["private_gists"] is None or isinstance(attributes["private_gists"], (int, long)), attributes["private_gists"] self._private_gists = attributes["private_gists"] diff --git a/github/PaginatedList.py b/github/PaginatedList.py index dc876ff2..8f7addd1 100644 --- a/github/PaginatedList.py +++ b/github/PaginatedList.py @@ -13,7 +13,7 @@ # You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see . -import GithubObject +import github.GithubObject class PaginatedListBase: diff --git a/github/Permissions.py b/github/Permissions.py index 91d65ecf..32df3015 100644 --- a/github/Permissions.py +++ b/github/Permissions.py @@ -13,10 +13,10 @@ # You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see . -import GithubObject +import github.GithubObject -class Permissions(GithubObject.BasicGithubObject): +class Permissions(github.GithubObject.BasicGithubObject): @property def admin(self): return self._NoneIfNotSet(self._admin) @@ -30,9 +30,9 @@ class Permissions(GithubObject.BasicGithubObject): return self._NoneIfNotSet(self._push) def _initAttributes(self): - self._admin = GithubObject.NotSet - self._pull = GithubObject.NotSet - self._push = GithubObject.NotSet + self._admin = github.GithubObject.NotSet + self._pull = github.GithubObject.NotSet + self._push = github.GithubObject.NotSet def _useAttributes(self, attributes): if "admin" in attributes: # pragma no branch diff --git a/github/Plan.py b/github/Plan.py index a7b23ffe..4d4764a2 100644 --- a/github/Plan.py +++ b/github/Plan.py @@ -13,10 +13,10 @@ # You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see . -import GithubObject +import github.GithubObject -class Plan(GithubObject.BasicGithubObject): +class Plan(github.GithubObject.BasicGithubObject): @property def collaborators(self): return self._NoneIfNotSet(self._collaborators) @@ -34,10 +34,10 @@ class Plan(GithubObject.BasicGithubObject): return self._NoneIfNotSet(self._space) def _initAttributes(self): - self._collaborators = GithubObject.NotSet - self._name = GithubObject.NotSet - self._private_repos = GithubObject.NotSet - self._space = GithubObject.NotSet + self._collaborators = github.GithubObject.NotSet + self._name = github.GithubObject.NotSet + self._private_repos = github.GithubObject.NotSet + self._space = github.GithubObject.NotSet def _useAttributes(self, attributes): if "collaborators" in attributes: # pragma no branch diff --git a/github/PullRequest.py b/github/PullRequest.py index 0304fcfc..0799aa64 100644 --- a/github/PullRequest.py +++ b/github/PullRequest.py @@ -13,19 +13,19 @@ # You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see . -import GithubObject -import PaginatedList +import github.GithubObject +import github.PaginatedList -import PullRequestMergeStatus -import NamedUser -import PullRequestPart -import PullRequestComment -import File -import IssueComment -import Commit +import github.PullRequestMergeStatus +import github.NamedUser +import github.PullRequestPart +import github.PullRequestComment +import github.File +import github.IssueComment +import github.Commit -class PullRequest(GithubObject.GithubObject): +class PullRequest(github.GithubObject.GithubObject): @property def additions(self): self._completeIfNotSet(self._additions) @@ -166,7 +166,7 @@ class PullRequest(GithubObject.GithubObject): def create_review_comment(self, body, commit_id, path, position): assert isinstance(body, (str, unicode)), body - assert isinstance(commit_id, Commit.Commit), commit_id + assert isinstance(commit_id, github.Commit.Commit), commit_id assert isinstance(path, (str, unicode)), path assert isinstance(position, (int, long)), position post_parameters = { @@ -181,7 +181,7 @@ class PullRequest(GithubObject.GithubObject): None, post_parameters ) - return PullRequestComment.PullRequestComment(self._requester, data, completed=True) + return github.PullRequestComment.PullRequestComment(self._requester, data, completed=True) def create_issue_comment(self, body): assert isinstance(body, (str, unicode)), body @@ -194,18 +194,18 @@ class PullRequest(GithubObject.GithubObject): None, post_parameters ) - return IssueComment.IssueComment(self._requester, data, completed=True) + return github.IssueComment.IssueComment(self._requester, data, completed=True) - def edit(self, title=GithubObject.NotSet, body=GithubObject.NotSet, state=GithubObject.NotSet): - assert title is GithubObject.NotSet or isinstance(title, (str, unicode)), title - assert body is GithubObject.NotSet or isinstance(body, (str, unicode)), body - assert state is GithubObject.NotSet or isinstance(state, (str, unicode)), state + def edit(self, title=github.GithubObject.NotSet, body=github.GithubObject.NotSet, state=github.GithubObject.NotSet): + 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 state is github.GithubObject.NotSet or isinstance(state, (str, unicode)), state post_parameters = dict() - if title is not GithubObject.NotSet: + if title is not github.GithubObject.NotSet: post_parameters["title"] = title - if body is not GithubObject.NotSet: + if body is not github.GithubObject.NotSet: post_parameters["body"] = body - if state is not GithubObject.NotSet: + if state is not github.GithubObject.NotSet: post_parameters["state"] = state headers, data = self._requester.requestAndCheck( "PATCH", @@ -226,30 +226,30 @@ class PullRequest(GithubObject.GithubObject): None, None ) - return PullRequestComment.PullRequestComment(self._requester, data, completed=True) + return github.PullRequestComment.PullRequestComment(self._requester, data, completed=True) def get_comments(self): return self.get_review_comments() def get_review_comments(self): - return PaginatedList.PaginatedList( - PullRequestComment.PullRequestComment, + return github.PaginatedList.PaginatedList( + github.PullRequestComment.PullRequestComment, self._requester, self.url + "/comments", None ) def get_commits(self): - return PaginatedList.PaginatedList( - Commit.Commit, + return github.PaginatedList.PaginatedList( + github.Commit.Commit, self._requester, self.url + "/commits", None ) def get_files(self): - return PaginatedList.PaginatedList( - File.File, + return github.PaginatedList.PaginatedList( + github.File.File, self._requester, self.url + "/files", None @@ -263,11 +263,11 @@ class PullRequest(GithubObject.GithubObject): None, None ) - return IssueComment.IssueComment(self._requester, data, completed=True) + return github.IssueComment.IssueComment(self._requester, data, completed=True) def get_issue_comments(self): - return PaginatedList.PaginatedList( - IssueComment.IssueComment, + return github.PaginatedList.PaginatedList( + github.IssueComment.IssueComment, self._requester, self._parentUrl(self._parentUrl(self.url)) + "/issues/" + str(self.number) + "/comments", None @@ -282,10 +282,10 @@ class PullRequest(GithubObject.GithubObject): ) return status == 204 - def merge(self, commit_message=GithubObject.NotSet): - assert commit_message is GithubObject.NotSet or isinstance(commit_message, (str, unicode)), commit_message + def merge(self, commit_message=github.GithubObject.NotSet): + assert commit_message is github.GithubObject.NotSet or isinstance(commit_message, (str, unicode)), commit_message post_parameters = dict() - if commit_message is not GithubObject.NotSet: + if commit_message is not github.GithubObject.NotSet: post_parameters["commit_message"] = commit_message headers, data = self._requester.requestAndCheck( "PUT", @@ -293,36 +293,36 @@ class PullRequest(GithubObject.GithubObject): None, post_parameters ) - return PullRequestMergeStatus.PullRequestMergeStatus(self._requester, data, completed=True) + return github.PullRequestMergeStatus.PullRequestMergeStatus(self._requester, data, completed=True) def _initAttributes(self): - self._additions = GithubObject.NotSet - self._assignee = GithubObject.NotSet - self._base = GithubObject.NotSet - self._body = GithubObject.NotSet - self._changed_files = GithubObject.NotSet - self._closed_at = GithubObject.NotSet - self._comments = GithubObject.NotSet - self._commits = GithubObject.NotSet - self._created_at = GithubObject.NotSet - self._deletions = GithubObject.NotSet - self._diff_url = GithubObject.NotSet - self._head = GithubObject.NotSet - self._html_url = GithubObject.NotSet - self._id = GithubObject.NotSet - self._issue_url = GithubObject.NotSet - self._mergeable = GithubObject.NotSet - self._merged = GithubObject.NotSet - self._merged_at = GithubObject.NotSet - self._merged_by = GithubObject.NotSet - self._number = GithubObject.NotSet - self._patch_url = GithubObject.NotSet - self._review_comments = GithubObject.NotSet - self._state = GithubObject.NotSet - self._title = GithubObject.NotSet - self._updated_at = GithubObject.NotSet - self._url = GithubObject.NotSet - self._user = GithubObject.NotSet + self._additions = github.GithubObject.NotSet + self._assignee = github.GithubObject.NotSet + self._base = github.GithubObject.NotSet + self._body = github.GithubObject.NotSet + self._changed_files = github.GithubObject.NotSet + self._closed_at = github.GithubObject.NotSet + self._comments = github.GithubObject.NotSet + self._commits = github.GithubObject.NotSet + self._created_at = github.GithubObject.NotSet + self._deletions = github.GithubObject.NotSet + self._diff_url = github.GithubObject.NotSet + self._head = github.GithubObject.NotSet + self._html_url = github.GithubObject.NotSet + self._id = github.GithubObject.NotSet + self._issue_url = github.GithubObject.NotSet + self._mergeable = github.GithubObject.NotSet + self._merged = github.GithubObject.NotSet + self._merged_at = github.GithubObject.NotSet + self._merged_by = github.GithubObject.NotSet + self._number = github.GithubObject.NotSet + self._patch_url = github.GithubObject.NotSet + self._review_comments = github.GithubObject.NotSet + self._state = github.GithubObject.NotSet + self._title = github.GithubObject.NotSet + self._updated_at = github.GithubObject.NotSet + self._url = github.GithubObject.NotSet + self._user = github.GithubObject.NotSet def _useAttributes(self, attributes): if "additions" in attributes: # pragma no branch @@ -330,10 +330,10 @@ class PullRequest(GithubObject.GithubObject): self._additions = attributes["additions"] if "assignee" in attributes: # pragma no branch assert attributes["assignee"] is None or isinstance(attributes["assignee"], dict), attributes["assignee"] - self._assignee = None if attributes["assignee"] is None else NamedUser.NamedUser(self._requester, attributes["assignee"], completed=False) + self._assignee = None if attributes["assignee"] is None else github.NamedUser.NamedUser(self._requester, attributes["assignee"], completed=False) if "base" in attributes: # pragma no branch assert attributes["base"] is None or isinstance(attributes["base"], dict), attributes["base"] - self._base = None if attributes["base"] is None else PullRequestPart.PullRequestPart(self._requester, attributes["base"], completed=False) + self._base = None if attributes["base"] is None else github.PullRequestPart.PullRequestPart(self._requester, attributes["base"], completed=False) if "body" in attributes: # pragma no branch assert attributes["body"] is None or isinstance(attributes["body"], (str, unicode)), attributes["body"] self._body = attributes["body"] @@ -360,7 +360,7 @@ class PullRequest(GithubObject.GithubObject): self._diff_url = attributes["diff_url"] if "head" in attributes: # pragma no branch assert attributes["head"] is None or isinstance(attributes["head"], dict), attributes["head"] - self._head = None if attributes["head"] is None else PullRequestPart.PullRequestPart(self._requester, attributes["head"], completed=False) + self._head = None if attributes["head"] is None else github.PullRequestPart.PullRequestPart(self._requester, attributes["head"], completed=False) if "html_url" in attributes: # pragma no branch assert attributes["html_url"] is None or isinstance(attributes["html_url"], (str, unicode)), attributes["html_url"] self._html_url = attributes["html_url"] @@ -381,7 +381,7 @@ class PullRequest(GithubObject.GithubObject): self._merged_at = self._parseDatetime(attributes["merged_at"]) if "merged_by" in attributes: # pragma no branch assert attributes["merged_by"] is None or isinstance(attributes["merged_by"], dict), attributes["merged_by"] - self._merged_by = None if attributes["merged_by"] is None else NamedUser.NamedUser(self._requester, attributes["merged_by"], completed=False) + self._merged_by = None if attributes["merged_by"] is None else github.NamedUser.NamedUser(self._requester, attributes["merged_by"], completed=False) if "number" in attributes: # pragma no branch assert attributes["number"] is None or isinstance(attributes["number"], (int, long)), attributes["number"] self._number = attributes["number"] @@ -405,4 +405,4 @@ class PullRequest(GithubObject.GithubObject): self._url = attributes["url"] if "user" in attributes: # pragma no branch assert attributes["user"] is None or isinstance(attributes["user"], dict), attributes["user"] - self._user = None if attributes["user"] is None else NamedUser.NamedUser(self._requester, attributes["user"], completed=False) + self._user = None if attributes["user"] is None else github.NamedUser.NamedUser(self._requester, attributes["user"], completed=False) diff --git a/github/PullRequestComment.py b/github/PullRequestComment.py index d9768a0d..dbbb95b7 100644 --- a/github/PullRequestComment.py +++ b/github/PullRequestComment.py @@ -13,12 +13,12 @@ # You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see . -import GithubObject +import github.GithubObject -import NamedUser +import github.NamedUser -class PullRequestComment(GithubObject.GithubObject): +class PullRequestComment(github.GithubObject.GithubObject): @property def body(self): self._completeIfNotSet(self._body) @@ -96,17 +96,17 @@ class PullRequestComment(GithubObject.GithubObject): self._useAttributes(data) def _initAttributes(self): - self._body = GithubObject.NotSet - self._commit_id = GithubObject.NotSet - self._created_at = GithubObject.NotSet - self._id = GithubObject.NotSet - self._original_commit_id = GithubObject.NotSet - self._original_position = GithubObject.NotSet - self._path = GithubObject.NotSet - self._position = GithubObject.NotSet - self._updated_at = GithubObject.NotSet - self._url = GithubObject.NotSet - self._user = GithubObject.NotSet + self._body = github.GithubObject.NotSet + self._commit_id = github.GithubObject.NotSet + self._created_at = github.GithubObject.NotSet + self._id = github.GithubObject.NotSet + self._original_commit_id = github.GithubObject.NotSet + self._original_position = github.GithubObject.NotSet + self._path = github.GithubObject.NotSet + self._position = github.GithubObject.NotSet + self._updated_at = github.GithubObject.NotSet + self._url = github.GithubObject.NotSet + self._user = github.GithubObject.NotSet def _useAttributes(self, attributes): if "body" in attributes: # pragma no branch @@ -141,4 +141,4 @@ class PullRequestComment(GithubObject.GithubObject): self._url = attributes["url"] if "user" in attributes: # pragma no branch assert attributes["user"] is None or isinstance(attributes["user"], dict), attributes["user"] - self._user = None if attributes["user"] is None else NamedUser.NamedUser(self._requester, attributes["user"], completed=False) + self._user = None if attributes["user"] is None else github.NamedUser.NamedUser(self._requester, attributes["user"], completed=False) diff --git a/github/PullRequestMergeStatus.py b/github/PullRequestMergeStatus.py index ce96afac..4e2a6eb8 100644 --- a/github/PullRequestMergeStatus.py +++ b/github/PullRequestMergeStatus.py @@ -13,10 +13,10 @@ # You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see . -import GithubObject +import github.GithubObject -class PullRequestMergeStatus(GithubObject.BasicGithubObject): +class PullRequestMergeStatus(github.GithubObject.BasicGithubObject): @property def merged(self): return self._NoneIfNotSet(self._merged) @@ -30,9 +30,9 @@ class PullRequestMergeStatus(GithubObject.BasicGithubObject): return self._NoneIfNotSet(self._sha) def _initAttributes(self): - self._merged = GithubObject.NotSet - self._message = GithubObject.NotSet - self._sha = GithubObject.NotSet + self._merged = github.GithubObject.NotSet + self._message = github.GithubObject.NotSet + self._sha = github.GithubObject.NotSet def _useAttributes(self, attributes): if "merged" in attributes: # pragma no branch diff --git a/github/PullRequestPart.py b/github/PullRequestPart.py index 0507133e..10d1be55 100644 --- a/github/PullRequestPart.py +++ b/github/PullRequestPart.py @@ -13,13 +13,13 @@ # You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see . -import GithubObject +import github.GithubObject -import Repository -import NamedUser +import github.Repository +import github.NamedUser -class PullRequestPart(GithubObject.BasicGithubObject): +class PullRequestPart(github.GithubObject.BasicGithubObject): @property def label(self): return self._NoneIfNotSet(self._label) @@ -41,11 +41,11 @@ class PullRequestPart(GithubObject.BasicGithubObject): return self._NoneIfNotSet(self._user) def _initAttributes(self): - self._label = GithubObject.NotSet - self._ref = GithubObject.NotSet - self._repo = GithubObject.NotSet - self._sha = GithubObject.NotSet - self._user = GithubObject.NotSet + self._label = github.GithubObject.NotSet + self._ref = github.GithubObject.NotSet + self._repo = github.GithubObject.NotSet + self._sha = github.GithubObject.NotSet + self._user = github.GithubObject.NotSet def _useAttributes(self, attributes): if "label" in attributes: # pragma no branch @@ -56,10 +56,10 @@ class PullRequestPart(GithubObject.BasicGithubObject): self._ref = attributes["ref"] if "repo" in attributes: # pragma no branch assert attributes["repo"] is None or isinstance(attributes["repo"], dict), attributes["repo"] - self._repo = None if attributes["repo"] is None else Repository.Repository(self._requester, attributes["repo"], completed=False) + self._repo = None if attributes["repo"] is None else github.Repository.Repository(self._requester, attributes["repo"], completed=False) if "sha" in attributes: # pragma no branch assert attributes["sha"] is None or isinstance(attributes["sha"], (str, unicode)), attributes["sha"] self._sha = attributes["sha"] if "user" in attributes: # pragma no branch assert attributes["user"] is None or isinstance(attributes["user"], dict), attributes["user"] - self._user = None if attributes["user"] is None else NamedUser.NamedUser(self._requester, attributes["user"], completed=False) + self._user = None if attributes["user"] is None else github.NamedUser.NamedUser(self._requester, attributes["user"], completed=False) diff --git a/github/Repository.py b/github/Repository.py index c4413a79..a92870a4 100644 --- a/github/Repository.py +++ b/github/Repository.py @@ -16,40 +16,38 @@ import urllib import datetime -import GithubObject -import PaginatedList +import github.GithubObject +import github.PaginatedList -import Branch -import IssueEvent -import ContentFile -import Label -import InputGitAuthor -import GitBlob -import Organization -import GitRef -import Issue -import Repository -import PullRequest -import RepositoryKey -import NamedUser -import Milestone -import InputGitTreeElement -import Comparison -import CommitComment -import GitCommit -import Team -import Commit -import GitTree -import Hook -import Tag -import GitTag -import Download -import Permissions -import Event -import Legacy +import github.Branch +import github.IssueEvent +import github.ContentFile +import github.Label +import github.GitBlob +import github.Organization +import github.GitRef +import github.Issue +import github.Repository +import github.PullRequest +import github.RepositoryKey +import github.NamedUser +import github.Milestone +import github.Comparison +import github.CommitComment +import github.GitCommit +import github.Team +import github.Commit +import github.GitTree +import github.Hook +import github.Tag +import github.GitTag +import github.Download +import github.Permissions +import github.Event +import github.Legacy -class Repository(GithubObject.GithubObject): +class Repository(github.GithubObject.GithubObject): @property def clone_url(self): self._completeIfNotSet(self._clone_url) @@ -201,7 +199,7 @@ class Repository(GithubObject.GithubObject): return self._NoneIfNotSet(self._watchers) def add_to_collaborators(self, collaborator): - assert isinstance(collaborator, NamedUser.NamedUser), collaborator + assert isinstance(collaborator, github.NamedUser.NamedUser), collaborator headers, data = self._requester.requestAndCheck( "PUT", self.url + "/collaborators/" + collaborator._identity, @@ -218,20 +216,20 @@ class Repository(GithubObject.GithubObject): None, None ) - return Comparison.Comparison(self._requester, data, completed=True) + return github.Comparison.Comparison(self._requester, data, completed=True) - def create_download(self, name, size, description=GithubObject.NotSet, content_type=GithubObject.NotSet): + def create_download(self, name, size, description=github.GithubObject.NotSet, content_type=github.GithubObject.NotSet): assert isinstance(name, (str, unicode)), name assert isinstance(size, (int, long)), size - assert description is GithubObject.NotSet or isinstance(description, (str, unicode)), description - assert content_type is GithubObject.NotSet or isinstance(content_type, (str, unicode)), content_type + assert description is github.GithubObject.NotSet or isinstance(description, (str, unicode)), description + assert content_type is github.GithubObject.NotSet or isinstance(content_type, (str, unicode)), content_type post_parameters = { "name": name, "size": size, } - if description is not GithubObject.NotSet: + if description is not github.GithubObject.NotSet: post_parameters["description"] = description - if content_type is not GithubObject.NotSet: + if content_type is not github.GithubObject.NotSet: post_parameters["content_type"] = content_type headers, data = self._requester.requestAndCheck( "POST", @@ -239,7 +237,7 @@ class Repository(GithubObject.GithubObject): None, post_parameters ) - return Download.Download(self._requester, data, completed=True) + return github.Download.Download(self._requester, data, completed=True) def create_git_blob(self, content, encoding): assert isinstance(content, (str, unicode)), content @@ -254,22 +252,22 @@ class Repository(GithubObject.GithubObject): None, post_parameters ) - return GitBlob.GitBlob(self._requester, data, completed=True) + return github.GitBlob.GitBlob(self._requester, data, completed=True) - def create_git_commit(self, message, tree, parents, author=GithubObject.NotSet, committer=GithubObject.NotSet): + def create_git_commit(self, message, tree, parents, author=github.GithubObject.NotSet, committer=github.GithubObject.NotSet): assert isinstance(message, (str, unicode)), message - assert isinstance(tree, GitTree.GitTree), tree - assert all(isinstance(element, GitCommit.GitCommit) for element in parents), parents - assert author is GithubObject.NotSet or isinstance(author, InputGitAuthor.InputGitAuthor), author - assert committer is GithubObject.NotSet or isinstance(committer, InputGitAuthor.InputGitAuthor), committer + assert isinstance(tree, github.GitTree.GitTree), tree + assert all(isinstance(element, github.GitCommit.GitCommit) for element in parents), parents + assert author is github.GithubObject.NotSet or isinstance(author, github.InputGitAuthor), author + assert committer is github.GithubObject.NotSet or isinstance(committer, github.InputGitAuthor), committer post_parameters = { "message": message, "tree": tree._identity, "parents": [element._identity for element in parents], } - if author is not GithubObject.NotSet: + if author is not github.GithubObject.NotSet: post_parameters["author"] = author._identity - if committer is not GithubObject.NotSet: + if committer is not github.GithubObject.NotSet: post_parameters["committer"] = committer._identity headers, data = self._requester.requestAndCheck( "POST", @@ -277,7 +275,7 @@ class Repository(GithubObject.GithubObject): None, post_parameters ) - return GitCommit.GitCommit(self._requester, data, completed=True) + return github.GitCommit.GitCommit(self._requester, data, completed=True) def create_git_ref(self, ref, sha): assert isinstance(ref, (str, unicode)), ref @@ -292,21 +290,21 @@ class Repository(GithubObject.GithubObject): None, post_parameters ) - return GitRef.GitRef(self._requester, data, completed=True) + return github.GitRef.GitRef(self._requester, data, completed=True) - def create_git_tag(self, tag, message, object, type, tagger=GithubObject.NotSet): + def create_git_tag(self, tag, message, object, type, tagger=github.GithubObject.NotSet): assert isinstance(tag, (str, unicode)), tag assert isinstance(message, (str, unicode)), message assert isinstance(object, (str, unicode)), object assert isinstance(type, (str, unicode)), type - assert tagger is GithubObject.NotSet or isinstance(tagger, InputGitAuthor.InputGitAuthor), tagger + assert tagger is github.GithubObject.NotSet or isinstance(tagger, github.InputGitAuthor), tagger post_parameters = { "tag": tag, "message": message, "object": object, "type": type, } - if tagger is not GithubObject.NotSet: + if tagger is not github.GithubObject.NotSet: post_parameters["tagger"] = tagger._identity headers, data = self._requester.requestAndCheck( "POST", @@ -314,15 +312,15 @@ class Repository(GithubObject.GithubObject): None, post_parameters ) - return GitTag.GitTag(self._requester, data, completed=True) + return github.GitTag.GitTag(self._requester, data, completed=True) - def create_git_tree(self, tree, base_tree=GithubObject.NotSet): - assert all(isinstance(element, InputGitTreeElement.InputGitTreeElement) for element in tree), tree - assert base_tree is GithubObject.NotSet or isinstance(base_tree, GitTree.GitTree), base_tree + def create_git_tree(self, tree, base_tree=github.GithubObject.NotSet): + assert all(isinstance(element, github.InputGitTreeElement) for element in tree), tree + assert base_tree is github.GithubObject.NotSet or isinstance(base_tree, github.GitTree.GitTree), base_tree post_parameters = { "tree": [element._identity for element in tree], } - if base_tree is not GithubObject.NotSet: + if base_tree is not github.GithubObject.NotSet: post_parameters["base_tree"] = base_tree._identity headers, data = self._requester.requestAndCheck( "POST", @@ -330,20 +328,20 @@ class Repository(GithubObject.GithubObject): None, post_parameters ) - return GitTree.GitTree(self._requester, data, completed=True) + return github.GitTree.GitTree(self._requester, data, completed=True) - def create_hook(self, name, config, events=GithubObject.NotSet, active=GithubObject.NotSet): + def create_hook(self, name, config, events=github.GithubObject.NotSet, active=github.GithubObject.NotSet): assert isinstance(name, (str, unicode)), name assert isinstance(config, dict), config - assert events is GithubObject.NotSet or all(isinstance(element, (str, unicode)) for element in events), events - assert active is GithubObject.NotSet or isinstance(active, bool), active + assert events is github.GithubObject.NotSet or all(isinstance(element, (str, unicode)) for element in events), events + assert active is github.GithubObject.NotSet or isinstance(active, bool), active post_parameters = { "name": name, "config": config, } - if events is not GithubObject.NotSet: + if events is not github.GithubObject.NotSet: post_parameters["events"] = events - if active is not GithubObject.NotSet: + if active is not github.GithubObject.NotSet: post_parameters["active"] = active headers, data = self._requester.requestAndCheck( "POST", @@ -351,24 +349,24 @@ class Repository(GithubObject.GithubObject): None, post_parameters ) - return Hook.Hook(self._requester, data, completed=True) + return github.Hook.Hook(self._requester, data, completed=True) - def create_issue(self, title, body=GithubObject.NotSet, assignee=GithubObject.NotSet, milestone=GithubObject.NotSet, labels=GithubObject.NotSet): + def create_issue(self, title, body=github.GithubObject.NotSet, assignee=github.GithubObject.NotSet, milestone=github.GithubObject.NotSet, labels=github.GithubObject.NotSet): assert isinstance(title, (str, unicode)), title - assert body is GithubObject.NotSet or isinstance(body, (str, unicode)), body - assert assignee is GithubObject.NotSet or isinstance(assignee, NamedUser.NamedUser), assignee - assert milestone is GithubObject.NotSet or isinstance(milestone, Milestone.Milestone), milestone - assert labels is GithubObject.NotSet or all(isinstance(element, Label.Label) for element in labels), labels + 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 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 = { "title": title, } - if body is not GithubObject.NotSet: + if body is not github.GithubObject.NotSet: post_parameters["body"] = body - if assignee is not GithubObject.NotSet: + if assignee is not github.GithubObject.NotSet: post_parameters["assignee"] = assignee._identity - if milestone is not GithubObject.NotSet: + if milestone is not github.GithubObject.NotSet: post_parameters["milestone"] = milestone._identity - if labels is not GithubObject.NotSet: + if labels is not github.GithubObject.NotSet: post_parameters["labels"] = [element.name for element in labels] headers, data = self._requester.requestAndCheck( "POST", @@ -376,7 +374,7 @@ class Repository(GithubObject.GithubObject): None, post_parameters ) - return Issue.Issue(self._requester, data, completed=True) + return github.Issue.Issue(self._requester, data, completed=True) def create_key(self, title, key): assert isinstance(title, (str, unicode)), title @@ -391,7 +389,7 @@ class Repository(GithubObject.GithubObject): None, post_parameters ) - return RepositoryKey.RepositoryKey(self._requester, data, completed=True, repoUrl=self._url) + return github.RepositoryKey.RepositoryKey(self._requester, data, completed=True, repoUrl=self._url) def create_label(self, name, color): assert isinstance(name, (str, unicode)), name @@ -406,21 +404,21 @@ class Repository(GithubObject.GithubObject): None, post_parameters ) - return Label.Label(self._requester, data, completed=True) + return github.Label.Label(self._requester, data, completed=True) - def create_milestone(self, title, state=GithubObject.NotSet, description=GithubObject.NotSet, due_on=GithubObject.NotSet): + def create_milestone(self, title, state=github.GithubObject.NotSet, description=github.GithubObject.NotSet, due_on=github.GithubObject.NotSet): assert isinstance(title, (str, unicode)), title - assert state is GithubObject.NotSet or isinstance(state, (str, unicode)), state - assert description is GithubObject.NotSet or isinstance(description, (str, unicode)), description - assert due_on is GithubObject.NotSet or isinstance(due_on, datetime.date), due_on + assert state is github.GithubObject.NotSet or isinstance(state, (str, unicode)), state + assert description is github.GithubObject.NotSet or isinstance(description, (str, unicode)), description + assert due_on is github.GithubObject.NotSet or isinstance(due_on, datetime.date), due_on post_parameters = { "title": title, } - if state is not GithubObject.NotSet: + if state is not github.GithubObject.NotSet: post_parameters["state"] = state - if description is not GithubObject.NotSet: + if description is not github.GithubObject.NotSet: post_parameters["description"] = description - if due_on is not GithubObject.NotSet: + if due_on is not github.GithubObject.NotSet: post_parameters["due_on"] = due_on.strftime("%Y-%m-%d") headers, data = self._requester.requestAndCheck( "POST", @@ -428,7 +426,7 @@ class Repository(GithubObject.GithubObject): None, post_parameters ) - return Milestone.Milestone(self._requester, data, completed=True) + return github.Milestone.Milestone(self._requester, data, completed=True) def create_pull(self, *args, **kwds): if len(args) + len(kwds) == 4: @@ -444,7 +442,7 @@ class Repository(GithubObject.GithubObject): return self.__create_pull(title=title, body=body, base=base, head=head) def __create_pull_2(self, issue, base, head): - assert isinstance(issue, Issue.Issue), issue + assert isinstance(issue, github.Issue.Issue), issue assert isinstance(base, (str, unicode)), base assert isinstance(head, (str, unicode)), head return self.__create_pull(issue=issue._identity, base=base, head=head) @@ -457,7 +455,7 @@ class Repository(GithubObject.GithubObject): None, post_parameters ) - return PullRequest.PullRequest(self._requester, data, completed=True) + return github.PullRequest.PullRequest(self._requester, data, completed=True) def delete(self): headers, data = self._requester.requestAndCheck( @@ -467,31 +465,31 @@ class Repository(GithubObject.GithubObject): None ) - def edit(self, name, description=GithubObject.NotSet, homepage=GithubObject.NotSet, public=GithubObject.NotSet, has_issues=GithubObject.NotSet, has_wiki=GithubObject.NotSet, has_downloads=GithubObject.NotSet, default_branch=GithubObject.NotSet): + def edit(self, name, description=github.GithubObject.NotSet, homepage=github.GithubObject.NotSet, public=github.GithubObject.NotSet, has_issues=github.GithubObject.NotSet, has_wiki=github.GithubObject.NotSet, has_downloads=github.GithubObject.NotSet, default_branch=github.GithubObject.NotSet): assert isinstance(name, (str, unicode)), name - assert description is GithubObject.NotSet or isinstance(description, (str, unicode)), description - assert homepage is GithubObject.NotSet or isinstance(homepage, (str, unicode)), homepage - assert public is GithubObject.NotSet or isinstance(public, bool), public - assert has_issues is GithubObject.NotSet or isinstance(has_issues, bool), has_issues - assert has_wiki is GithubObject.NotSet or isinstance(has_wiki, bool), has_wiki - assert has_downloads is GithubObject.NotSet or isinstance(has_downloads, bool), has_downloads - assert default_branch is GithubObject.NotSet or isinstance(default_branch, (str, unicode)), default_branch + assert description is github.GithubObject.NotSet or isinstance(description, (str, unicode)), description + assert homepage is github.GithubObject.NotSet or isinstance(homepage, (str, unicode)), homepage + assert public is github.GithubObject.NotSet or isinstance(public, bool), public + assert has_issues is github.GithubObject.NotSet or isinstance(has_issues, bool), has_issues + assert has_wiki is github.GithubObject.NotSet or isinstance(has_wiki, bool), has_wiki + assert has_downloads is github.GithubObject.NotSet or isinstance(has_downloads, bool), has_downloads + assert default_branch is github.GithubObject.NotSet or isinstance(default_branch, (str, unicode)), default_branch post_parameters = { "name": name, } - if description is not GithubObject.NotSet: + if description is not github.GithubObject.NotSet: post_parameters["description"] = description - if homepage is not GithubObject.NotSet: + if homepage is not github.GithubObject.NotSet: post_parameters["homepage"] = homepage - if public is not GithubObject.NotSet: + if public is not github.GithubObject.NotSet: post_parameters["public"] = public - if has_issues is not GithubObject.NotSet: + if has_issues is not github.GithubObject.NotSet: post_parameters["has_issues"] = has_issues - if has_wiki is not GithubObject.NotSet: + if has_wiki is not github.GithubObject.NotSet: post_parameters["has_wiki"] = has_wiki - if has_downloads is not GithubObject.NotSet: + if has_downloads is not github.GithubObject.NotSet: post_parameters["has_downloads"] = has_downloads - if default_branch is not GithubObject.NotSet: + if default_branch is not github.GithubObject.NotSet: post_parameters["default_branch"] = default_branch headers, data = self._requester.requestAndCheck( "PATCH", @@ -501,11 +499,11 @@ class Repository(GithubObject.GithubObject): ) self._useAttributes(data) - def get_archive_link(self, archive_format, ref=GithubObject.NotSet): + def get_archive_link(self, archive_format, ref=github.GithubObject.NotSet): assert isinstance(archive_format, (str, unicode)), archive_format - assert ref is GithubObject.NotSet or isinstance(ref, (str, unicode)), ref + assert ref is github.GithubObject.NotSet or isinstance(ref, (str, unicode)), ref url = self.url + "/" + archive_format - if ref is not GithubObject.NotSet: + if ref is not github.GithubObject.NotSet: url += "/" + ref headers, data = self._requester.requestAndCheck( "GET", @@ -516,8 +514,8 @@ class Repository(GithubObject.GithubObject): return headers["location"] def get_assignees(self): - return PaginatedList.PaginatedList( - NamedUser.NamedUser, + return github.PaginatedList.PaginatedList( + github.NamedUser.NamedUser, self._requester, self.url + "/assignees", None @@ -531,19 +529,19 @@ class Repository(GithubObject.GithubObject): None, None ) - return Branch.Branch(self._requester, data, completed=True) + return github.Branch.Branch(self._requester, data, completed=True) def get_branches(self): - return PaginatedList.PaginatedList( - Branch.Branch, + return github.PaginatedList.PaginatedList( + github.Branch.Branch, self._requester, self.url + "/branches", None ) def get_collaborators(self): - return PaginatedList.PaginatedList( - NamedUser.NamedUser, + return github.PaginatedList.PaginatedList( + github.NamedUser.NamedUser, self._requester, self.url + "/collaborators", None @@ -557,11 +555,11 @@ class Repository(GithubObject.GithubObject): None, None ) - return CommitComment.CommitComment(self._requester, data, completed=True) + return github.CommitComment.CommitComment(self._requester, data, completed=True) def get_comments(self): - return PaginatedList.PaginatedList( - CommitComment.CommitComment, + return github.PaginatedList.PaginatedList( + github.CommitComment.CommitComment, self._requester, self.url + "/comments", None @@ -575,18 +573,18 @@ class Repository(GithubObject.GithubObject): None, None ) - return Commit.Commit(self._requester, data, completed=True) + return github.Commit.Commit(self._requester, data, completed=True) - def get_commits(self, sha=GithubObject.NotSet, path=GithubObject.NotSet): - assert sha is GithubObject.NotSet or isinstance(sha, (str, unicode)), sha - assert path is GithubObject.NotSet or isinstance(path, (str, unicode)), path + def get_commits(self, sha=github.GithubObject.NotSet, path=github.GithubObject.NotSet): + assert sha is github.GithubObject.NotSet or isinstance(sha, (str, unicode)), sha + assert path is github.GithubObject.NotSet or isinstance(path, (str, unicode)), path url_parameters = dict() - if sha is not GithubObject.NotSet: + if sha is not github.GithubObject.NotSet: url_parameters["sha"] = sha - if path is not GithubObject.NotSet: + if path is not github.GithubObject.NotSet: url_parameters["path"] = path - return PaginatedList.PaginatedList( - Commit.Commit, + return github.PaginatedList.PaginatedList( + github.Commit.Commit, self._requester, self.url + "/commits", url_parameters @@ -600,11 +598,11 @@ class Repository(GithubObject.GithubObject): None, None ) - return ContentFile.ContentFile(self._requester, data, completed=True) + return github.ContentFile.ContentFile(self._requester, data, completed=True) def get_contributors(self): - return PaginatedList.PaginatedList( - NamedUser.NamedUser, + return github.PaginatedList.PaginatedList( + github.NamedUser.NamedUser, self._requester, self.url + "/contributors", None @@ -618,26 +616,26 @@ class Repository(GithubObject.GithubObject): None, None ) - return Download.Download(self._requester, data, completed=True) + return github.Download.Download(self._requester, data, completed=True) def get_downloads(self): - return PaginatedList.PaginatedList( - Download.Download, + return github.PaginatedList.PaginatedList( + github.Download.Download, self._requester, self.url + "/downloads", None ) def get_events(self): - return PaginatedList.PaginatedList( - Event.Event, + return github.PaginatedList.PaginatedList( + github.Event.Event, self._requester, self.url + "/events", None ) def get_forks(self): - return PaginatedList.PaginatedList( + return github.PaginatedList.PaginatedList( Repository, self._requester, self.url + "/forks", @@ -652,7 +650,7 @@ class Repository(GithubObject.GithubObject): None, None ) - return GitBlob.GitBlob(self._requester, data, completed=True) + return github.GitBlob.GitBlob(self._requester, data, completed=True) def get_git_commit(self, sha): assert isinstance(sha, (str, unicode)), sha @@ -662,7 +660,7 @@ class Repository(GithubObject.GithubObject): None, None ) - return GitCommit.GitCommit(self._requester, data, completed=True) + return github.GitCommit.GitCommit(self._requester, data, completed=True) def get_git_ref(self, ref): prefix = "/git/refs/" @@ -675,11 +673,11 @@ class Repository(GithubObject.GithubObject): None, None ) - return GitRef.GitRef(self._requester, data, completed=True) + return github.GitRef.GitRef(self._requester, data, completed=True) def get_git_refs(self): - return PaginatedList.PaginatedList( - GitRef.GitRef, + return github.PaginatedList.PaginatedList( + github.GitRef.GitRef, self._requester, self.url + "/git/refs", None @@ -693,13 +691,13 @@ class Repository(GithubObject.GithubObject): None, None ) - return GitTag.GitTag(self._requester, data, completed=True) + return github.GitTag.GitTag(self._requester, data, completed=True) - def get_git_tree(self, sha, recursive=GithubObject.NotSet): + def get_git_tree(self, sha, recursive=github.GithubObject.NotSet): assert isinstance(sha, (str, unicode)), sha - assert recursive is GithubObject.NotSet or isinstance(recursive, bool), recursive + assert recursive is github.GithubObject.NotSet or isinstance(recursive, bool), recursive url_parameters = dict() - if recursive is not GithubObject.NotSet: + if recursive is not github.GithubObject.NotSet: url_parameters["recursive"] = recursive headers, data = self._requester.requestAndCheck( "GET", @@ -707,7 +705,7 @@ class Repository(GithubObject.GithubObject): url_parameters, None ) - return GitTree.GitTree(self._requester, data, completed=True) + return github.GitTree.GitTree(self._requester, data, completed=True) def get_hook(self, id): assert isinstance(id, (int, long)), id @@ -717,11 +715,11 @@ class Repository(GithubObject.GithubObject): None, None ) - return Hook.Hook(self._requester, data, completed=True) + return github.Hook.Hook(self._requester, data, completed=True) def get_hooks(self): - return PaginatedList.PaginatedList( - Hook.Hook, + return github.PaginatedList.PaginatedList( + github.Hook.Hook, self._requester, self.url + "/hooks", None @@ -735,42 +733,42 @@ class Repository(GithubObject.GithubObject): None, None ) - return Issue.Issue(self._requester, data, completed=True) + return github.Issue.Issue(self._requester, data, completed=True) - def get_issues(self, milestone=GithubObject.NotSet, state=GithubObject.NotSet, assignee=GithubObject.NotSet, mentioned=GithubObject.NotSet, labels=GithubObject.NotSet, sort=GithubObject.NotSet, direction=GithubObject.NotSet, since=GithubObject.NotSet): - assert milestone is GithubObject.NotSet or milestone == "*" or milestone == "none" or isinstance(milestone, Milestone.Milestone), milestone - assert state is GithubObject.NotSet or isinstance(state, (str, unicode)), state - assert assignee is GithubObject.NotSet or assignee == "*" or assignee == "none" or isinstance(assignee, NamedUser.NamedUser), assignee - assert mentioned is GithubObject.NotSet or isinstance(mentioned, NamedUser.NamedUser), mentioned - assert labels is GithubObject.NotSet or all(isinstance(element, Label.Label) for element in labels), labels - assert sort is GithubObject.NotSet or isinstance(sort, (str, unicode)), sort - assert direction is GithubObject.NotSet or isinstance(direction, (str, unicode)), direction - assert since is GithubObject.NotSet or isinstance(since, datetime.datetime), since + def get_issues(self, milestone=github.GithubObject.NotSet, state=github.GithubObject.NotSet, assignee=github.GithubObject.NotSet, mentioned=github.GithubObject.NotSet, labels=github.GithubObject.NotSet, sort=github.GithubObject.NotSet, direction=github.GithubObject.NotSet, since=github.GithubObject.NotSet): + 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 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 + assert direction is github.GithubObject.NotSet or isinstance(direction, (str, unicode)), direction + assert since is github.GithubObject.NotSet or isinstance(since, datetime.datetime), since url_parameters = dict() - if milestone is not GithubObject.NotSet: + if milestone is not github.GithubObject.NotSet: if isinstance(milestone, str): url_parameters["milestone"] = milestone else: url_parameters["milestone"] = milestone._identity - if state is not GithubObject.NotSet: + if state is not github.GithubObject.NotSet: url_parameters["state"] = state - if assignee is not GithubObject.NotSet: + if assignee is not github.GithubObject.NotSet: if isinstance(assignee, str): url_parameters["assignee"] = assignee else: url_parameters["assignee"] = assignee._identity - if mentioned is not GithubObject.NotSet: + if mentioned is not github.GithubObject.NotSet: url_parameters["mentioned"] = mentioned._identity - if labels is not GithubObject.NotSet: + if labels is not github.GithubObject.NotSet: url_parameters["labels"] = ",".join(label.name for label in labels) - if sort is not GithubObject.NotSet: + if sort is not github.GithubObject.NotSet: url_parameters["sort"] = sort - if direction is not GithubObject.NotSet: + if direction is not github.GithubObject.NotSet: url_parameters["direction"] = direction - if since is not GithubObject.NotSet: + if since is not github.GithubObject.NotSet: url_parameters["since"] = since.strftime("%Y-%m-%dT%H:%M:%SZ") - return PaginatedList.PaginatedList( - Issue.Issue, + return github.PaginatedList.PaginatedList( + github.Issue.Issue, self._requester, self.url + "/issues", url_parameters @@ -784,11 +782,11 @@ class Repository(GithubObject.GithubObject): None, None ) - return IssueEvent.IssueEvent(self._requester, data, completed=True) + return github.IssueEvent.IssueEvent(self._requester, data, completed=True) def get_issues_events(self): - return PaginatedList.PaginatedList( - IssueEvent.IssueEvent, + return github.PaginatedList.PaginatedList( + github.IssueEvent.IssueEvent, self._requester, self.url + "/issues/events", None @@ -802,11 +800,11 @@ class Repository(GithubObject.GithubObject): None, None ) - return RepositoryKey.RepositoryKey(self._requester, data, completed=True, repoUrl=self._url) + return github.RepositoryKey.RepositoryKey(self._requester, data, completed=True, repoUrl=self._url) def get_keys(self): - return PaginatedList.PaginatedList( - lambda requester, data, completed: RepositoryKey.RepositoryKey(requester, data, completed, repoUrl=self._url), + return github.PaginatedList.PaginatedList( + lambda requester, data, completed: github.RepositoryKey.RepositoryKey(requester, data, completed, repoUrl=self._url), self._requester, self.url + "/keys", None @@ -820,11 +818,11 @@ class Repository(GithubObject.GithubObject): None, None ) - return Label.Label(self._requester, data, completed=True) + return github.Label.Label(self._requester, data, completed=True) def get_labels(self): - return PaginatedList.PaginatedList( - Label.Label, + return github.PaginatedList.PaginatedList( + github.Label.Label, self._requester, self.url + "/labels", None @@ -847,29 +845,29 @@ class Repository(GithubObject.GithubObject): None, None ) - return Milestone.Milestone(self._requester, data, completed=True) + return github.Milestone.Milestone(self._requester, data, completed=True) - def get_milestones(self, state=GithubObject.NotSet, sort=GithubObject.NotSet, direction=GithubObject.NotSet): - assert state is GithubObject.NotSet or isinstance(state, (str, unicode)), state - assert sort is GithubObject.NotSet or isinstance(sort, (str, unicode)), sort - assert direction is GithubObject.NotSet or isinstance(direction, (str, unicode)), direction + def get_milestones(self, state=github.GithubObject.NotSet, sort=github.GithubObject.NotSet, direction=github.GithubObject.NotSet): + assert state is github.GithubObject.NotSet or isinstance(state, (str, unicode)), state + assert sort is github.GithubObject.NotSet or isinstance(sort, (str, unicode)), sort + assert direction is github.GithubObject.NotSet or isinstance(direction, (str, unicode)), direction url_parameters = dict() - if state is not GithubObject.NotSet: + if state is not github.GithubObject.NotSet: url_parameters["state"] = state - if sort is not GithubObject.NotSet: + if sort is not github.GithubObject.NotSet: url_parameters["sort"] = sort - if direction is not GithubObject.NotSet: + if direction is not github.GithubObject.NotSet: url_parameters["direction"] = direction - return PaginatedList.PaginatedList( - Milestone.Milestone, + return github.PaginatedList.PaginatedList( + github.Milestone.Milestone, self._requester, self.url + "/milestones", url_parameters ) def get_network_events(self): - return PaginatedList.PaginatedList( - Event.Event, + return github.PaginatedList.PaginatedList( + github.Event.Event, self._requester, "/networks/" + self.owner.login + "/" + self.name + "/events", None @@ -883,15 +881,15 @@ class Repository(GithubObject.GithubObject): None, None ) - return PullRequest.PullRequest(self._requester, data, completed=True) + return github.PullRequest.PullRequest(self._requester, data, completed=True) - def get_pulls(self, state=GithubObject.NotSet): - assert state is GithubObject.NotSet or isinstance(state, (str, unicode)), state + def get_pulls(self, state=github.GithubObject.NotSet): + assert state is github.GithubObject.NotSet or isinstance(state, (str, unicode)), state url_parameters = dict() - if state is not GithubObject.NotSet: + if state is not github.GithubObject.NotSet: url_parameters["state"] = state - return PaginatedList.PaginatedList( - PullRequest.PullRequest, + return github.PaginatedList.PaginatedList( + github.PullRequest.PullRequest, self._requester, self.url + "/pulls", url_parameters @@ -904,50 +902,50 @@ class Repository(GithubObject.GithubObject): None, None ) - return ContentFile.ContentFile(self._requester, data, completed=True) + return github.ContentFile.ContentFile(self._requester, data, completed=True) def get_stargazers(self): - return PaginatedList.PaginatedList( - NamedUser.NamedUser, + return github.PaginatedList.PaginatedList( + github.NamedUser.NamedUser, self._requester, self.url + "/stargazers", None ) def get_subscribers(self): - return PaginatedList.PaginatedList( - NamedUser.NamedUser, + return github.PaginatedList.PaginatedList( + github.NamedUser.NamedUser, self._requester, self.url + "/subscribers", None ) def get_tags(self): - return PaginatedList.PaginatedList( - Tag.Tag, + return github.PaginatedList.PaginatedList( + github.Tag.Tag, self._requester, self.url + "/tags", None ) def get_teams(self): - return PaginatedList.PaginatedList( - Team.Team, + return github.PaginatedList.PaginatedList( + github.Team.Team, self._requester, self.url + "/teams", None ) def get_watchers(self): - return PaginatedList.PaginatedList( - NamedUser.NamedUser, + return github.PaginatedList.PaginatedList( + github.NamedUser.NamedUser, self._requester, self.url + "/watchers", None ) def has_in_assignees(self, assignee): - assert isinstance(assignee, NamedUser.NamedUser), assignee + assert isinstance(assignee, github.NamedUser.NamedUser), assignee status, headers, data = self._requester.requestRaw( "GET", self.url + "/assignees/" + assignee._identity, @@ -957,7 +955,7 @@ class Repository(GithubObject.GithubObject): return status == 204 def has_in_collaborators(self, collaborator): - assert isinstance(collaborator, NamedUser.NamedUser), collaborator + assert isinstance(collaborator, github.NamedUser.NamedUser), collaborator status, headers, data = self._requester.requestRaw( "GET", self.url + "/collaborators/" + collaborator._identity, @@ -976,19 +974,19 @@ class Repository(GithubObject.GithubObject): None ) return [ - Issue.Issue(self._requester, Legacy.convertIssue(element), completed=False) + github.Issue.Issue(self._requester, github.Legacy.convertIssue(element), completed=False) for element in data["issues"] ] - def merge(self, base, head, commit_message=GithubObject.NotSet): + def merge(self, base, head, commit_message=github.GithubObject.NotSet): assert isinstance(base, (str, unicode)), base assert isinstance(head, (str, unicode)), head - assert commit_message is GithubObject.NotSet or isinstance(commit_message, (str, unicode)), commit_message + assert commit_message is github.GithubObject.NotSet or isinstance(commit_message, (str, unicode)), commit_message post_parameters = { "base": base, "head": head, } - if commit_message is not GithubObject.NotSet: + if commit_message is not github.GithubObject.NotSet: post_parameters["commit_message"] = commit_message headers, data = self._requester.requestAndCheck( "POST", @@ -999,10 +997,10 @@ class Repository(GithubObject.GithubObject): if data is None: return None else: - return Commit.Commit(self._requester, data, completed=True) + return github.Commit.Commit(self._requester, data, completed=True) def remove_from_collaborators(self, collaborator): - assert isinstance(collaborator, NamedUser.NamedUser), collaborator + assert isinstance(collaborator, github.NamedUser.NamedUser), collaborator headers, data = self._requester.requestAndCheck( "DELETE", self.url + "/collaborators/" + collaborator._identity, @@ -1015,36 +1013,36 @@ class Repository(GithubObject.GithubObject): return self.owner.login + "/" + self.name def _initAttributes(self): - self._clone_url = GithubObject.NotSet - self._created_at = GithubObject.NotSet - self._description = GithubObject.NotSet - self._fork = GithubObject.NotSet - self._forks = GithubObject.NotSet - self._full_name = GithubObject.NotSet - self._git_url = GithubObject.NotSet - self._has_downloads = GithubObject.NotSet - self._has_issues = GithubObject.NotSet - self._has_wiki = GithubObject.NotSet - self._homepage = GithubObject.NotSet - self._html_url = GithubObject.NotSet - self._id = GithubObject.NotSet - self._language = GithubObject.NotSet - self._master_branch = GithubObject.NotSet - self._name = GithubObject.NotSet - self._open_issues = GithubObject.NotSet - self._organization = GithubObject.NotSet - self._owner = GithubObject.NotSet - self._parent = GithubObject.NotSet - self._permissions = GithubObject.NotSet - self._private = GithubObject.NotSet - self._pushed_at = GithubObject.NotSet - self._size = GithubObject.NotSet - self._source = GithubObject.NotSet - self._ssh_url = GithubObject.NotSet - self._svn_url = GithubObject.NotSet - self._updated_at = GithubObject.NotSet - self._url = GithubObject.NotSet - self._watchers = GithubObject.NotSet + self._clone_url = github.GithubObject.NotSet + self._created_at = github.GithubObject.NotSet + self._description = github.GithubObject.NotSet + self._fork = github.GithubObject.NotSet + self._forks = github.GithubObject.NotSet + self._full_name = github.GithubObject.NotSet + self._git_url = github.GithubObject.NotSet + self._has_downloads = github.GithubObject.NotSet + self._has_issues = github.GithubObject.NotSet + self._has_wiki = github.GithubObject.NotSet + self._homepage = github.GithubObject.NotSet + self._html_url = github.GithubObject.NotSet + self._id = github.GithubObject.NotSet + self._language = github.GithubObject.NotSet + self._master_branch = github.GithubObject.NotSet + self._name = github.GithubObject.NotSet + self._open_issues = github.GithubObject.NotSet + self._organization = github.GithubObject.NotSet + self._owner = github.GithubObject.NotSet + self._parent = github.GithubObject.NotSet + self._permissions = github.GithubObject.NotSet + self._private = github.GithubObject.NotSet + self._pushed_at = github.GithubObject.NotSet + self._size = github.GithubObject.NotSet + self._source = github.GithubObject.NotSet + self._ssh_url = github.GithubObject.NotSet + self._svn_url = github.GithubObject.NotSet + self._updated_at = github.GithubObject.NotSet + self._url = github.GithubObject.NotSet + self._watchers = github.GithubObject.NotSet def _useAttributes(self, attributes): if "clone_url" in attributes: # pragma no branch @@ -1100,16 +1098,16 @@ class Repository(GithubObject.GithubObject): self._open_issues = attributes["open_issues"] if "organization" in attributes: # pragma no branch assert attributes["organization"] is None or isinstance(attributes["organization"], dict), attributes["organization"] - self._organization = None if attributes["organization"] is None else Organization.Organization(self._requester, attributes["organization"], completed=False) + self._organization = None if attributes["organization"] is None else github.Organization.Organization(self._requester, attributes["organization"], completed=False) if "owner" in attributes: # pragma no branch assert attributes["owner"] is None or isinstance(attributes["owner"], dict), attributes["owner"] - self._owner = None if attributes["owner"] is None else NamedUser.NamedUser(self._requester, attributes["owner"], completed=False) + self._owner = None if attributes["owner"] is None else github.NamedUser.NamedUser(self._requester, attributes["owner"], completed=False) if "parent" in attributes: # pragma no branch assert attributes["parent"] is None or isinstance(attributes["parent"], dict), attributes["parent"] self._parent = None if attributes["parent"] is None else Repository(self._requester, attributes["parent"], completed=False) if "permissions" in attributes: # pragma no branch assert attributes["permissions"] is None or isinstance(attributes["permissions"], dict), attributes["permissions"] - self._permissions = None if attributes["permissions"] is None else Permissions.Permissions(self._requester, attributes["permissions"], completed=False) + self._permissions = None if attributes["permissions"] is None else github.Permissions.Permissions(self._requester, attributes["permissions"], completed=False) if "private" in attributes: # pragma no branch assert attributes["private"] is None or isinstance(attributes["private"], bool), attributes["private"] self._private = attributes["private"] diff --git a/github/RepositoryKey.py b/github/RepositoryKey.py index dc759180..028dc3ce 100644 --- a/github/RepositoryKey.py +++ b/github/RepositoryKey.py @@ -13,12 +13,12 @@ # You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see . -import GithubObject +import github.GithubObject -class RepositoryKey(GithubObject.GithubObject): +class RepositoryKey(github.GithubObject.GithubObject): def __init__(self, requester, attributes, completed, repoUrl): - GithubObject.GithubObject.__init__(self, requester, attributes, completed) + github.GithubObject.GithubObject.__init__(self, requester, attributes, completed) self.__repoUrl = repoUrl @property @@ -58,13 +58,13 @@ class RepositoryKey(GithubObject.GithubObject): None ) - def edit(self, title=GithubObject.NotSet, key=GithubObject.NotSet): - assert title is GithubObject.NotSet or isinstance(title, (str, unicode)), title - assert key is GithubObject.NotSet or isinstance(key, (str, unicode)), key + def edit(self, title=github.GithubObject.NotSet, key=github.GithubObject.NotSet): + assert title is github.GithubObject.NotSet or isinstance(title, (str, unicode)), title + assert key is github.GithubObject.NotSet or isinstance(key, (str, unicode)), key post_parameters = dict() - if title is not GithubObject.NotSet: + if title is not github.GithubObject.NotSet: post_parameters["title"] = title - if key is not GithubObject.NotSet: + if key is not github.GithubObject.NotSet: post_parameters["key"] = key headers, data = self._requester.requestAndCheck( "PATCH", @@ -75,11 +75,11 @@ class RepositoryKey(GithubObject.GithubObject): self._useAttributes(data) def _initAttributes(self): - self._id = GithubObject.NotSet - self._key = GithubObject.NotSet - self._title = GithubObject.NotSet - self._url = GithubObject.NotSet - self._verified = GithubObject.NotSet + self._id = github.GithubObject.NotSet + self._key = github.GithubObject.NotSet + self._title = github.GithubObject.NotSet + self._url = github.GithubObject.NotSet + self._verified = github.GithubObject.NotSet def _useAttributes(self, attributes): if "id" in attributes: # pragma no branch diff --git a/github/Tag.py b/github/Tag.py index b38ff6ae..96c87022 100644 --- a/github/Tag.py +++ b/github/Tag.py @@ -13,12 +13,12 @@ # You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see . -import GithubObject +import github.GithubObject -import Commit +import github.Commit -class Tag(GithubObject.BasicGithubObject): +class Tag(github.GithubObject.BasicGithubObject): @property def commit(self): return self._NoneIfNotSet(self._commit) @@ -36,15 +36,15 @@ class Tag(GithubObject.BasicGithubObject): return self._NoneIfNotSet(self._zipball_url) def _initAttributes(self): - self._commit = GithubObject.NotSet - self._name = GithubObject.NotSet - self._tarball_url = GithubObject.NotSet - self._zipball_url = GithubObject.NotSet + self._commit = github.GithubObject.NotSet + self._name = github.GithubObject.NotSet + self._tarball_url = github.GithubObject.NotSet + self._zipball_url = github.GithubObject.NotSet def _useAttributes(self, attributes): if "commit" in attributes: # pragma no branch assert attributes["commit"] is None or isinstance(attributes["commit"], dict), attributes["commit"] - self._commit = None if attributes["commit"] is None else Commit.Commit(self._requester, attributes["commit"], completed=False) + self._commit = None if attributes["commit"] is None else github.Commit.Commit(self._requester, attributes["commit"], completed=False) if "name" in attributes: # pragma no branch assert attributes["name"] is None or isinstance(attributes["name"], (str, unicode)), attributes["name"] self._name = attributes["name"] diff --git a/github/Team.py b/github/Team.py index 9dea6f09..684e5df9 100644 --- a/github/Team.py +++ b/github/Team.py @@ -13,14 +13,14 @@ # You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see . -import GithubObject -import PaginatedList +import github.GithubObject +import github.PaginatedList -import Repository -import NamedUser +import github.Repository +import github.NamedUser -class Team(GithubObject.GithubObject): +class Team(github.GithubObject.GithubObject): @property def id(self): self._completeIfNotSet(self._id) @@ -52,7 +52,7 @@ class Team(GithubObject.GithubObject): return self._NoneIfNotSet(self._url) def add_to_members(self, member): - assert isinstance(member, NamedUser.NamedUser), member + assert isinstance(member, github.NamedUser.NamedUser), member headers, data = self._requester.requestAndCheck( "PUT", self.url + "/members/" + member._identity, @@ -61,7 +61,7 @@ class Team(GithubObject.GithubObject): ) def add_to_repos(self, repo): - assert isinstance(repo, Repository.Repository), repo + assert isinstance(repo, github.Repository.Repository), repo headers, data = self._requester.requestAndCheck( "PUT", self.url + "/repos/" + repo._identity, @@ -77,13 +77,13 @@ class Team(GithubObject.GithubObject): None ) - def edit(self, name, permission=GithubObject.NotSet): + def edit(self, name, permission=github.GithubObject.NotSet): assert isinstance(name, (str, unicode)), name - assert permission is GithubObject.NotSet or isinstance(permission, (str, unicode)), permission + assert permission is github.GithubObject.NotSet or isinstance(permission, (str, unicode)), permission post_parameters = { "name": name, } - if permission is not GithubObject.NotSet: + if permission is not github.GithubObject.NotSet: post_parameters["permission"] = permission headers, data = self._requester.requestAndCheck( "PATCH", @@ -94,23 +94,23 @@ class Team(GithubObject.GithubObject): self._useAttributes(data) def get_members(self): - return PaginatedList.PaginatedList( - NamedUser.NamedUser, + return github.PaginatedList.PaginatedList( + github.NamedUser.NamedUser, self._requester, self.url + "/members", None ) def get_repos(self): - return PaginatedList.PaginatedList( - Repository.Repository, + return github.PaginatedList.PaginatedList( + github.Repository.Repository, self._requester, self.url + "/repos", None ) def has_in_members(self, member): - assert isinstance(member, NamedUser.NamedUser), member + assert isinstance(member, github.NamedUser.NamedUser), member status, headers, data = self._requester.requestRaw( "GET", self.url + "/members/" + member._identity, @@ -120,7 +120,7 @@ class Team(GithubObject.GithubObject): return status == 204 def has_in_repos(self, repo): - assert isinstance(repo, Repository.Repository), repo + assert isinstance(repo, github.Repository.Repository), repo status, headers, data = self._requester.requestRaw( "GET", self.url + "/repos/" + repo._identity, @@ -130,7 +130,7 @@ class Team(GithubObject.GithubObject): return status == 204 def remove_from_members(self, member): - assert isinstance(member, NamedUser.NamedUser), member + assert isinstance(member, github.NamedUser.NamedUser), member headers, data = self._requester.requestAndCheck( "DELETE", self.url + "/members/" + member._identity, @@ -139,7 +139,7 @@ class Team(GithubObject.GithubObject): ) def remove_from_repos(self, repo): - assert isinstance(repo, Repository.Repository), repo + assert isinstance(repo, github.Repository.Repository), repo headers, data = self._requester.requestAndCheck( "DELETE", self.url + "/repos/" + repo._identity, @@ -152,12 +152,12 @@ class Team(GithubObject.GithubObject): return self.id def _initAttributes(self): - self._id = GithubObject.NotSet - self._members_count = GithubObject.NotSet - self._name = GithubObject.NotSet - self._permission = GithubObject.NotSet - self._repos_count = GithubObject.NotSet - self._url = GithubObject.NotSet + self._id = github.GithubObject.NotSet + self._members_count = github.GithubObject.NotSet + self._name = github.GithubObject.NotSet + self._permission = github.GithubObject.NotSet + self._repos_count = github.GithubObject.NotSet + self._url = github.GithubObject.NotSet def _useAttributes(self, attributes): if "id" in attributes: # pragma no branch diff --git a/github/UserKey.py b/github/UserKey.py index 53ca3841..4fe342ce 100644 --- a/github/UserKey.py +++ b/github/UserKey.py @@ -13,10 +13,10 @@ # You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see . -import GithubObject +import github.GithubObject -class UserKey(GithubObject.GithubObject): +class UserKey(github.GithubObject.GithubObject): @property def id(self): self._completeIfNotSet(self._id) @@ -50,13 +50,13 @@ class UserKey(GithubObject.GithubObject): None ) - def edit(self, title=GithubObject.NotSet, key=GithubObject.NotSet): - assert title is GithubObject.NotSet or isinstance(title, (str, unicode)), title - assert key is GithubObject.NotSet or isinstance(key, (str, unicode)), key + def edit(self, title=github.GithubObject.NotSet, key=github.GithubObject.NotSet): + assert title is github.GithubObject.NotSet or isinstance(title, (str, unicode)), title + assert key is github.GithubObject.NotSet or isinstance(key, (str, unicode)), key post_parameters = dict() - if title is not GithubObject.NotSet: + if title is not github.GithubObject.NotSet: post_parameters["title"] = title - if key is not GithubObject.NotSet: + if key is not github.GithubObject.NotSet: post_parameters["key"] = key headers, data = self._requester.requestAndCheck( "PATCH", @@ -67,11 +67,11 @@ class UserKey(GithubObject.GithubObject): self._useAttributes(data) def _initAttributes(self): - self._id = GithubObject.NotSet - self._key = GithubObject.NotSet - self._title = GithubObject.NotSet - self._url = GithubObject.NotSet - self._verified = GithubObject.NotSet + self._id = github.GithubObject.NotSet + self._key = github.GithubObject.NotSet + self._title = github.GithubObject.NotSet + self._url = github.GithubObject.NotSet + self._verified = github.GithubObject.NotSet def _useAttributes(self, attributes): if "id" in attributes: # pragma no branch From d8e50c7937db9a1deb35bd031ece37c73283b3a9 Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Wed, 21 Nov 2012 20:30:35 +0100 Subject: [PATCH 48/62] Small fixes => tests pass after 2to3 --- github/Requester.py | 2 +- github/tests/ContentFile.py | 2 +- github/tests/Exceptions.py | 9 +++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/github/Requester.py b/github/Requester.py index 26d28f51..75bc918e 100644 --- a/github/Requester.py +++ b/github/Requester.py @@ -42,7 +42,7 @@ class Requester: def __init__(self, login_or_token, password, base_url, timeout, client_id, client_secret, user_agent): if password is not None: login = login_or_token - self.__authorizationHeader = "Basic " + base64.b64encode(login + ":" + password).replace('\n', '') + self.__authorizationHeader = "Basic " + str(base64.b64encode(bytearray(login + ":" + password, "utf-8"))).replace('\n', '') elif login_or_token is not None: token = login_or_token self.__authorizationHeader = "token " + token diff --git a/github/tests/ContentFile.py b/github/tests/ContentFile.py index 21b85ec0..0d2ae6a7 100644 --- a/github/tests/ContentFile.py +++ b/github/tests/ContentFile.py @@ -32,5 +32,5 @@ class ContentFile(Framework.TestCase): self.assertEqual(self.file.size, 7531) self.assertEqual(self.file.name, "ReadMe.md") self.assertEqual(self.file.path, "ReadMe.md") - self.assertEqual(len(base64.b64decode(self.file.content)), 7531) + self.assertEqual(len(base64.b64decode(bytearray(self.file.content, "utf-8"))), 7531) self.assertEqual(self.file.sha, "5628799a7d517a4aaa0c1a7004d07569cd154df0") diff --git a/github/tests/Exceptions.py b/github/tests/Exceptions.py index c1a51f12..ddbdbd1d 100644 --- a/github/tests/Exceptions.py +++ b/github/tests/Exceptions.py @@ -19,6 +19,7 @@ import sys import Framework atLeastPython26 = sys.hexversion >= 0x02060000 +atMostPython2 = sys.hexversion < 0x03000000 class Exceptions(Framework.TestCase): # To stay compatible with Python 2.6, we do not use self.assertRaises with only one argument @@ -43,7 +44,7 @@ class Exceptions(Framework.TestCase): # To stay compatible with Python 2.6, we "message": "Validation Failed" } ) - if atLeastPython26: + if atLeastPython26 and atMostPython2: self.assertEqual(str(exception), "422 {u\'message\': u\'Validation Failed\', u\'errors\': [{u\'field\': u\'key\', u\'message\': u\"key is invalid. It must begin with \'ssh-rsa\' or \'ssh-dss\'. Check that you\'re copying the public half of the key\", u\'code\': u\'custom\', u\'resource\': u\'PublicKey\'}]}") else: self.assertEqual(str(exception), "422 {\'message\': \'Validation Failed\', \'errors\': [{\'field\': \'key\', \'message\': \"key is invalid. It must begin with \'ssh-rsa\' or \'ssh-dss\'. Check that you\'re copying the public half of the key\", \'code\': \'custom\', \'resource\': \'PublicKey\'}]}") # pragma no cover @@ -57,7 +58,7 @@ class Exceptions(Framework.TestCase): # To stay compatible with Python 2.6, we raised = True self.assertEqual(exception.status, 404) self.assertEqual(exception.data, {"message": "Not Found"}) - if atLeastPython26: + if atLeastPython26 and atMostPython2: self.assertEqual(str(exception), "404 {u'message': u'Not Found'}") else: self.assertEqual(str(exception), "404 {'message': 'Not Found'}") # pragma no cover @@ -71,7 +72,7 @@ class Exceptions(Framework.TestCase): # To stay compatible with Python 2.6, we raised = True self.assertEqual(exception.status, 404) self.assertEqual(exception.data, {"message": "Not Found"}) - if atLeastPython26: + if atLeastPython26 and atMostPython2: self.assertEqual(str(exception), "404 {u'message': u'Not Found'}") else: self.assertEqual(str(exception), "404 {'message': 'Not Found'}") # pragma no cover @@ -85,7 +86,7 @@ class Exceptions(Framework.TestCase): # To stay compatible with Python 2.6, we raised = True self.assertEqual(exception.status, 401) self.assertEqual(exception.data, {"message": "Bad credentials"}) - if atLeastPython26: + if atLeastPython26 and atMostPython2: self.assertEqual(str(exception), "401 {u'message': u'Bad credentials'}") else: self.assertEqual(str(exception), "401 {'message': 'Bad credentials'}") # pragma no cover From 381a479d6ab700947c3cb978fc26027fd6b76a9e Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Wed, 21 Nov 2012 20:45:45 +0100 Subject: [PATCH 49/62] Restore Python 2.5 and 2.6 --- github/Requester.py | 6 +++++- github/tests/ContentFile.py | 7 ++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/github/Requester.py b/github/Requester.py index 75bc918e..3ac6efde 100644 --- a/github/Requester.py +++ b/github/Requester.py @@ -21,6 +21,7 @@ import urlparse import sys atLeastPython26 = sys.hexversion >= 0x02060000 +atLeastPython3 = sys.hexversion >= 0x03000000 if atLeastPython26: import json @@ -42,7 +43,10 @@ class Requester: def __init__(self, login_or_token, password, base_url, timeout, client_id, client_secret, user_agent): if password is not None: login = login_or_token - self.__authorizationHeader = "Basic " + str(base64.b64encode(bytearray(login + ":" + password, "utf-8"))).replace('\n', '') + if atLeastPython3: + self.__authorizationHeader = "Basic " + str(base64.b64encode(bytearray(login + ":" + password, "utf-8"))).replace('\n', '') # pragma no cover + else: + self.__authorizationHeader = "Basic " + base64.b64encode(login + ":" + password).replace('\n', '') elif login_or_token is not None: token = login_or_token self.__authorizationHeader = "token " + token diff --git a/github/tests/ContentFile.py b/github/tests/ContentFile.py index 0d2ae6a7..279c5816 100644 --- a/github/tests/ContentFile.py +++ b/github/tests/ContentFile.py @@ -14,12 +14,14 @@ # You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see . import base64 +import sys import Framework import github import datetime +atLeastPython3 = sys.hexversion >= 0x03000000 class ContentFile(Framework.TestCase): def setUp(self): @@ -32,5 +34,8 @@ class ContentFile(Framework.TestCase): self.assertEqual(self.file.size, 7531) self.assertEqual(self.file.name, "ReadMe.md") self.assertEqual(self.file.path, "ReadMe.md") - self.assertEqual(len(base64.b64decode(bytearray(self.file.content, "utf-8"))), 7531) + if atLeastPython3: + self.assertEqual(len(base64.b64decode(bytearray(self.file.content, "utf-8"))), 7531) # pragma no cover + else: + self.assertEqual(len(base64.b64decode(self.file.content)), 7531) self.assertEqual(self.file.sha, "5628799a7d517a4aaa0c1a7004d07569cd154df0") From 90c710b77b6541dec51dcf606da3e0478a22b384 Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Wed, 21 Nov 2012 21:00:17 +0100 Subject: [PATCH 50/62] Enable Python 3 in Travis --- .travis.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index ac1f0ce8..8adb333b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,5 +3,10 @@ python: - "2.7" - "2.6" - "2.5" -install: if [ "$(python --version 2>&1)" == "Python 2.5.6" ]; then pip install -r python25-requirements.txt --use-mirrors; fi; if [ "$(python --version 2>&1)" == "Python 2.6.8" ]; then pip install -r python26-requirements.txt --use-mirrors; fi -script: python ./setup.py test + - "3.2" +install: + - if [ $TRAVIS_PYTHON_VERSION == '2.5' ]; then pip install -r python25-requirements.txt --use-mirrors; fi + - if [ $TRAVIS_PYTHON_VERSION == '2.6' ]; then pip install -r python26-requirements.txt --use-mirrors; fi +script: + - if [ $TRAVIS_PYTHON_VERSION == '3.2' ]; then 2to3 . --write --no-diffs --nobackups; fi + - python ./setup.py test From 3c34837d75e4bc624c65b19b679717b810411866 Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Wed, 21 Nov 2012 21:18:59 +0100 Subject: [PATCH 51/62] Fixes for Python 3: setup.py install will call 2to3 We temporary loose coverage measurement... again! --- .gitignore | 4 ++- .travis.yml | 5 +-- github/tests/Gist.py | 70 ++++++++++++++++++------------------- github/tests/GistComment.py | 16 ++++----- setup.py | 39 ++++----------------- 5 files changed, 56 insertions(+), 78 deletions(-) diff --git a/.gitignore b/.gitignore index 4b032645..681fb61f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ *.pyc GithubCredentials.py -/dist +/dist/ +/build/ /MANIFEST +/PyGithub.egg-info/ \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 8adb333b..5386b3c2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,7 @@ python: install: - if [ $TRAVIS_PYTHON_VERSION == '2.5' ]; then pip install -r python25-requirements.txt --use-mirrors; fi - if [ $TRAVIS_PYTHON_VERSION == '2.6' ]; then pip install -r python26-requirements.txt --use-mirrors; fi + - python setup.py install script: - - if [ $TRAVIS_PYTHON_VERSION == '3.2' ]; then 2to3 . --write --no-diffs --nobackups; fi - - python ./setup.py test + - cd # Run installed code (maybe 2to3ed), not code in current directory (always for python2) + - python -m github.tests diff --git a/github/tests/Gist.py b/github/tests/Gist.py index 7bf85017..7e72311f 100644 --- a/github/tests/Gist.py +++ b/github/tests/Gist.py @@ -25,47 +25,47 @@ class Gist(Framework.TestCase): self.gist = self.g.get_gist("2729810") def testAttributes(self): - self.assertEquals(self.gist.comments, 0) - self.assertEquals(self.gist.created_at, datetime.datetime(2012, 2, 29, 16, 47, 12)) - self.assertEquals(self.gist.description, "How to error 500 Github API v3, as requested by Rick (GitHub Staff)") - self.assertEquals(self.gist.files.keys(), ["fail_github.py"]) - self.assertEquals(self.gist.files["fail_github.py"].size, 1636) - self.assertEquals(self.gist.files["fail_github.py"].filename, "fail_github.py") - self.assertEquals(self.gist.files["fail_github.py"].language, "Python") - self.assertEquals(self.gist.files["fail_github.py"].content, 'import httplib\nimport base64\nimport json\n\nlogin = ""\npassword = ""\norgName = ""\nrepoName = "FailGithubApi"\n\ndef doRequest( verb, url, input ):\n input = json.dumps( input )\n cnx = httplib.HTTPSConnection( "api.github.com", strict = True )\n cnx.request( verb, url, input, { "Authorization" : "Basic " + base64.b64encode( login + ":" + password ).replace( \'\\n\', \'\' ) } )\n response = cnx.getresponse()\n status = response.status\n output = response.read()\n cnx.close()\n print verb, url, input, "=>", status, output\n print\n if status < 200 or status >= 300:\n exit( 1 )\n return json.loads( output )\n\n# Create a repo\ndoRequest( "POST", "/user/repos", { "name": repoName } )\n\n# Create a blob, a tree, a commit and the master branch\nb = doRequest(\n "POST", "/repos/%s/%s/git/blobs" % ( login, repoName ),\n { "content": "Content of the blob", "encoding": "latin1" }\n)\nt = doRequest(\n "POST", "/repos/%s/%s/git/trees" % ( login, repoName ),\n { "tree" : [ { "path": "foo.bar", "type": "blob", "mode": "100644", "sha": b["sha"] } ] }\n)\nc = doRequest(\n "POST", "/repos/%s/%s/git/commits" % ( login, repoName ),\n { "parents": [], "message": "Message of the commit", "tree": t["sha"] }\n)\ndoRequest(\n "POST", "/repos/%s/%s/git/refs" % ( login, repoName ),\n { "ref": "refs/heads/master", "sha": c["sha"] }\n)\n\n# Fork the repo\ndoRequest( "POST", "/repos/%s/%s/forks?org=%s" % ( login, repoName, orgName ), None )\n\n# Create a new blob => BOOM error 500\ndoRequest(\n "POST", "/repos/%s/%s/git/blobs" % ( orgName, repoName ),\n { "content": "Content of the new blob", "encoding": "latin1" }\n)\n') - self.assertEquals(self.gist.files["fail_github.py"].raw_url, "https://gist.github.com/raw/2729810/2fb3aa84e0efa50dc0f4c18b5df5b7b9ab27076b/fail_github.py") - self.assertEquals(self.gist.forks, []) - self.assertEquals(self.gist.git_pull_url, "git://gist.github.com/2729810.git") - self.assertEquals(self.gist.git_push_url, "git@gist.github.com:2729810.git") - self.assertEquals(len(self.gist.history), 1) - self.assertEquals(self.gist.history[0].change_status.additions, 52) - self.assertEquals(self.gist.history[0].change_status.deletions, 0) - self.assertEquals(self.gist.history[0].change_status.total, 52) - self.assertEquals(self.gist.history[0].committed_at, datetime.datetime(2012, 2, 29, 16, 47, 12)) - self.assertEquals(self.gist.history[0].url, "https://api.github.com/gists/2729810/a40de483e42ba33bda308371c0ef8383db73be9e") - self.assertEquals(self.gist.history[0].user.login, "jacquev6") - self.assertEquals(self.gist.history[0].version, "a40de483e42ba33bda308371c0ef8383db73be9e") - self.assertEquals(self.gist.html_url, "https://gist.github.com/2729810") - self.assertEquals(self.gist.id, "2729810") - self.assertEquals(self.gist.public, True) - self.assertEquals(self.gist.updated_at, datetime.datetime(2012, 2, 29, 16, 47, 12)) - self.assertEquals(self.gist.url, "https://api.github.com/gists/2729810") - self.assertEquals(self.gist.user.login, "jacquev6") + self.assertEqual(self.gist.comments, 0) + self.assertEqual(self.gist.created_at, datetime.datetime(2012, 2, 29, 16, 47, 12)) + self.assertEqual(self.gist.description, "How to error 500 Github API v3, as requested by Rick (GitHub Staff)") + self.assertEqual(self.gist.files.keys(), ["fail_github.py"]) + self.assertEqual(self.gist.files["fail_github.py"].size, 1636) + self.assertEqual(self.gist.files["fail_github.py"].filename, "fail_github.py") + self.assertEqual(self.gist.files["fail_github.py"].language, "Python") + self.assertEqual(self.gist.files["fail_github.py"].content, 'import httplib\nimport base64\nimport json\n\nlogin = ""\npassword = ""\norgName = ""\nrepoName = "FailGithubApi"\n\ndef doRequest( verb, url, input ):\n input = json.dumps( input )\n cnx = httplib.HTTPSConnection( "api.github.com", strict = True )\n cnx.request( verb, url, input, { "Authorization" : "Basic " + base64.b64encode( login + ":" + password ).replace( \'\\n\', \'\' ) } )\n response = cnx.getresponse()\n status = response.status\n output = response.read()\n cnx.close()\n print verb, url, input, "=>", status, output\n print\n if status < 200 or status >= 300:\n exit( 1 )\n return json.loads( output )\n\n# Create a repo\ndoRequest( "POST", "/user/repos", { "name": repoName } )\n\n# Create a blob, a tree, a commit and the master branch\nb = doRequest(\n "POST", "/repos/%s/%s/git/blobs" % ( login, repoName ),\n { "content": "Content of the blob", "encoding": "latin1" }\n)\nt = doRequest(\n "POST", "/repos/%s/%s/git/trees" % ( login, repoName ),\n { "tree" : [ { "path": "foo.bar", "type": "blob", "mode": "100644", "sha": b["sha"] } ] }\n)\nc = doRequest(\n "POST", "/repos/%s/%s/git/commits" % ( login, repoName ),\n { "parents": [], "message": "Message of the commit", "tree": t["sha"] }\n)\ndoRequest(\n "POST", "/repos/%s/%s/git/refs" % ( login, repoName ),\n { "ref": "refs/heads/master", "sha": c["sha"] }\n)\n\n# Fork the repo\ndoRequest( "POST", "/repos/%s/%s/forks?org=%s" % ( login, repoName, orgName ), None )\n\n# Create a new blob => BOOM error 500\ndoRequest(\n "POST", "/repos/%s/%s/git/blobs" % ( orgName, repoName ),\n { "content": "Content of the new blob", "encoding": "latin1" }\n)\n') + self.assertEqual(self.gist.files["fail_github.py"].raw_url, "https://gist.github.com/raw/2729810/2fb3aa84e0efa50dc0f4c18b5df5b7b9ab27076b/fail_github.py") + self.assertEqual(self.gist.forks, []) + self.assertEqual(self.gist.git_pull_url, "git://gist.github.com/2729810.git") + self.assertEqual(self.gist.git_push_url, "git@gist.github.com:2729810.git") + self.assertEqual(len(self.gist.history), 1) + self.assertEqual(self.gist.history[0].change_status.additions, 52) + self.assertEqual(self.gist.history[0].change_status.deletions, 0) + self.assertEqual(self.gist.history[0].change_status.total, 52) + self.assertEqual(self.gist.history[0].committed_at, datetime.datetime(2012, 2, 29, 16, 47, 12)) + self.assertEqual(self.gist.history[0].url, "https://api.github.com/gists/2729810/a40de483e42ba33bda308371c0ef8383db73be9e") + self.assertEqual(self.gist.history[0].user.login, "jacquev6") + self.assertEqual(self.gist.history[0].version, "a40de483e42ba33bda308371c0ef8383db73be9e") + self.assertEqual(self.gist.html_url, "https://gist.github.com/2729810") + self.assertEqual(self.gist.id, "2729810") + self.assertEqual(self.gist.public, True) + self.assertEqual(self.gist.updated_at, datetime.datetime(2012, 2, 29, 16, 47, 12)) + self.assertEqual(self.gist.url, "https://api.github.com/gists/2729810") + self.assertEqual(self.gist.user.login, "jacquev6") def testEditWithoutParameters(self): self.gist.edit() - self.assertEquals(self.gist.description, "Gist created by PyGithub") - self.assertEquals(self.gist.updated_at, datetime.datetime(2012, 5, 19, 7, 0, 58)) + self.assertEqual(self.gist.description, "Gist created by PyGithub") + self.assertEqual(self.gist.updated_at, datetime.datetime(2012, 5, 19, 7, 0, 58)) def testEditWithAllParameters(self): self.gist.edit("Description edited by PyGithub", {"barbaz.txt": github.InputFileContent("File also created by PyGithub")}) - self.assertEquals(self.gist.description, "Description edited by PyGithub") - self.assertEquals(self.gist.updated_at, datetime.datetime(2012, 5, 19, 7, 6, 10)) - self.assertEquals(self.gist.files.keys(), ["foobar.txt", "barbaz.txt"]) + self.assertEqual(self.gist.description, "Description edited by PyGithub") + self.assertEqual(self.gist.updated_at, datetime.datetime(2012, 5, 19, 7, 6, 10)) + self.assertEqual(self.gist.files.keys(), ["foobar.txt", "barbaz.txt"]) def testCreateComment(self): comment = self.gist.create_comment("Comment created by PyGithub") - self.assertEquals(comment.id, 323629) + self.assertEqual(comment.id, 323629) def testGetComments(self): self.assertListKeyEqual(self.gist.get_comments(), lambda c: c.id, [323637]) @@ -80,10 +80,10 @@ class Gist(Framework.TestCase): def testFork(self): gist = self.g.get_gist("2729818") # Random gist myGist = gist.create_fork() - self.assertEquals(myGist.id, "2729865") - self.assertEquals(myGist.fork_of, None) # WTF + self.assertEqual(myGist.id, "2729865") + self.assertEqual(myGist.fork_of, None) # WTF sameGist = self.g.get_gist("2729865") - self.assertEquals(sameGist.fork_of.id, "2729818") + self.assertEqual(sameGist.fork_of.id, "2729818") def testDelete(self): self.gist.delete() diff --git a/github/tests/GistComment.py b/github/tests/GistComment.py index 9734fa56..79fe1a1d 100644 --- a/github/tests/GistComment.py +++ b/github/tests/GistComment.py @@ -24,17 +24,17 @@ class GistComment(Framework.TestCase): self.comment = self.g.get_gist("2729810").get_comment(323629) def testAttributes(self): - self.assertEquals(self.comment.body, "Comment created by PyGithub") - self.assertEquals(self.comment.created_at, datetime.datetime(2012, 5, 19, 7, 7, 57)) - self.assertEquals(self.comment.id, 323629) - self.assertEquals(self.comment.updated_at, datetime.datetime(2012, 5, 19, 7, 7, 57)) - self.assertEquals(self.comment.url, "https://api.github.com/gists/2729810/comments/323629") - self.assertEquals(self.comment.user.login, "jacquev6") + self.assertEqual(self.comment.body, "Comment created by PyGithub") + self.assertEqual(self.comment.created_at, datetime.datetime(2012, 5, 19, 7, 7, 57)) + self.assertEqual(self.comment.id, 323629) + self.assertEqual(self.comment.updated_at, datetime.datetime(2012, 5, 19, 7, 7, 57)) + self.assertEqual(self.comment.url, "https://api.github.com/gists/2729810/comments/323629") + self.assertEqual(self.comment.user.login, "jacquev6") def testEdit(self): self.comment.edit("Comment edited by PyGithub") - self.assertEquals(self.comment.body, "Comment edited by PyGithub") - self.assertEquals(self.comment.updated_at, datetime.datetime(2012, 5, 19, 7, 12, 32)) + self.assertEqual(self.comment.body, "Comment edited by PyGithub") + self.assertEqual(self.comment.updated_at, datetime.datetime(2012, 5, 19, 7, 12, 32)) def testDelete(self): self.comment.delete() diff --git a/setup.py b/setup.py index e645e5d3..4bdd08c1 100755 --- a/setup.py +++ b/setup.py @@ -17,39 +17,14 @@ from distutils.core import setup, Command import textwrap import sys -import glob -class test( Command ): - user_options = [] +atLeastPython3 = sys.hexversion >= 0x03000000 - def initialize_options( self ): - pass - - def finalize_options( self ): - pass - - def run( self ): - try: - import coverage - analyseCoverage = True - except ImportError: - print "Unable to import coverage. Running tests without coverage analysis" - analyseCoverage = False - if analyseCoverage: - cov = coverage.coverage(branch=True) - cov.start() - - import github.tests - ok = github.tests.run().wasSuccessful() - if analyseCoverage: - cov.stop() - for f in glob.glob( "github/*.py" ): - ok = ok and len( cov.analysis2( f )[ 3 ] ) == 0 - cov.report(file=sys.stdout, include="github/*") - if ok: - exit( 0 ) - else: - exit( 1 ) +if atLeastPython3: + import setuptools + kwds = { "use_2to3": True } +else: + kwds = dict() setup( name = "PyGithub", @@ -102,5 +77,5 @@ setup( "Programming Language :: Python", "Topic :: Software Development", ], - cmdclass = { "test": test }, + **kwds ) From d0881d7fd8d40180883f680c3b5636cc03f9f236 Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Wed, 21 Nov 2012 21:23:52 +0100 Subject: [PATCH 52/62] Restore Python 2.5 and 2.6 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 5386b3c2..d78eb8ba 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,4 +10,4 @@ install: - python setup.py install script: - cd # Run installed code (maybe 2to3ed), not code in current directory (always for python2) - - python -m github.tests + - python -m github.tests.__main__ # __main__ is for Python 2.5 and 2.6 From 39562d4eaa2b7f1afca161bf7b01a4b34cffb2f6 Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Wed, 21 Nov 2012 21:30:29 +0100 Subject: [PATCH 53/62] Add Python 3.1 --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index d78eb8ba..02f11df2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,7 @@ python: - "2.7" - "2.6" - "2.5" + - "3.1" - "3.2" install: - if [ $TRAVIS_PYTHON_VERSION == '2.5' ]; then pip install -r python25-requirements.txt --use-mirrors; fi From 87c92bdee506cfa3e9af59da2822a3512c8f7434 Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Wed, 21 Nov 2012 21:37:57 +0100 Subject: [PATCH 54/62] Restore Python 2.5 --- github/tests/__main__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/github/tests/__main__.py b/github/tests/__main__.py index 5ab5ad74..22ed9fc6 100644 --- a/github/tests/__main__.py +++ b/github/tests/__main__.py @@ -16,16 +16,16 @@ import sys import unittest -import Framework -import AllTests +import github.tests.Framework +import github.tests.AllTests def main(argv): if "--record" in argv: - Framework.activateRecordMode() + github.tests.Framework.activateRecordMode() argv = [arg for arg in argv if arg != "--record"] - unittest.main(module=AllTests, argv=argv) + unittest.main(module=github.tests.AllTests, argv=argv) if __name__ == "__main__": From 1804d9a295e70ce0d12b846e3fe0212982a3efa4 Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Wed, 21 Nov 2012 21:49:15 +0100 Subject: [PATCH 55/62] pep8 + readme --- ReadMe.md | 5 +++++ github/Requester.py | 2 +- github/tests/ContentFile.py | 3 ++- publish.sh | 2 +- setup.py | 26 +++++++++++++------------- 5 files changed, 22 insertions(+), 16 deletions(-) diff --git a/ReadMe.md b/ReadMe.md index db758ce1..1344507c 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -13,6 +13,11 @@ What's new? [![Build Status](https://secure.travis-ci.org/jacquev6/PyGithub.png)](http://travis-ci.org/jacquev6/PyGithub) +Next version +------------ + +* Major improvement: support Python 3! PyGithub is automaticaly tested on [Travis](http://travis-ci.org/jacquev6/PyGithub) with versions 2.5, 2.6, 2.7, 3.1 and 3.2 of Python + [Version 1.9.1](https://github.com/jacquev6/PyGithub/issues?milestone=17&state=closed) (November 20th, 2012) ------------------------------------------------------------------------------------------------------------ diff --git a/github/Requester.py b/github/Requester.py index 3ac6efde..2a7f2c0c 100644 --- a/github/Requester.py +++ b/github/Requester.py @@ -44,7 +44,7 @@ class Requester: if password is not None: login = login_or_token if atLeastPython3: - self.__authorizationHeader = "Basic " + str(base64.b64encode(bytearray(login + ":" + password, "utf-8"))).replace('\n', '') # pragma no cover + self.__authorizationHeader = "Basic " + str(base64.b64encode(bytearray(login + ":" + password, "utf-8"))).replace('\n', '') # pragma no cover else: self.__authorizationHeader = "Basic " + base64.b64encode(login + ":" + password).replace('\n', '') elif login_or_token is not None: diff --git a/github/tests/ContentFile.py b/github/tests/ContentFile.py index 279c5816..04a4933a 100644 --- a/github/tests/ContentFile.py +++ b/github/tests/ContentFile.py @@ -23,6 +23,7 @@ import datetime atLeastPython3 = sys.hexversion >= 0x03000000 + class ContentFile(Framework.TestCase): def setUp(self): Framework.TestCase.setUp(self) @@ -35,7 +36,7 @@ class ContentFile(Framework.TestCase): self.assertEqual(self.file.name, "ReadMe.md") self.assertEqual(self.file.path, "ReadMe.md") if atLeastPython3: - self.assertEqual(len(base64.b64decode(bytearray(self.file.content, "utf-8"))), 7531) # pragma no cover + self.assertEqual(len(base64.b64decode(bytearray(self.file.content, "utf-8"))), 7531) # pragma no cover else: self.assertEqual(len(base64.b64decode(self.file.content)), 7531) self.assertEqual(self.file.sha, "5628799a7d517a4aaa0c1a7004d07569cd154df0") diff --git a/publish.sh b/publish.sh index db2d94d5..131eb67c 100755 --- a/publish.sh +++ b/publish.sh @@ -1,7 +1,7 @@ #!/bin/sh # -*- coding: utf-8 -*- -pep8 --ignore=E501 github # pip install pep8 +pep8 --ignore=E501 github *.py # pip install pep8 python setup.py test previousVersion=$( grep 'version =' setup.py | sed 's/.*version = \"\(.*\)\".*/\1/' ) diff --git a/setup.py b/setup.py index 4bdd08c1..5807715d 100755 --- a/setup.py +++ b/setup.py @@ -22,18 +22,18 @@ atLeastPython3 = sys.hexversion >= 0x03000000 if atLeastPython3: import setuptools - kwds = { "use_2to3": True } + kwds = {"use_2to3": True} else: kwds = dict() setup( - name = "PyGithub", - version = "1.9.1", - description = "Use the full Github API v3", - author = "Vincent Jacques", - author_email = "vincent@vincent-jacques.net", - url = "http://vincent-jacques.net/PyGithub", - long_description = textwrap.dedent( """\ + name="PyGithub", + version="1.9.1", + description="Use the full Github API v3", + author="Vincent Jacques", + author_email="vincent@vincent-jacques.net", + url="http://vincent-jacques.net/PyGithub", + long_description=textwrap.dedent("""\ Tutorial ======== @@ -60,15 +60,15 @@ setup( Reference documentation ======================= - See http://vincent-jacques.net/PyGithub""" ), - packages = [ + See http://vincent-jacques.net/PyGithub"""), + packages=[ "github", "github.tests", ], - package_data = { - "github": [ "ReadMe.md", "COPYING*", "doc/*.md", "tests/ReplayData/*.txt" ] + package_data={ + "github": ["ReadMe.md", "COPYING*", "doc/*.md", "tests/ReplayData/*.txt"] }, - classifiers = [ + classifiers=[ "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "Intended Audience :: Developers", From d7b8ad3fbbce5756508b7caa84b7d33acb7c7ba0 Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Wed, 21 Nov 2012 22:03:25 +0100 Subject: [PATCH 56/62] Reference issue #93 From 812c99a622f7fff7f52c4c25a0d2abe4d095737d Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Thu, 22 Nov 2012 19:42:51 +0100 Subject: [PATCH 57/62] Further simplify --- .travis.yml | 4 +--- setup.py | 10 +++------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index 02f11df2..d1258c3e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,5 @@ python: install: - if [ $TRAVIS_PYTHON_VERSION == '2.5' ]; then pip install -r python25-requirements.txt --use-mirrors; fi - if [ $TRAVIS_PYTHON_VERSION == '2.6' ]; then pip install -r python26-requirements.txt --use-mirrors; fi - - python setup.py install script: - - cd # Run installed code (maybe 2to3ed), not code in current directory (always for python2) - - python -m github.tests.__main__ # __main__ is for Python 2.5 and 2.6 + - python setup.py test diff --git a/setup.py b/setup.py index 5807715d..be198660 100755 --- a/setup.py +++ b/setup.py @@ -14,17 +14,12 @@ # You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see . -from distutils.core import setup, Command +from setuptools import setup, Command import textwrap import sys atLeastPython3 = sys.hexversion >= 0x03000000 -if atLeastPython3: - import setuptools - kwds = {"use_2to3": True} -else: - kwds = dict() setup( name="PyGithub", @@ -77,5 +72,6 @@ setup( "Programming Language :: Python", "Topic :: Software Development", ], - **kwds + test_suite="github.tests.AllTests", + use_2to3=atLeastPython3 ) From 3026eb708fa0a6c669d3829e685663b8a161488b Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Thu, 22 Nov 2012 19:49:17 +0100 Subject: [PATCH 58/62] Add the Python 3 classifier --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index be198660..0d8eea78 100755 --- a/setup.py +++ b/setup.py @@ -70,6 +70,7 @@ setup( "License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)", "Operating System :: OS Independent", "Programming Language :: Python", + "Programming Language :: Python :: 3", "Topic :: Software Development", ], test_suite="github.tests.AllTests", From be37b8a7f3a68631c32672dcd84d9eba27438ee6 Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Thu, 22 Nov 2012 20:06:01 +0100 Subject: [PATCH 59/62] Measure coverage simply in publish.sh --- .gitignore | 3 ++- publish.sh | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 681fb61f..55cb5a84 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ GithubCredentials.py /dist/ /build/ /MANIFEST -/PyGithub.egg-info/ \ No newline at end of file +/PyGithub.egg-info/ +/.coverage diff --git a/publish.sh b/publish.sh index 131eb67c..f3adf2bd 100755 --- a/publish.sh +++ b/publish.sh @@ -2,7 +2,11 @@ # -*- coding: utf-8 -*- pep8 --ignore=E501 github *.py # pip install pep8 -python setup.py test + +python3 setup.py test + +coverage run --branch "--include=github/*.py" "--omit=github/tests/*.py" setup.py test +coverage report --show-missing previousVersion=$( grep 'version =' setup.py | sed 's/.*version = \"\(.*\)\".*/\1/' ) echo "Next version number? (previous: '$previousVersion')" From 2a653d081c39ac2cbf6031b9b965880eb54214ae Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Thu, 22 Nov 2012 21:07:19 +0100 Subject: [PATCH 60/62] Simplify --- .travis.yml | 1 - github/tests/__init__.py | 18 ------------------ publish.sh | 9 +++++---- python25-requirements.txt | 1 - python26-requirements.txt | 1 - setup.py | 9 +++------ 6 files changed, 8 insertions(+), 31 deletions(-) delete mode 100644 python26-requirements.txt diff --git a/.travis.yml b/.travis.yml index d1258c3e..c2b4ea26 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,5 @@ python: - "3.2" install: - if [ $TRAVIS_PYTHON_VERSION == '2.5' ]; then pip install -r python25-requirements.txt --use-mirrors; fi - - if [ $TRAVIS_PYTHON_VERSION == '2.6' ]; then pip install -r python26-requirements.txt --use-mirrors; fi script: - python setup.py test diff --git a/github/tests/__init__.py b/github/tests/__init__.py index cf725e9e..b203fa76 100644 --- a/github/tests/__init__.py +++ b/github/tests/__init__.py @@ -12,21 +12,3 @@ # 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 sys - -atLeastPython27 = sys.hexversion >= 0x02070000 - -if atLeastPython27: - import unittest -else: # pragma no cover - import unittest2 as unittest # pragma no cover - -import AllTests - - -def run(): - testLoader = unittest.loader.TestLoader() - testRunner = unittest.runner.TextTestRunner(verbosity=1) - test = testLoader.loadTestsFromModule(AllTests) - return testRunner.run(test) diff --git a/publish.sh b/publish.sh index f3adf2bd..e95d06ac 100755 --- a/publish.sh +++ b/publish.sh @@ -3,15 +3,16 @@ pep8 --ignore=E501 github *.py # pip install pep8 -python3 setup.py test +python -3 setup.py test --quiet +python3 setup.py test --quiet -coverage run --branch "--include=github/*.py" "--omit=github/tests/*.py" setup.py test +coverage run --branch "--include=build/lib.linux-x86_64-2.7/github/*.py" "--omit=build/lib.linux-x86_64-2.7/github/tests/*.py" setup.py test --quiet coverage report --show-missing -previousVersion=$( grep 'version =' setup.py | sed 's/.*version = \"\(.*\)\".*/\1/' ) +previousVersion=$( grep 'version=' setup.py | sed 's/.*version=\"\(.*\)\".*/\1/' ) echo "Next version number? (previous: '$previousVersion')" read version -sed -i -b "s/version = .*/version = \"$version\",/" setup.py +sed -i -b "s/version=.*/version=\"$version\",/" setup.py git add setup.py git log v$previousVersion.. --oneline diff --git a/python25-requirements.txt b/python25-requirements.txt index 609f9122..7693e645 100644 --- a/python25-requirements.txt +++ b/python25-requirements.txt @@ -1,2 +1 @@ simplejson -unittest2 diff --git a/python26-requirements.txt b/python26-requirements.txt deleted file mode 100644 index 9a23970d..00000000 --- a/python26-requirements.txt +++ /dev/null @@ -1 +0,0 @@ -unittest2 diff --git a/setup.py b/setup.py index 0d8eea78..e2743eab 100755 --- a/setup.py +++ b/setup.py @@ -14,14 +14,11 @@ # You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see . -from setuptools import setup, Command +import setuptools import textwrap -import sys - -atLeastPython3 = sys.hexversion >= 0x03000000 -setup( +setuptools.setup( name="PyGithub", version="1.9.1", description="Use the full Github API v3", @@ -74,5 +71,5 @@ setup( "Topic :: Software Development", ], test_suite="github.tests.AllTests", - use_2to3=atLeastPython3 + use_2to3=True ) From 88cc181d619dcd743c34d380d90f1808b7fd0a76 Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Thu, 22 Nov 2012 21:11:02 +0100 Subject: [PATCH 61/62] Contributing: pull requests on develop --- Contributing.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Contributing.md b/Contributing.md index efbb5203..73004a5a 100644 --- a/Contributing.md +++ b/Contributing.md @@ -9,10 +9,12 @@ It is even better if you provide the debug logs associated with your issue. Enable them with `github.enable_console_debug_logging()` and copy them in the body of the issue. Warning, you may want to remove some private information (authentication information is removed, but there may be private stuff in the messages) -If for any reason you are not able to provide, open your issue anyway and we will see what is needed to solve your problem. +If for any reason you are not able to do that, open your issue anyway and we will see what is needed to solve your problem. Pull requests ============= +Please do your pull requests on the `develop` branch. + PyGithub follows [pep8 Style Guide for Python Code](http://www.python.org/dev/peps/pep-0008/) except for line length. So if you do heavy modifications, please check your code with [pep8 Python style guide checker](http://pypi.python.org/pypi/pep8), by running `pep8 --ignore=E501 github`. From 9df874f2fc8f017d5f0283cd97b6d8f0ad8ecf63 Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Thu, 22 Nov 2012 21:16:06 +0100 Subject: [PATCH 62/62] Readme --- ReadMe.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReadMe.md b/ReadMe.md index 1344507c..5ef5074a 100644 --- a/ReadMe.md +++ b/ReadMe.md @@ -1,4 +1,4 @@ -This is a Python library to access the [Github API v3](http://developer.github.com/v3). +This is a Python (2 and 3) library to access the [Github API v3](http://developer.github.com/v3). With it, you can manage your [Github](http://github.com) resources (repositories, user profiles, organizations, etc.) from Python scripts.