Skip to content

Commit

Permalink
Remove NamedUser.contributions (PyGithub#774)
Browse files Browse the repository at this point in the history
The contributions attribute is no longer sent by Github for NamedUsers,
so remove the attribute.

Fixes PyGithub#443
  • Loading branch information
s-t-e-v-e-n-k authored and sfdye committed Apr 30, 2018
1 parent b1e9ae6 commit a519e46
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
11 changes: 0 additions & 11 deletions github/NamedUser.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,6 @@ def company(self):
self._completeIfNotSet(self._company)
return self._company.value

@property
def contributions(self):
"""
:type: integer
"""
self._completeIfNotSet(self._contributions)
return self._contributions.value

@property
def created_at(self):
"""
Expand Down Expand Up @@ -571,7 +563,6 @@ def _initAttributes(self):
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
Expand Down Expand Up @@ -616,8 +607,6 @@ def _useAttributes(self, attributes):
self._collaborators = self._makeIntAttribute(attributes["collaborators"])
if "company" in attributes: # pragma no branch
self._company = self._makeStringAttribute(attributes["company"])
if "contributions" in attributes: # pragma no branch
self._contributions = self._makeIntAttribute(attributes["contributions"])
if "created_at" in attributes: # pragma no branch
self._created_at = self._makeDatetimeAttribute(attributes["created_at"])
if "disk_usage" in attributes: # pragma no branch
Expand Down
2 changes: 1 addition & 1 deletion github/tests/Repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ def testDelete(self):
repo.delete()

def testGetContributors(self):
self.assertListKeyEqual(self.repo.get_contributors(), lambda c: (c.login, c.contributions), [("jacquev6", 355)])
self.assertListKeyEqual(self.repo.get_contributors(), lambda c: c.login, ["jacquev6"])

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))
Expand Down

0 comments on commit a519e46

Please sign in to comment.