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:
Mike Helmick 2013-06-27 22:37:02 -04:00
parent 00c0bd91a6
commit acdf73a04e
6 changed files with 45 additions and 10 deletions

View file

@ -11,6 +11,8 @@ class TwythonAuthTestCase(unittest.TestCase):
self.bad_api = Twython('BAD_APP_KEY', 'BAD_APP_SECRET')
self.oauth2_api = Twython(app_key, app_secret, oauth_version=2)
self.oauth2_bad_api = Twython('BAD_APP_KEY', 'BAD_APP_SECRET',
oauth_version=2)
def test_get_authentication_tokens(self):
"""Test getting authentication tokens works"""
@ -44,6 +46,11 @@ class TwythonAuthTestCase(unittest.TestCase):
"""Test obtaining an Application Only OAuth 2 access token succeeds"""
self.oauth2_api.obtain_access_token()
def test_obtain_access_token_bad_tokens(self):
"""Test obtaining an Application Only OAuth 2 access token using bad app tokens fails"""
self.assertRaises(TwythonAuthError,
self.oauth2_bad_api.obtain_access_token)
def test_obtain_access_token_raises_error_when_oauth1(self):
"""Test when API is set for OAuth 1, obtain_access_token raises a
TwythonError"""