From 3b3ba2494743b894a44539247fd7e5b7839c90aa Mon Sep 17 00:00:00 2001 From: Harmon Date: Wed, 9 Jun 2021 00:43:19 -0500 Subject: [PATCH] Rename API.retweets to API.get_retweets --- cassettes/{testretweets.json => testgetretweets.json} | 0 docs/api.rst | 4 ++-- tests/test_api.py | 6 +++--- tweepy/api.py | 4 ++-- tweepy/models.py | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) rename cassettes/{testretweets.json => testgetretweets.json} (100%) diff --git a/cassettes/testretweets.json b/cassettes/testgetretweets.json similarity index 100% rename from cassettes/testretweets.json rename to cassettes/testgetretweets.json diff --git a/docs/api.rst b/docs/api.rst index 3e29e36..d925d4c 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -42,7 +42,7 @@ +------------------------------------------+--------------------------------------+ | `GET statuses/retweeters/ids`_ | :meth:`API.get_retweeter_ids` | +------------------------------------------+--------------------------------------+ - | `GET statuses/retweets/:id`_ | :meth:`API.retweets` | + | `GET statuses/retweets/:id`_ | :meth:`API.get_retweets` | +------------------------------------------+--------------------------------------+ | `GET statuses/retweets_of_me`_ | :meth:`API.retweets_of_me` | +------------------------------------------+--------------------------------------+ @@ -398,7 +398,7 @@ Post, retrieve, and engage with Tweets .. automethod:: API.get_retweeter_ids -.. automethod:: API.retweets +.. automethod:: API.get_retweets .. automethod:: API.retweets_of_me diff --git a/tests/test_api.py b/tests/test_api.py index 60bdb82..6ef1b8f 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -63,9 +63,9 @@ class TweepyAPITests(TweepyTestCase): self.api.retweet(test_tweet_id) self.api.unretweet(test_tweet_id) - @tape.use_cassette('testretweets.json') - def testretweets(self): - self.api.retweets(test_tweet_id) + @tape.use_cassette('testgetretweets.json') + def testgetretweets(self): + self.api.get_retweets(test_tweet_id) @tape.use_cassette('testgetretweeterids.json') def testgetretweeterids(self): diff --git a/tweepy/api.py b/tweepy/api.py index 8dc2944..d1476f0 100644 --- a/tweepy/api.py +++ b/tweepy/api.py @@ -778,8 +778,8 @@ class API: ) @payload('status', list=True) - def retweets(self, id, **kwargs): - """retweets(id, *, count, trim_user) + def get_retweets(self, id, **kwargs): + """get_retweets(id, *, count, trim_user) Returns up to 100 of the first Retweets of the given Tweet. diff --git a/tweepy/models.py b/tweepy/models.py index 73758c0..c77000d 100644 --- a/tweepy/models.py +++ b/tweepy/models.py @@ -369,7 +369,7 @@ class Status(Model, HashableID): return self._api.retweet(self.id) def retweets(self): - return self._api.retweets(self.id) + return self._api.get_retweets(self.id) def favorite(self): return self._api.create_favorite(self.id) -- 2.25.1