WIP: General cursor (generator) like object for Twython functions #241

Merged
michaelhelmick merged 10 commits from dev/cursor into master 2013-07-20 12:01:29 -07:00
2 changed files with 3 additions and 3 deletions
Showing only changes of commit 2dc15b7030 - Show all commits

View file

@ -65,9 +65,9 @@ class TwythonAPITestCase(unittest.TestCase):
self.assertRaises(TwythonError, self.api.get_lastfunction_header, self.assertRaises(TwythonError, self.api.get_lastfunction_header,
'no-api-call-was-made') 'no-api-call-was-made')
def test_search_gen(self): def test_cursor(self):
"""Test looping through the generator results works, at least once that is""" """Test looping through the generator results works, at least once that is"""
search = self.api.search_gen('twitter', count=1) search = self.api.cursor(self.api.search, q='twitter', count=1)
counter = 0 counter = 0
while counter < 2: while counter < 2:
counter += 1 counter += 1

View file

@ -362,7 +362,7 @@ class Twython(EndpointsMixin, object):
) )
return '%s?%s' % (api_url, '&'.join(querystring)) return '%s?%s' % (api_url, '&'.join(querystring))
def search_gen(self, search_query, **params): def search_gen(self, search_query, **params): # pragma: no cover
"""Returns a generator of tweets that match a specified query. """Returns a generator of tweets that match a specified query.
Documentation: https://dev.twitter.com/docs/api/1.1/get/search/tweets Documentation: https://dev.twitter.com/docs/api/1.1/get/search/tweets