More tests, coverage, and excluding lines from being covered
There are some lines that will never be hit in tests, excluding those from being covered!
This commit is contained in:
parent
00c0bd91a6
commit
acdf73a04e
6 changed files with 45 additions and 10 deletions
|
|
@ -84,10 +84,28 @@ class TwythonAPITestCase(unittest.TestCase):
|
|||
self.api.encode('Twython is awesome!')
|
||||
|
||||
def test_html_for_tweet(self):
|
||||
"""Test HTML for Twitter returns what we want"""
|
||||
"""Test HTML for Tweet returns what we want"""
|
||||
tweet_text = self.api.html_for_tweet(test_tweet_object)
|
||||
self.assertEqual(test_tweet_html, tweet_text)
|
||||
|
||||
def test_html_for_tweet_expanded_url(self):
|
||||
"""Test using expanded url in HTML for Tweet displays full urls"""
|
||||
tweet_text = self.api.html_for_tweet(test_tweet_object,
|
||||
use_expanded_url=True)
|
||||
# Make sure full url is in HTML
|
||||
self.assertTrue('http://google.com' in tweet_text)
|
||||
|
||||
def test_html_for_tweet_short_url(self):
|
||||
"""Test using expanded url in HTML for Tweet displays full urls"""
|
||||
tweet_text = self.api.html_for_tweet(test_tweet_object, False)
|
||||
# Make sure HTML doesn't contain the display OR exapanded url
|
||||
self.assertTrue(not 'http://google.com' in tweet_text)
|
||||
self.assertTrue(not 'google.com' in tweet_text)
|
||||
|
||||
def test_raise_error_on_bad_ssl_cert(self):
|
||||
"""Test TwythonError is raised by a RequestException when an actual HTTP happens"""
|
||||
self.assertRaises(TwythonError, self.api.get, 'https://example.com')
|
||||
|
||||
# Timelines
|
||||
def test_get_mentions_timeline(self):
|
||||
"""Test returning mentions timeline for authenticated user succeeds"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue