Fixing error handling for the inbox command
This commit is contained in:
@@ -8,6 +8,7 @@ import six
|
||||
from rtv import __version__
|
||||
from rtv.subreddit_page import SubredditPage
|
||||
from rtv.packages.praw.errors import NotFound, HTTPException
|
||||
from requests.exceptions import ReadTimeout
|
||||
|
||||
try:
|
||||
from unittest import mock
|
||||
@@ -387,6 +388,20 @@ def test_subreddit_open_subscriptions(subreddit_page, refresh_token):
|
||||
assert loop.called
|
||||
|
||||
|
||||
def test_subreddit_get_inbox_timeout(subreddit_page, refresh_token, terminal):
|
||||
|
||||
# Log in
|
||||
subreddit_page.config.refresh_token = refresh_token
|
||||
subreddit_page.oauth.authorize()
|
||||
|
||||
subreddit_page.reddit.config.timeout = 0.00000001
|
||||
subreddit_page.controller.trigger('i')
|
||||
|
||||
text = 'HTTP request timed out'.encode('utf-8')
|
||||
terminal.stdscr.subwin.addstr.assert_called_with(1, 1, text)
|
||||
assert isinstance(terminal.loader.exception, ReadTimeout)
|
||||
|
||||
|
||||
def test_subreddit_open_multireddits(subreddit_page, refresh_token):
|
||||
|
||||
# Log in
|
||||
|
||||
Reference in New Issue
Block a user