From: Harmon Date: Wed, 9 Jun 2021 05:43:19 +0000 (-0500) Subject: Rename API.retweets to API.get_retweets X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=3b3ba2494743b894a44539247fd7e5b7839c90aa;p=tweepy.git Rename API.retweets to API.get_retweets --- 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)