From 51945a7124e6ce68b294c97340a6ec803cd02da9 Mon Sep 17 00:00:00 2001 From: Harmon Date: Fri, 28 May 2021 07:48:00 -0500 Subject: [PATCH] Rename API.lists_subscriptions to API.get_list_subscriptions Rename models.User.lists_subscriptions to models.User.list_subscriptions --- ...istssubscriptions.json => testgetlistsubscriptions.json} | 0 docs/api.rst | 4 ++-- tests/test_api.py | 6 +++--- tweepy/api.py | 4 ++-- tweepy/models.py | 6 ++++-- 5 files changed, 11 insertions(+), 9 deletions(-) rename cassettes/{testlistssubscriptions.json => testgetlistsubscriptions.json} (100%) diff --git a/cassettes/testlistssubscriptions.json b/cassettes/testgetlistsubscriptions.json similarity index 100% rename from cassettes/testlistssubscriptions.json rename to cassettes/testgetlistsubscriptions.json diff --git a/docs/api.rst b/docs/api.rst index 3037325..50502ca 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -88,7 +88,7 @@ +------------------------------------------+-------------------------------------+ | `GET lists/subscribers/show`_ | :meth:`API.get_list_subscriber` | +------------------------------------------+-------------------------------------+ - | `GET lists/subscriptions`_ | :meth:`API.lists_subscriptions` | + | `GET lists/subscriptions`_ | :meth:`API.get_list_subscriptions` | +------------------------------------------+-------------------------------------+ | `POST lists/create`_ | :meth:`API.create_list` | +------------------------------------------+-------------------------------------+ @@ -447,7 +447,7 @@ Create and manage lists .. automethod:: API.get_list_subscriber -.. automethod:: API.lists_subscriptions +.. automethod:: API.get_list_subscriptions .. automethod:: API.create_list diff --git a/tests/test_api.py b/tests/test_api.py index ff20b90..84671de 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -283,9 +283,9 @@ class TweepyAPITests(TweepyTestCase): def testgetlistownerships(self): self.api.get_list_ownerships() - @tape.use_cassette('testlistssubscriptions.json') - def testlistssubscriptions(self): - self.api.lists_subscriptions() + @tape.use_cassette('testgetlistsubscriptions.json') + def testgetlistsubscriptions(self): + self.api.get_list_subscriptions() @tape.use_cassette('testlisttimeline.json') def testlisttimeline(self): diff --git a/tweepy/api.py b/tweepy/api.py index 563d5e2..628237f 100644 --- a/tweepy/api.py +++ b/tweepy/api.py @@ -1655,8 +1655,8 @@ class API: @pagination(mode='cursor') @payload('list', list=True) - def lists_subscriptions(self, **kwargs): - """lists_subscriptions(*, user_id, screen_name, count, cursor) + def get_list_subscriptions(self, **kwargs): + """get_list_subscriptions(*, user_id, screen_name, count, cursor) Obtain a collection of the lists the specified user is subscribed to, 20 lists per page by default. Does not include the user's own lists. diff --git a/tweepy/models.py b/tweepy/models.py index 5b9c5e9..e166852 100644 --- a/tweepy/models.py +++ b/tweepy/models.py @@ -439,8 +439,10 @@ class User(Model, HashableID): def list_ownerships(self, *args, **kwargs): return self._api.get_list_ownerships(user_id=self.id, *args, **kwargs) - def lists_subscriptions(self, *args, **kwargs): - return self._api.lists_subscriptions(user_id=self.id, *args, **kwargs) + def list_subscriptions(self, *args, **kwargs): + return self._api.get_list_subscriptions( + user_id=self.id, *args, **kwargs + ) def lists(self, *args, **kwargs): return self._api.get_lists(user_id=self.id, *args, **kwargs) -- 2.25.1