X-Git-Url: https://jfr.im/git/z_archive/twitter.git/blobdiff_plain/066c34e005854a056592aa2a0666f27db7b17d1e..57b544372e9aa8a41f9bdc84812d505a8730e3c6:/tests/test_sanity.py diff --git a/tests/test_sanity.py b/tests/test_sanity.py index 1adb04a..0f2389c 100644 --- a/tests/test_sanity.py +++ b/tests/test_sanity.py @@ -1,6 +1,7 @@ # encoding: utf8 from random import choice +import time from twitter import Twitter, NoAuth, OAuth, read_token_file from twitter.cmdline import CONSUMER_KEY, CONSUMER_SECRET @@ -30,9 +31,11 @@ def test_API_get_some_public_tweets(): def test_API_set_tweet(): random_tweet = "A random tweet " + get_random_str() twitter.statuses.update(status=random_tweet) - + time.sleep(2) recent = twitter.statuses.user_timeline() assert recent + assert isinstance(recent.rate_limit_remaining, int) + assert isinstance(recent.rate_limit_reset, int) assert random_tweet == recent[0]['text'] @@ -56,3 +59,16 @@ def test_search(): t_search = Twitter(domain='search.twitter.com') results = t_search.search(q='foo') assert results + + +def test_get_trends(): + # This is one method of inserting parameters, using named + # underscore params. + world_trends = twitter.trends._woeid(_woeid=1) + assert world_trends + + +def test_get_trends_2(): + # This is a nicer variation of the same call as above. + world_trends = twitter.trends._(1) + assert world_trends