From bab3e5e9eee57583298fe64ab1ab0e37edf12344 Mon Sep 17 00:00:00 2001 From: Harmon Date: Thu, 3 Jun 2021 07:18:43 -0500 Subject: [PATCH] Rename API.friends_ids to API.get_friend_ids --- cassettes/{testfriendsids.yaml => testgetfriendids.yaml} | 0 docs/api.rst | 4 ++-- tests/test_api.py | 6 +++--- tests/test_cursors.py | 6 +++--- tweepy/api.py | 5 +++-- 5 files changed, 11 insertions(+), 10 deletions(-) rename cassettes/{testfriendsids.yaml => testgetfriendids.yaml} (100%) diff --git a/cassettes/testfriendsids.yaml b/cassettes/testgetfriendids.yaml similarity index 100% rename from cassettes/testfriendsids.yaml rename to cassettes/testgetfriendids.yaml diff --git a/docs/api.rst b/docs/api.rst index 289eeff..2050be9 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -114,7 +114,7 @@ +------------------------------------------+--------------------------------------+ | `GET followers/list`_ | :meth:`API.get_followers` | +------------------------------------------+--------------------------------------+ - | `GET friends/ids`_ | :meth:`API.friends_ids` | + | `GET friends/ids`_ | :meth:`API.get_friend_ids` | +------------------------------------------+--------------------------------------+ | `GET friends/list`_ | :meth:`API.get_friends` | +------------------------------------------+--------------------------------------+ @@ -474,7 +474,7 @@ Follow, search, and get users .. automethod:: API.get_followers -.. automethod:: API.friends_ids +.. automethod:: API.get_friend_ids .. automethod:: API.get_friends diff --git a/tests/test_api.py b/tests/test_api.py index 8e3f952..bb78ea1 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -162,9 +162,9 @@ class TweepyAPITests(TweepyTestCase): self.assertTrue(isinstance(source, Friendship)) self.assertTrue(isinstance(target, Friendship)) - @tape.use_cassette('testfriendsids.yaml', serializer='yaml') - def testfriendsids(self): - self.api.friends_ids(screen_name=username) + @tape.use_cassette('testgetfriendids.yaml', serializer='yaml') + def testgetfriendids(self): + self.api.get_friend_ids(screen_name=username) @tape.use_cassette('testgetfollowerids.yaml', serializer='yaml') def testgetfollowerids(self): diff --git a/tests/test_cursors.py b/tests/test_cursors.py index c018653..5e2f9ba 100644 --- a/tests/test_cursors.py +++ b/tests/test_cursors.py @@ -15,7 +15,7 @@ class TweepyCursorTests(TweepyTestCase): @tape.use_cassette('testcursorcursoritems.yaml', serializer='yaml') def testcursorcursoritems(self): - items = list(Cursor(self.api.friends_ids).items(2)) + items = list(Cursor(self.api.get_friend_ids).items(2)) self.assertEqual(len(items), 2) items = list(Cursor(self.api.get_follower_ids, screen_name=username).items(1)) @@ -23,7 +23,7 @@ class TweepyCursorTests(TweepyTestCase): @tape.use_cassette('testcursorcursorpages.yaml', serializer='yaml') def testcursorcursorpages(self): - pages = list(Cursor(self.api.friends_ids).pages(1)) + pages = list(Cursor(self.api.get_friend_ids).pages(1)) self.assertTrue(len(pages) == 1) pages = list(Cursor(self.api.get_follower_ids, screen_name=username).pages(1)) @@ -31,7 +31,7 @@ class TweepyCursorTests(TweepyTestCase): @tape.use_cassette('testcursorsetstartcursor.json') def testcursorsetstartcursor(self): - c = Cursor(self.api.friends_ids, cursor=123456) + c = Cursor(self.api.get_friend_ids, cursor=123456) self.assertEqual(c.iterator.next_cursor, 123456) self.assertFalse('cursor' in c.iterator.kwargs) diff --git a/tweepy/api.py b/tweepy/api.py index afce01e..f614bad 100644 --- a/tweepy/api.py +++ b/tweepy/api.py @@ -2097,8 +2097,9 @@ class API: @pagination(mode='cursor') @payload('ids') - def friends_ids(self, **kwargs): - """friends_ids(*, user_id, screen_name, cursor, stringify_ids, count) + def get_friend_ids(self, **kwargs): + """get_friend_ids(*, user_id, screen_name, cursor, stringify_ids, \ + count) Returns an array containing the IDs of users being followed by the specified user. -- 2.25.1