diff --git a/github/AuthenticatedUser.py b/github/AuthenticatedUser.py index 7e2577a5..3c8e0153 100644 --- a/github/AuthenticatedUser.py +++ b/github/AuthenticatedUser.py @@ -46,7 +46,7 @@ import github.Notification class AuthenticatedUser(github.GithubObject.CompletableGithubObject): """ This class represents AuthenticatedUsers as returned for example by http://developer.github.com/v3/todo - + An AuthenticatedUser object can be created by calling ``get_user()`` on a Github object. """ @@ -500,7 +500,7 @@ class AuthenticatedUser(github.GithubObject.CompletableGithubObject): ) return github.UserKey.UserKey(self._requester, headers, data, completed=True) - def create_repo(self, name, description=github.GithubObject.NotSet,homepage=github.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, has_projects=github.GithubObject.NotSet, auto_init=github.GithubObject.NotSet, license_template=github.GithubObject.NotSet, diff --git a/github/File.py b/github/File.py index d03efd3b..15454099 100644 --- a/github/File.py +++ b/github/File.py @@ -141,7 +141,7 @@ class File(github.GithubObject.NonCompletableGithubObject): self._filename = self._makeStringAttribute(attributes["filename"]) if "patch" in attributes: # pragma no branch self._patch = self._makeStringAttribute(attributes["patch"]) - if "previous_filename" in attributes: # pragma no branch + if "previous_filename" in attributes: # pragma no branch self._previous_filename = self._makeStringAttribute(attributes["previous_filename"]) if "raw_url" in attributes: # pragma no branch self._raw_url = self._makeStringAttribute(attributes["raw_url"]) diff --git a/github/GitRelease.py b/github/GitRelease.py index 1a0e150e..c3b50a24 100644 --- a/github/GitRelease.py +++ b/github/GitRelease.py @@ -147,11 +147,11 @@ class GitRelease(github.GithubObject.CompletableGithubObject): return github.GitReleaseAsset.GitReleaseAsset(self._requester, resp_headers, data, completed=True) def get_assets(self): - return github.PaginatedList.PaginatedList( - github.GitReleaseAsset.GitReleaseAsset, - self._requester, - self.url + "/assets", - None + return github.PaginatedList.PaginatedList( + github.GitReleaseAsset.GitReleaseAsset, + self._requester, + self.url + "/assets", + None ) def _initAttributes(self): diff --git a/github/GitReleaseAsset.py b/github/GitReleaseAsset.py index e1283952..708e7e17 100644 --- a/github/GitReleaseAsset.py +++ b/github/GitReleaseAsset.py @@ -204,9 +204,8 @@ class GitReleaseAsset(github.GithubObject.CompletableGithubObject): self._name = self._makeStringAttribute(attributes["name"]) if "label" in attributes: # pragma no branch self._label = self._makeStringAttribute(attributes["label"]) - if "uploader" in attributes: # pragma no branch - self._uploader = github.NamedUser.NamedUser(self._requester, {}, \ - attributes["uploader"], completed=True) + if "uploader" in attributes: # pragma no branch + self._uploader = github.NamedUser.NamedUser(self._requester, {}, attributes["uploader"], completed=True) if "content_type" in attributes: # pragma no branch self._content_type = self._makeStringAttribute(attributes["content_type"]) if "state" in attributes: # pragma no branch diff --git a/github/Installation.py b/github/Installation.py index 67a086b1..94f4828b 100644 --- a/github/Installation.py +++ b/github/Installation.py @@ -72,4 +72,4 @@ class Installation(github.GithubObject.NonCompletableGithubObject): def _useAttributes(self, attributes): if "id" in attributes: # pragma no branch - self._id = self._makeIntAttribute(attributes["id"]) \ No newline at end of file + self._id = self._makeIntAttribute(attributes["id"]) diff --git a/github/InstallationAuthorization.py b/github/InstallationAuthorization.py index 5dfaf8cb..f4f741ba 100644 --- a/github/InstallationAuthorization.py +++ b/github/InstallationAuthorization.py @@ -69,4 +69,4 @@ class InstallationAuthorization(github.GithubObject.NonCompletableGithubObject): if "expires_at" in attributes: # pragma no branch self._expires_at = self._makeDatetimeAttribute(attributes["expires_at"]) if "on_behalf_of" in attributes: # pragma no branch - self._on_behalf_of = self._makeClassAttribute(github.NamedUser.NamedUser, attributes["on_behalf_of"]) \ No newline at end of file + self._on_behalf_of = self._makeClassAttribute(github.NamedUser.NamedUser, attributes["on_behalf_of"]) diff --git a/github/Invitation.py b/github/Invitation.py index bf2668cc..9385ecb6 100644 --- a/github/Invitation.py +++ b/github/Invitation.py @@ -67,7 +67,6 @@ class Invitation(github.GithubObject.CompletableGithubObject): self._completeIfNotSet(self._url) return self._url.value - @property def html_url(self): """ @@ -106,4 +105,3 @@ class Invitation(github.GithubObject.CompletableGithubObject): self._url = self._makeStringAttribute(attributes["url"]) if "html_url" in attributes: # pragma no branch self._html_url = self._makeStringAttribute(attributes["html_url"]) - diff --git a/github/Issue.py b/github/Issue.py index 370f551f..a0fd97ba 100644 --- a/github/Issue.py +++ b/github/Issue.py @@ -42,6 +42,7 @@ import github.IssueComment import github.IssuePullRequest import github.Reaction + class Issue(github.GithubObject.CompletableGithubObject): """ This class represents Issues as returned for example by http://developer.github.com/v3/todo diff --git a/github/IssueEvent.py b/github/IssueEvent.py index d55cd353..362a6bb9 100644 --- a/github/IssueEvent.py +++ b/github/IssueEvent.py @@ -38,7 +38,7 @@ class IssueEvent(github.GithubObject.CompletableGithubObject): def __repr__(self): return self.get__repr__({"id": self._id.value}) - + @property def actor(self): """ diff --git a/github/PullRequest.py b/github/PullRequest.py index b34e99da..dd2a8b5d 100644 --- a/github/PullRequest.py +++ b/github/PullRequest.py @@ -540,7 +540,7 @@ class PullRequest(github.GithubObject.CompletableGithubObject): None, headers={'Accept': 'application/vnd.github.black-cat-preview+json'} ) - + def is_merged(self): """ :calls: `GET /repos/:owner/:repo/pulls/:number/merge `_ diff --git a/github/Repository.py b/github/Repository.py index 66f6065d..35bcbcea 100644 --- a/github/Repository.py +++ b/github/Repository.py @@ -2316,7 +2316,7 @@ class Repository(github.GithubObject.CompletableGithubObject): def get_release_asset(self, id): assert isinstance(id, (int)), id - + resp_headers, data = self._requester.requestJsonAndCheck( "GET", self.url + "/releases/assets/" + str(id) diff --git a/github/RepositoryKey.py b/github/RepositoryKey.py index 30fe7fc6..ae57a78f 100644 --- a/github/RepositoryKey.py +++ b/github/RepositoryKey.py @@ -144,5 +144,5 @@ class RepositoryKey(github.GithubObject.CompletableGithubObject): self._url = self._makeStringAttribute(attributes["url"]) if "verified" in attributes: # pragma no branch self._verified = self._makeBoolAttribute(attributes["verified"]) - if "read_only" in attributes: # pragma no branch + if "read_only" in attributes: # pragma no branch self._read_only = self._makeBoolAttribute(attributes["read_only"]) diff --git a/github/Requester.py b/github/Requester.py index 3fda707b..84e533af 100644 --- a/github/Requester.py +++ b/github/Requester.py @@ -51,7 +51,6 @@ import GithubException atLeastPython3 = sys.hexversion >= 0x03000000 - class Requester: __httpConnectionClass = httplib.HTTPConnection __httpsConnectionClass = httplib.HTTPSConnection @@ -85,12 +84,12 @@ class Requester: ON_CHECK_ME = None def NEW_DEBUG_FRAME(self, requestHeader): - ''' + """ Initialize a debug frame with requestHeader Frame count is updated and will be attached to respond header The structure of a frame: [requestHeader, statusCode, responseHeader, raw_data] Some of them may be None - ''' + """ if self.DEBUG_FLAG: # pragma no branch (Flag always set in tests) new_frame = [requestHeader, None, None, None] if self._frameCount < self.DEBUG_FRAME_BUFFER_SIZE - 1: # pragma no branch (Should be covered) diff --git a/github/tests/CommitCombinedStatus.py b/github/tests/CommitCombinedStatus.py index 18c8fc10..e0e6d76d 100644 --- a/github/tests/CommitCombinedStatus.py +++ b/github/tests/CommitCombinedStatus.py @@ -52,4 +52,4 @@ class CommitCombinedStatus(Framework.TestCase): # test __repr__() based on this attributes self.assertEqual(self.combined_status.__repr__(), - 'CommitCombinedStatus(state="success", sha="74e70119a23fa3ffb3db19d4590eccfebd72b659")') \ No newline at end of file + 'CommitCombinedStatus(state="success", sha="74e70119a23fa3ffb3db19d4590eccfebd72b659")') diff --git a/github/tests/CommitStatus.py b/github/tests/CommitStatus.py index 73dec203..b09ea38c 100644 --- a/github/tests/CommitStatus.py +++ b/github/tests/CommitStatus.py @@ -50,4 +50,4 @@ class CommitStatus(Framework.TestCase): # test __repr__() based on this attributes self.assertEqual(self.statuses[0].__repr__(), - 'CommitStatus(state="success", id=277040, context="build")') \ No newline at end of file + 'CommitStatus(state="success", id=277040, context="build")') diff --git a/github/tests/ContentFile.py b/github/tests/ContentFile.py index f05772ba..fd8c12fd 100644 --- a/github/tests/ContentFile.py +++ b/github/tests/ContentFile.py @@ -46,4 +46,4 @@ class ContentFile(Framework.TestCase): self.assertEqual(self.file.sha, "5628799a7d517a4aaa0c1a7004d07569cd154df0") # test __repr__() based on this attributes - self.assertEqual(self.file.__repr__(), 'ContentFile(path="ReadMe.md")') \ No newline at end of file + self.assertEqual(self.file.__repr__(), 'ContentFile(path="ReadMe.md")') diff --git a/github/tests/Exceptions.py b/github/tests/Exceptions.py index 4d8dece3..16c9debb 100644 --- a/github/tests/Exceptions.py +++ b/github/tests/Exceptions.py @@ -115,7 +115,6 @@ class Exceptions(Framework.TestCase): # To stay compatible with Python 2.6, we self.assertEqual(str(exception), "401 {'message': 'Bad credentials'}") # pragma no cover (Covered with Python 3) self.assertTrue(raised) - def testExceptionPickling(self): pickle.loads(pickle.dumps(github.GithubException('foo', 'bar'))) diff --git a/github/tests/Framework.py b/github/tests/Framework.py index 8cd8fbce..dfc79733 100644 --- a/github/tests/Framework.py +++ b/github/tests/Framework.py @@ -38,7 +38,6 @@ python2 = sys.hexversion < 0x03000000 atLeastPython3 = sys.hexversion >= 0x03000000 - def readLine(file): if atLeastPython3: return file.readline().decode("utf-8").strip() diff --git a/github/tests/GitBlob.py b/github/tests/GitBlob.py index fcbc983c..85cb4c20 100644 --- a/github/tests/GitBlob.py +++ b/github/tests/GitBlob.py @@ -43,4 +43,4 @@ class GitBlob(Framework.TestCase): # test __repr__() based on this attributes self.assertEqual(self.blob.__repr__(), - 'GitBlob(sha="53bce9fa919b4544e67275089b3ec5b44be20667")') \ No newline at end of file + 'GitBlob(sha="53bce9fa919b4544e67275089b3ec5b44be20667")') diff --git a/github/tests/GitCommit.py b/github/tests/GitCommit.py index 2d7c89ae..a570df3f 100644 --- a/github/tests/GitCommit.py +++ b/github/tests/GitCommit.py @@ -51,4 +51,4 @@ class GitCommit(Framework.TestCase): # test __repr__() based on this attributes self.assertEqual(self.commit.__repr__(), - 'GitCommit(sha="4303c5b90e2216d927155e9609436ccb8984c495")') \ No newline at end of file + 'GitCommit(sha="4303c5b90e2216d927155e9609436ccb8984c495")') diff --git a/github/tests/GitRelease.py b/github/tests/GitRelease.py index 2e3f1915..dfbf94c5 100644 --- a/github/tests/GitRelease.py +++ b/github/tests/GitRelease.py @@ -62,7 +62,6 @@ class Release(Framework.TestCase): # test __repr__() based on this attributes self.assertEqual(self.release.__repr__(), 'GitRelease(title="Test")') - def testDelete(self): self.release = self.g.get_user().get_repo("PyGithub").get_releases()[0] self.assertTrue(self.release.delete_release()) diff --git a/github/tests/GitReleaseAsset.py b/github/tests/GitReleaseAsset.py index 12a8bc94..63b9c48d 100644 --- a/github/tests/GitReleaseAsset.py +++ b/github/tests/GitReleaseAsset.py @@ -46,8 +46,7 @@ class ReleaseAsset(Framework.TestCase): asset = release.get_assets()[0] self.assertEqual(asset.id, 16) - self.assertEqual(asset.url, \ - "https://api.github.com/api/v3/repos/edhollandAL/PyGithub/releases/assets/16") + self.assertEqual(asset.url, "https://api.github.com/api/v3/repos/edhollandAL/PyGithub/releases/assets/16") self.assertEqual(asset.name, "Archive.zip") self.assertEqual(asset.label, "Installation msi & runbook zipped") self.assertEqual(asset.content_type, "application/zip") diff --git a/github/tests/GitTag.py b/github/tests/GitTag.py index 44adf317..f3eca9dc 100644 --- a/github/tests/GitTag.py +++ b/github/tests/GitTag.py @@ -47,4 +47,4 @@ class GitTag(Framework.TestCase): self.assertEqual(self.tag.url, "https://api.github.com/repos/jacquev6/PyGithub/git/tags/f5f37322407b02a80de4526ad88d5f188977bc3c") # test __repr__() based on this attributes - self.assertEqual(self.tag.__repr__(), 'GitTag(tag="v0.6", sha="f5f37322407b02a80de4526ad88d5f188977bc3c")') \ No newline at end of file + self.assertEqual(self.tag.__repr__(), 'GitTag(tag="v0.6", sha="f5f37322407b02a80de4526ad88d5f188977bc3c")') diff --git a/github/tests/GitTree.py b/github/tests/GitTree.py index 19f15a83..1cbfd820 100644 --- a/github/tests/GitTree.py +++ b/github/tests/GitTree.py @@ -50,4 +50,4 @@ class GitTree(Framework.TestCase): self.assertEqual(self.tree.url, "https://api.github.com/repos/jacquev6/PyGithub/git/trees/f492784d8ca837779650d1fb406a1a3587a764ad") # test __repr__() based on this attributes - self.assertEqual(self.tree.__repr__(), 'GitTree(sha="f492784d8ca837779650d1fb406a1a3587a764ad")') \ No newline at end of file + self.assertEqual(self.tree.__repr__(), 'GitTree(sha="f492784d8ca837779650d1fb406a1a3587a764ad")') diff --git a/github/tests/IssueEvent.py b/github/tests/IssueEvent.py index 5a6c72e0..36e1ce95 100644 --- a/github/tests/IssueEvent.py +++ b/github/tests/IssueEvent.py @@ -44,4 +44,4 @@ class IssueEvent(Framework.TestCase): self.assertEqual(self.event.url, "https://api.github.com/repos/jacquev6/PyGithub/issues/events/16348656") # test __repr__() based on this attributes - self.assertEqual(self.event.__repr__(), 'IssueEvent(id=16348656)') \ No newline at end of file + self.assertEqual(self.event.__repr__(), 'IssueEvent(id=16348656)') diff --git a/github/tests/NamedUser.py b/github/tests/NamedUser.py index 203921af..9971a848 100644 --- a/github/tests/NamedUser.py +++ b/github/tests/NamedUser.py @@ -66,7 +66,6 @@ class NamedUser(Framework.TestCase): # test __repr__() based on this attributes self.assertEqual(self.user.__repr__(), 'NamedUser(login="nvie")') - 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, "") diff --git a/github/tests/PullRequestReview.py b/github/tests/PullRequestReview.py index 872aa21e..d163e64c 100644 --- a/github/tests/PullRequestReview.py +++ b/github/tests/PullRequestReview.py @@ -28,12 +28,13 @@ import Framework import datetime + class PullRequestReview(Framework.TestCase): def setUp(self): Framework.TestCase.setUp(self) self.repo = self.g.get_repo("PyGithub/PyGithub") self.pull = self.repo.get_pull(538) - + # Test ability to get all reviews self.pullreviews = self.pull.get_reviews() diff --git a/github/tests/PullRequestReviewerRequests.py b/github/tests/PullRequestReviewerRequests.py index e99e5232..83b3c19d 100644 --- a/github/tests/PullRequestReviewerRequests.py +++ b/github/tests/PullRequestReviewerRequests.py @@ -26,21 +26,20 @@ import Framework + class PullRequestReviewerRequests(Framework.TestCase): def setUp(self): Framework.TestCase.setUp(self) self.repo = self.g.get_repo("PyGithub/PyGithub") self.pull = self.repo.get_pull(538) - + self.pullreviewerrequests = self.pull.get_reviewer_requests() self.pullreviewerrequest = self.pullreviewerrequests[0] - def testAttributes(self): self.assertEqual(self.pullreviewerrequest.id, 2930472) self.assertEqual(self.pullreviewerrequest.login, "jayfk") - + # test __repr__() based on this attributes self.assertEqual(self.pullreviewerrequest.__repr__(), 'PullRequestReviewerRequest(login="jayfk", id=2930472)') - diff --git a/github/tests/RepositoryKey.py b/github/tests/RepositoryKey.py index a78a4ebd..c9bd7add 100644 --- a/github/tests/RepositoryKey.py +++ b/github/tests/RepositoryKey.py @@ -42,7 +42,6 @@ class RepositoryKey(Framework.TestCase): # test __repr__() based on this attributes self.assertEqual(self.key.__repr__(), 'RepositoryKey(id=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==")