From 2dc15b703050bb9ba261cf13f497d96597cd3c4c Mon Sep 17 00:00:00 2001 From: Mike Helmick Date: Thu, 18 Jul 2013 20:43:02 -0400 Subject: [PATCH] Fix generator test, remove search_gen from coverage --- tests/test_core.py | 4 ++-- twython/api.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/test_core.py b/tests/test_core.py index 5466160..1de68f1 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -65,9 +65,9 @@ class TwythonAPITestCase(unittest.TestCase): self.assertRaises(TwythonError, self.api.get_lastfunction_header, '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""" - search = self.api.search_gen('twitter', count=1) + search = self.api.cursor(self.api.search, q='twitter', count=1) counter = 0 while counter < 2: counter += 1 diff --git a/twython/api.py b/twython/api.py index f9271ca..6a99a7d 100644 --- a/twython/api.py +++ b/twython/api.py @@ -362,7 +362,7 @@ class Twython(EndpointsMixin, object): ) 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. Documentation: https://dev.twitter.com/docs/api/1.1/get/search/tweets