From 9dddc1262d9d043df9201ddda39002d111d035fe Mon Sep 17 00:00:00 2001 From: Harmon Date: Fri, 28 May 2021 07:26:34 -0500 Subject: [PATCH] Rename API.lists_memberships to API.get_list_memberships Rename models.User.lists_memberships to models.User.list_memberships --- ...estlistsmemberships.json => testgetlistmemberships.json} | 0 docs/api.rst | 4 ++-- tests/test_api.py | 6 +++--- tweepy/api.py | 6 +++--- tweepy/models.py | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) rename cassettes/{testlistsmemberships.json => testgetlistmemberships.json} (100%) diff --git a/cassettes/testlistsmemberships.json b/cassettes/testgetlistmemberships.json similarity index 100% rename from cassettes/testlistsmemberships.json rename to cassettes/testgetlistmemberships.json diff --git a/docs/api.rst b/docs/api.rst index 94ac253..04ef79c 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -76,7 +76,7 @@ +------------------------------------------+-------------------------------------+ | `GET lists/members/show`_ | :meth:`API.get_list_member` | +------------------------------------------+-------------------------------------+ - | `GET lists/memberships`_ | :meth:`API.lists_memberships` | + | `GET lists/memberships`_ | :meth:`API.get_list_memberships` | +------------------------------------------+-------------------------------------+ | `GET lists/ownerships`_ | :meth:`API.lists_ownerships` | +------------------------------------------+-------------------------------------+ @@ -435,7 +435,7 @@ Create and manage lists .. automethod:: API.get_list_member -.. automethod:: API.lists_memberships +.. automethod:: API.get_list_memberships .. automethod:: API.lists_ownerships diff --git a/tests/test_api.py b/tests/test_api.py index 9d10433..be45dc8 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -275,9 +275,9 @@ class TweepyAPITests(TweepyTestCase): def testgetlists(self): self.api.get_lists() - @tape.use_cassette('testlistsmemberships.json') - def testlistsmemberships(self): - self.api.lists_memberships() + @tape.use_cassette('testgetlistmemberships.json') + def testgetlistmemberships(self): + self.api.get_list_memberships() @tape.use_cassette('testlistsownerships.json') def testlistsownerships(self): diff --git a/tweepy/api.py b/tweepy/api.py index f1d859c..e51319d 100644 --- a/tweepy/api.py +++ b/tweepy/api.py @@ -1404,9 +1404,9 @@ class API: @pagination(mode='cursor') @payload('list', list=True) - def lists_memberships(self, **kwargs): - """lists_memberships(*, user_id, screen_name, count, cursor, \ - filter_to_owned_lists) + def get_list_memberships(self, **kwargs): + """get_list_memberships(*, user_id, screen_name, count, cursor, \ + filter_to_owned_lists) Returns the lists the specified user has been added to. If ``user_id`` or ``screen_name`` are not provided, the memberships for the diff --git a/tweepy/models.py b/tweepy/models.py index 465e89f..93fa911 100644 --- a/tweepy/models.py +++ b/tweepy/models.py @@ -433,8 +433,8 @@ class User(Model, HashableID): self._api.destroy_friendship(user_id=self.id) self.following = False - def lists_memberships(self, *args, **kwargs): - return self._api.lists_memberships(user_id=self.id, *args, **kwargs) + def list_memberships(self, *args, **kwargs): + return self._api.get_list_memberships(user_id=self.id, *args, **kwargs) def lists_ownerships(self, *args, **kwargs): return self._api.lists_ownerships(user_id=self.id, *args, **kwargs) -- 2.25.1