Rename API.friends to API.get_friends
authorHarmon <Harmon758@gmail.com>
Thu, 3 Jun 2021 12:13:27 +0000 (07:13 -0500)
committerHarmon <Harmon758@gmail.com>
Thu, 3 Jun 2021 12:13:27 +0000 (07:13 -0500)
cassettes/testgetfriends.yaml [moved from cassettes/testfriends.yaml with 100% similarity]
docs/api.rst
tests/test_api.py
tweepy/api.py
tweepy/models.py

index 9688bea17f83ecbce7c9c1c43f2a3265641c4adc..289eeffcb4e559aa336aee193a2071f4be81ad1c 100644 (file)
     +------------------------------------------+--------------------------------------+
     | `GET friends/ids`_                       | :meth:`API.friends_ids`              |
     +------------------------------------------+--------------------------------------+
-    | `GET friends/list`_                      | :meth:`API.friends`                  |
+    | `GET friends/list`_                      | :meth:`API.get_friends`              |
     +------------------------------------------+--------------------------------------+
     | `GET friendships/incoming`_              | :meth:`API.incoming_friendships`     |
     +------------------------------------------+--------------------------------------+
@@ -476,7 +476,7 @@ Follow, search, and get users
 
 .. automethod:: API.friends_ids
 
-.. automethod:: API.friends
+.. automethod:: API.get_friends
 
 .. automethod:: API.incoming_friendships
 
index 2297bf03e8d52c74d22e8b16875ed7b25360785c..8e3f95220f1e135453b920ab8775a3da6419b294 100644 (file)
@@ -170,9 +170,9 @@ class TweepyAPITests(TweepyTestCase):
     def testgetfollowerids(self):
         self.api.get_follower_ids(screen_name=username)
 
-    @tape.use_cassette('testfriends.yaml', serializer='yaml')
-    def testfriends(self):
-        self.api.friends(screen_name=username)
+    @tape.use_cassette('testgetfriends.yaml', serializer='yaml')
+    def testgetfriends(self):
+        self.api.get_friends(screen_name=username)
 
     @tape.use_cassette('testgetfollowers.yaml', serializer='yaml')
     def testgetfollowers(self):
index ea22a36982e7abb3e1db529e19c145da7f976f9d..afce01e18ce21f23b51f8650e49e6a4c67e19a17 100644 (file)
@@ -2132,9 +2132,9 @@ class API:
 
     @pagination(mode='cursor')
     @payload('user', list=True)
-    def friends(self, **kwargs):
-        """friends(*, user_id, screen_name, cursor, count, skip_status, \
-                   include_user_entities)
+    def get_friends(self, **kwargs):
+        """get_friends(*, user_id, screen_name, cursor, count, skip_status, \
+                       include_user_entities)
 
         Returns a user's friends ordered in which they were added 100 at a
         time. If no user is specified it defaults to the authenticated user.
index 9f7d94899c5e2380512db76c2203d0e13050d7a9..73758c0a19df2ab903edeb15b28c2d6a0a07d2c3 100644 (file)
@@ -412,7 +412,7 @@ class User(Model, HashableID):
         return self._api.user_timeline(user_id=self.id, **kwargs)
 
     def friends(self, **kwargs):
-        return self._api.friends(user_id=self.id, **kwargs)
+        return self._api.get_friends(user_id=self.id, **kwargs)
 
     def followers(self, **kwargs):
         return self._api.get_followers(user_id=self.id, **kwargs)