NamedUser.has_in_following

This commit is contained in:
Vincent Jacques
2013-08-21 22:26:58 +02:00
parent 0f369ba218
commit e384a52971
4 changed files with 42 additions and 3 deletions
+15
View File
@@ -449,6 +449,21 @@ class NamedUser(github.GithubObject.CompletableGithubObject):
None
)
def has_in_following(self, following):
"""
:calls: `GET /user/:user/following/:target_user <http://developer.github.com/v3/users/followers/#check-if-one-user-follows-another>`_
:param following: :class:`github.NamedUser.NamedUser`
:rtype: bool
"""
assert isinstance(following, github.NamedUser.NamedUser), following
status, headers, data = self._requester.requestJson(
"GET",
self.url + "/following/" + following._identity,
None,
None
)
return status == 204
@property
def _identity(self):
return self.login