From fa5e7c4bb08b775e21e52da4e7e65b61eb7bc038 Mon Sep 17 00:00:00 2001 From: Harmon Date: Thu, 3 Jun 2021 07:06:01 -0500 Subject: [PATCH] Rename API.followers_ids to API.get_follower_ids Rename models.User.followers_ids to models.User.follower_ids --- .../{testfollowersids.yaml => testgetfollowerids.yaml} | 0 docs/api.rst | 4 ++-- tests/test_api.py | 6 +++--- tests/test_cursors.py | 4 ++-- tweepy/api.py | 5 +++-- tweepy/models.py | 4 ++-- 6 files changed, 12 insertions(+), 11 deletions(-) rename cassettes/{testfollowersids.yaml => testgetfollowerids.yaml} (100%) diff --git a/cassettes/testfollowersids.yaml b/cassettes/testgetfollowerids.yaml similarity index 100% rename from cassettes/testfollowersids.yaml rename to cassettes/testgetfollowerids.yaml diff --git a/docs/api.rst b/docs/api.rst index 7bb1971..9688bea 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -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` | +------------------------------------------+--------------------------------------+ @@ -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 diff --git a/tests/test_api.py b/tests/test_api.py index 5965759..2297bf0 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -166,9 +166,9 @@ class TweepyAPITests(TweepyTestCase): 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): diff --git a/tests/test_cursors.py b/tests/test_cursors.py index ccbd377..c018653 100644 --- a/tests/test_cursors.py +++ b/tests/test_cursors.py @@ -18,7 +18,7 @@ class TweepyCursorTests(TweepyTestCase): 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') @@ -26,7 +26,7 @@ class TweepyCursorTests(TweepyTestCase): 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') diff --git a/tweepy/api.py b/tweepy/api.py index 576bb6e..ea22a36 100644 --- a/tweepy/api.py +++ b/tweepy/api.py @@ -2021,8 +2021,9 @@ class API: @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. diff --git a/tweepy/models.py b/tweepy/models.py index cbff9ba..9f7d948 100644 --- a/tweepy/models.py +++ b/tweepy/models.py @@ -439,8 +439,8 @@ class User(Model, HashableID): 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): -- 2.25.1