exposed seats and filled_seats for Github Organization Plan (#1360)

Expose two new attributes for Organization Plans
This commit is contained in:
Geoff Low
2020-01-21 10:27:19 +11:00
committed by Steve Kowalik
parent 0e09983dca
commit 06a300aee0
2 changed files with 22 additions and 0 deletions
+20
View File
@@ -69,11 +69,27 @@ class Plan(github.GithubObject.NonCompletableGithubObject):
"""
return self._space.value
@property
def filled_seats(self):
"""
:type: integer
"""
return self._filled_seats.value
@property
def seats(self):
"""
:type: integer
"""
return self._seats.value
def _initAttributes(self):
self._collaborators = github.GithubObject.NotSet
self._name = github.GithubObject.NotSet
self._private_repos = github.GithubObject.NotSet
self._space = github.GithubObject.NotSet
self._filled_seats = github.GithubObject.NotSet
self._seats = github.GithubObject.NotSet
def _useAttributes(self, attributes):
if "collaborators" in attributes: # pragma no branch
@@ -84,3 +100,7 @@ class Plan(github.GithubObject.NonCompletableGithubObject):
self._private_repos = self._makeIntAttribute(attributes["private_repos"])
if "space" in attributes: # pragma no branch
self._space = self._makeIntAttribute(attributes["space"])
if "seats" in attributes: # pragma no branch
self._seats = self._makeIntAttribute(attributes["seats"])
if "filled_seats" in attributes: # pragma no branch
self._filled_seats = self._makeIntAttribute(attributes["filled_seats"])
+2
View File
@@ -70,6 +70,8 @@ class Organization(Framework.TestCase):
self.assertEqual(self.org.plan.name, "free")
self.assertEqual(self.org.plan.private_repos, 3)
self.assertEqual(self.org.plan.space, 1)
self.assertEqual(self.org.plan.filled_seats, 3)
self.assertEqual(self.org.plan.seats, 0)
self.assertEqual(self.org.private_gists, 0)
self.assertEqual(self.org.public_gists, 0)
self.assertEqual(self.org.public_repos, 27)