Rename API.followers_ids to API.get_follower_ids
authorHarmon <Harmon758@gmail.com>
Thu, 3 Jun 2021 12:06:01 +0000 (07:06 -0500)
committerHarmon <Harmon758@gmail.com>
Thu, 3 Jun 2021 12:06:01 +0000 (07:06 -0500)
Rename models.User.followers_ids to models.User.follower_ids

cassettes/testgetfollowerids.yaml [moved from cassettes/testfollowersids.yaml with 100% similarity]
docs/api.rst
tests/test_api.py
tests/test_cursors.py
tweepy/api.py
tweepy/models.py

index 7bb1971645f9df34047c0dbe76a947220a4d8c31..9688bea17f83ecbce7c9c1c43f2a3265641c4adc 100644 (file)
     +------------------------------------------+--------------------------------------+
     | .. 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
 
index 596575933d1eeb31ab7c4a10e2370f090f73f61e..2297bf03e8d52c74d22e8b16875ed7b25360785c 100644 (file)
@@ -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):
index ccbd37792e8da1ba574991903e96ed5b29a2e650..c0186530cba064da883b49739610e5bad6cda3ee 100644 (file)
@@ -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')
index 576bb6e347f9c7549dd7574ecf1d9989a7ae45a9..ea22a36982e7abb3e1db529e19c145da7f976f9d 100644 (file)
@@ -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.
index cbff9baa716d54dbd43271015c1e241dc6b6b69b..9f7d94899c5e2380512db76c2203d0e13050d7a9 100644 (file)
@@ -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):