Skip to content

Commit

Permalink
added empty test
Browse files Browse the repository at this point in the history
  • Loading branch information
ckoepp committed Dec 28, 2013
1 parent 7115dfb commit 55d5c3f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
1 change: 1 addition & 0 deletions tests/mock-data/empty.log
@@ -0,0 +1 @@
{"statuses":[]}
21 changes: 18 additions & 3 deletions tests/test_ts.py
Expand Up @@ -30,7 +30,7 @@ def setUp(self):
################ TESTS #########################

@httpretty.activate
def test_TS_setSupportedLanguages(self):
def test_TS_set_supported_languages(self):
""" Tests TwitterSearch.setSupportedLanguages() """

httpretty.register_uri(
Expand Down Expand Up @@ -89,7 +89,7 @@ def test_TS_authenticate_fail(self):
self.assertEqual(e.code, 401, "Exception code should be 401 but is %i" % e.code)

@httpretty.activate
def test_TS_searchTweetsIterable(self):
def test_TS_search_tweets_iterable(self):
""" Tests TwitterSearch.searchTweetsIterable() and .getStatistics() """

httpretty.register_uri(httpretty.GET, self.search_url,
Expand Down Expand Up @@ -120,7 +120,22 @@ def test_TS_searchTweetsIterable(self):


@httpretty.activate
def test_TS_searchTweets(self):
def test_TS_empty_results(self):
""" Tests TwitterSearch.searchTweetsIterable() with empty results """

httpretty.register_uri(httpretty.GET, self.search_url,
responses=[
httpretty.Response(streaming=True, status=200, content_type='text/json', body=self.apiAnsweringMachine('tests/mock-data/empty.log')),
])

tso = self.createTSO()
ts = self.createTS()
for tweet in ts.searchTweetsIterable(tso):
self.assertFalse(True, "There should be no tweets to be found")


@httpretty.activate
def test_TS_search_tweets(self):
""" Tests TwitterSearch.searchTweets() """

httpretty.register_uri(httpretty.GET, self.search_url,
Expand Down

0 comments on commit 55d5c3f

Please sign in to comment.