Merge branch 'master' into browser_osx

Conflicts:
	rtv/objects.py
This commit is contained in:
Michael Lazar
2015-12-03 21:18:40 -08:00
6 changed files with 45 additions and 57 deletions

View File

@@ -77,8 +77,7 @@ def test_oauth_authorize_with_refresh_token(oauth, stdscr, refresh_token):
exception = OAuthException('', '')
oauth.reddit.refresh_access_information.side_effect = exception
oauth.authorize()
message = 'Invalid OAuth data'.encode('utf-8')
stdscr.derwin().addstr.assert_called_with(1, 1, message)
assert isinstance(oauth.term.loader.exception, OAuthException)
assert oauth.http_server is None
@@ -149,8 +148,7 @@ def test_oauth_authorize(oauth, reddit, stdscr, refresh_token):
exception = OAuthException('', '')
oauth.reddit.get_access_information.side_effect = exception
oauth.authorize()
message = 'Invalid OAuth data'.encode('utf-8')
stdscr.derwin().addstr.assert_called_with(1, 1, message)
assert isinstance(oauth.term.loader.exception, OAuthException)
assert not oauth.config.save_refresh_token.called

View File

@@ -53,7 +53,7 @@ def test_objects_load_screen_exception_handled(terminal, stdscr, ascii):
assert not terminal.loader._is_running
assert not terminal.loader._animator.is_alive()
assert isinstance(terminal.loader.exception, requests.ConnectionError)
error_message = 'Connection Error'.encode('ascii' if ascii else 'utf-8')
error_message = 'ConnectionError'.encode('ascii' if ascii else 'utf-8')
stdscr.subwin.addstr.assert_called_with(1, 1, error_message)
@@ -152,7 +152,7 @@ def test_objects_load_screen_nested_complex(terminal, stdscr, ascii):
assert terminal.loader.depth == 0
assert not terminal.loader._is_running
assert not terminal.loader._animator.is_alive()
error_message = 'Connection Error'.encode('ascii' if ascii else 'utf-8')
error_message = 'ConnectionError'.encode('ascii' if ascii else 'utf-8')
stdscr.subwin.addstr.assert_called_once_with(1, 1, error_message)