From: Harmon Date: Fri, 28 May 2021 12:32:55 +0000 (-0500) Subject: Rename API.lists_ownerships to API.get_list_ownerships X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=9b8ae851fd2e9f0efafdca6e23ffba8e0f1809cc;p=tweepy.git Rename API.lists_ownerships to API.get_list_ownerships Rename models.User.lists_ownerships to models.User.list_ownerships --- diff --git a/cassettes/testlistsownerships.json b/cassettes/testgetlistownerships.json similarity index 100% rename from cassettes/testlistsownerships.json rename to cassettes/testgetlistownerships.json diff --git a/docs/api.rst b/docs/api.rst index 04ef79c..a1c1ec7 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -78,7 +78,7 @@ +------------------------------------------+-------------------------------------+ | `GET lists/memberships`_ | :meth:`API.get_list_memberships` | +------------------------------------------+-------------------------------------+ - | `GET lists/ownerships`_ | :meth:`API.lists_ownerships` | + | `GET lists/ownerships`_ | :meth:`API.get_list_ownerships` | +------------------------------------------+-------------------------------------+ | `GET lists/show`_ | :meth:`API.get_list` | +------------------------------------------+-------------------------------------+ @@ -437,7 +437,7 @@ Create and manage lists .. automethod:: API.get_list_memberships -.. automethod:: API.lists_ownerships +.. automethod:: API.get_list_ownerships .. automethod:: API.get_list diff --git a/tests/test_api.py b/tests/test_api.py index be45dc8..57e6fd8 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -279,9 +279,9 @@ class TweepyAPITests(TweepyTestCase): def testgetlistmemberships(self): self.api.get_list_memberships() - @tape.use_cassette('testlistsownerships.json') - def testlistsownerships(self): - self.api.lists_ownerships() + @tape.use_cassette('testgetlistownerships.json') + def testgetlistownerships(self): + self.api.get_list_ownerships() @tape.use_cassette('testlistssubscriptions.json') def testlistssubscriptions(self): diff --git a/tweepy/api.py b/tweepy/api.py index e51319d..840b1a1 100644 --- a/tweepy/api.py +++ b/tweepy/api.py @@ -1444,8 +1444,8 @@ class API: @pagination(mode='cursor') @payload('list', list=True) - def lists_ownerships(self, **kwargs): - """lists_ownerships(*, user_id, screen_name, count, cursor) + def get_list_ownerships(self, **kwargs): + """get_list_ownerships(*, user_id, screen_name, count, cursor) Returns the lists owned by the specified user. Private lists will only be shown if the authenticated user is also the owner of the lists. If diff --git a/tweepy/models.py b/tweepy/models.py index 93fa911..9ee3f34 100644 --- a/tweepy/models.py +++ b/tweepy/models.py @@ -436,8 +436,8 @@ class User(Model, HashableID): 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) + 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)