Fixing a test

This commit is contained in:
Michael Lazar
2017-06-08 01:12:57 -04:00
parent 979726ec6b
commit 690971355c
2 changed files with 68 additions and 34 deletions

View File

@@ -76,13 +76,14 @@ def test_oauth_terminal_mobile_authorize(reddit, terminal, config):
assert '.compact' in oauth.reddit.config.API_PATHS['authorize']
def test_oauth_authorize_invalid_token(oauth, terminal):
def test_oauth_authorize_invalid_token(oauth):
oauth.config.refresh_token = 'invalid_token'
oauth.authorize()
assert isinstance(oauth.term.loader.exception, InvalidRefreshToken)
assert oauth.server is None
assert oauth.config.refresh_token is None
assert isinstance(terminal.loader.exception, InvalidRefreshToken)
def test_oauth_authorize_with_refresh_token(oauth, refresh_token):
@@ -96,8 +97,10 @@ def test_oauth_authorize_with_refresh_token(oauth, refresh_token):
exception = OAuthException('', '')
oauth.reddit.refresh_access_information.side_effect = exception
oauth.authorize()
assert isinstance(oauth.term.loader.exception, OAuthException)
assert isinstance(oauth.term.loader.exception, InvalidRefreshToken)
assert oauth.server is None
assert oauth.config.refresh_token is None
def test_oauth_clear_data(oauth):