From: Kazuhiro Sera Date: Thu, 30 Dec 2021 08:31:23 +0000 (+0900) Subject: Fix a few errors in docs, comments, and tests X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=6fb6b68d5f7ce0e039bf75db20c9809ff7b34e4e;p=tweepy.git Fix a few errors in docs, comments, and tests --- diff --git a/docs/streaming.rst b/docs/streaming.rst index 4856c5e..7206a82 100644 --- a/docs/streaming.rst +++ b/docs/streaming.rst @@ -18,7 +18,7 @@ through repeated requests by your client app, as might be expected from a REST API, a single connection is opened between your app and the API, with new results being sent through that connection whenever new matches occur. This results in a low-latency delivery mechanism that can support very high -throughput. For futher information, see +throughput. For further information, see https://developer.twitter.com/en/docs/tutorials/consuming-streaming-data Using :class:`Stream` @@ -85,7 +85,7 @@ encountered while trying to connect to the stream. When these errors are encountered and ``max_retries``, which defaults to infinite, hasn't been exceeded yet, the :class:`Stream` instance will attempt to reconnect the stream after an appropriate amount of time. By default, all three of these methods log -an error. To customize that handling, they can be overriden in a subclass:: +an error. To customize that handling, they can be overridden in a subclass:: class ConnectionTester(tweepy.Stream): diff --git a/examples/update_status.py b/examples/update_status.py index 7610908..7c1fa69 100644 --- a/examples/update_status.py +++ b/examples/update_status.py @@ -13,7 +13,7 @@ api = tweepy.API(auth) # Tweet / Update Status -# The app and the corresponding credentials must have the Write perission +# The app and the corresponding credentials must have the Write permission # Check the App permissions section of the Settings tab of your app, under the # Twitter Developer Portal Projects & Apps page at diff --git a/tests/test_api.py b/tests/test_api.py index d0543b6..a576ed1 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -19,9 +19,9 @@ class TweepyAPITests(TweepyTestCase): #@tape.use_cassette('testfailure.json') #def testapierror(self): - # from tweepy.error import TweepError + # from tweepy.errors import TweepyException # - # with self.assertRaises(TweepError) as cm: + # with self.assertRaises(TweepyException) as cm: # self.api.direct_messages() # # reason, = literal_eval(cm.exception.reason) diff --git a/tests/test_rate_limit.py b/tests/test_rate_limit.py index c57c6cf..1f6f576 100644 --- a/tests/test_rate_limit.py +++ b/tests/test_rate_limit.py @@ -26,7 +26,7 @@ class TweepyRateLimitTests(unittest.TestCase): try: self.api.user_timeline(user_id=user_id, count=1, include_rts=True) except HTTPException as e: - # continue if we're not autherized to access the user's timeline or user doesn't exist anymore + # continue if we're not authorized to access the user's timeline or user doesn't exist anymore if e.response.status_code in (401, 404): continue raise e diff --git a/tweepy/cache.py b/tweepy/cache.py index 61bc8a5..9c53771 100644 --- a/tweepy/cache.py +++ b/tweepy/cache.py @@ -359,7 +359,7 @@ class RedisCache(Cache): def count(self): """Note: This is not very efficient, - since it retreives all the keys from the redis + since it retrieves all the keys from the redis server to know how many keys we have""" return len(self.client.smembers(self.keys_container)) @@ -388,7 +388,7 @@ class RedisCache(Cache): class MongodbCache(Cache): - """A simple pickle-based MongoDB cache sytem.""" + """A simple pickle-based MongoDB cache system.""" def __init__(self, db, timeout=3600, collection='tweepy_cache'): """Should receive a "database" cursor from pymongo.""" diff --git a/tweepy/client.py b/tweepy/client.py index 10acdc5..7e24a64 100644 --- a/tweepy/client.py +++ b/tweepy/client.py @@ -1036,7 +1036,7 @@ class Client: default to [now - 30 seconds]. granularity : str This is the granularity that you want the timeseries count data to - be grouped by. You can requeset ``minute``, ``hour``, or ``day`` + be grouped by. You can request ``minute``, ``hour``, or ``day`` granularity. The default granularity, if not specified is ``hour``. next_token : str This parameter is used to get the next 'page' of results. The value @@ -1104,7 +1104,7 @@ class Client: parameter. granularity : str This is the granularity that you want the timeseries count data to - be grouped by. You can requeset ``minute``, ``hour``, or ``day`` + be grouped by. You can request ``minute``, ``hour``, or ``day`` granularity. The default granularity, if not specified is ``hour``. since_id : Union[int, str] Returns results with a Tweet ID greater than (that is, more recent