From 6f3fccb95917535586efa660f9cf9c851e3e4e02 Mon Sep 17 00:00:00 2001 From: Harmon Date: Thu, 3 Jun 2021 07:13:27 -0500 Subject: [PATCH] Rename API.friends to API.get_friends --- cassettes/{testfriends.yaml => testgetfriends.yaml} | 0 docs/api.rst | 4 ++-- tests/test_api.py | 6 +++--- tweepy/api.py | 6 +++--- tweepy/models.py | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) rename cassettes/{testfriends.yaml => testgetfriends.yaml} (100%) diff --git a/cassettes/testfriends.yaml b/cassettes/testgetfriends.yaml similarity index 100% rename from cassettes/testfriends.yaml rename to cassettes/testgetfriends.yaml diff --git a/docs/api.rst b/docs/api.rst index 9688bea..289eeff 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -116,7 +116,7 @@ +------------------------------------------+--------------------------------------+ | `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 diff --git a/tests/test_api.py b/tests/test_api.py index 2297bf0..8e3f952 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -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): diff --git a/tweepy/api.py b/tweepy/api.py index ea22a36..afce01e 100644 --- a/tweepy/api.py +++ b/tweepy/api.py @@ -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. diff --git a/tweepy/models.py b/tweepy/models.py index 9f7d948..73758c0 100644 --- a/tweepy/models.py +++ b/tweepy/models.py @@ -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) -- 2.25.1