Skip to content

Commit

Permalink
Rename API.followers_ids to API.get_follower_ids
Browse files Browse the repository at this point in the history
Rename models.User.followers_ids to models.User.follower_ids
  • Loading branch information
Harmon758 committed Jun 3, 2021
1 parent ce768d9 commit fa5e7c4
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 11 deletions.
File renamed without changes.
4 changes: 2 additions & 2 deletions docs/api.rst
Expand Up @@ -110,7 +110,7 @@
+------------------------------------------+--------------------------------------+
| .. centered:: |Follow, search, and get users|_ |
+------------------------------------------+--------------------------------------+
| `GET followers/ids`_ | :meth:`API.followers_ids` |
| `GET followers/ids`_ | :meth:`API.get_follower_ids` |
+------------------------------------------+--------------------------------------+
| `GET followers/list`_ | :meth:`API.get_followers` |
+------------------------------------------+--------------------------------------+
Expand Down Expand Up @@ -470,7 +470,7 @@ Create and manage lists
Follow, search, and get users
-----------------------------

.. automethod:: API.followers_ids
.. automethod:: API.get_follower_ids

.. automethod:: API.get_followers

Expand Down
6 changes: 3 additions & 3 deletions tests/test_api.py
Expand Up @@ -166,9 +166,9 @@ def testgetfriendship(self):
def testfriendsids(self):
self.api.friends_ids(screen_name=username)

@tape.use_cassette('testfollowersids.yaml', serializer='yaml')
def testfollowersids(self):
self.api.followers_ids(screen_name=username)
@tape.use_cassette('testgetfollowerids.yaml', serializer='yaml')
def testgetfollowerids(self):
self.api.get_follower_ids(screen_name=username)

@tape.use_cassette('testfriends.yaml', serializer='yaml')
def testfriends(self):
Expand Down
4 changes: 2 additions & 2 deletions tests/test_cursors.py
Expand Up @@ -18,15 +18,15 @@ def testcursorcursoritems(self):
items = list(Cursor(self.api.friends_ids).items(2))
self.assertEqual(len(items), 2)

items = list(Cursor(self.api.followers_ids, screen_name=username).items(1))
items = list(Cursor(self.api.get_follower_ids, screen_name=username).items(1))
self.assertEqual(len(items), 1)

@tape.use_cassette('testcursorcursorpages.yaml', serializer='yaml')
def testcursorcursorpages(self):
pages = list(Cursor(self.api.friends_ids).pages(1))
self.assertTrue(len(pages) == 1)

pages = list(Cursor(self.api.followers_ids, screen_name=username).pages(1))
pages = list(Cursor(self.api.get_follower_ids, screen_name=username).pages(1))
self.assertTrue(len(pages) == 1)

@tape.use_cassette('testcursorsetstartcursor.json')
Expand Down
5 changes: 3 additions & 2 deletions tweepy/api.py
Expand Up @@ -2021,8 +2021,9 @@ def update_list(self, **kwargs):

@pagination(mode='cursor')
@payload('ids')
def followers_ids(self, **kwargs):
"""followers_ids(*, user_id, screen_name, cursor, stringify_ids, count)
def get_follower_ids(self, **kwargs):
"""get_follower_ids(*, user_id, screen_name, cursor, stringify_ids, \
count)
Returns an array containing the IDs of users following the specified
user.
Expand Down
4 changes: 2 additions & 2 deletions tweepy/models.py
Expand Up @@ -439,8 +439,8 @@ def list_subscriptions(self, *args, **kwargs):
def lists(self, *args, **kwargs):
return self._api.get_lists(user_id=self.id, *args, **kwargs)

def followers_ids(self, *args, **kwargs):
return self._api.followers_ids(user_id=self.id, *args, **kwargs)
def follower_ids(self, *args, **kwargs):
return self._api.get_follower_ids(user_id=self.id, *args, **kwargs)


class IDModel(Model):
Expand Down

0 comments on commit fa5e7c4

Please sign in to comment.