Tweaked exception wording.
This commit is contained in:
@@ -116,6 +116,7 @@ class LoadScreen(object):
|
||||
(praw.errors.OAuthException, 'Not logged in'),
|
||||
(praw.errors.OAuthScopeRequired, 'Not logged in'),
|
||||
(praw.errors.LoginRequired, 'Not logged in'),
|
||||
(praw.errors.InvalidCaptcha, 'Error, captcha required'),
|
||||
(praw.errors.PRAWException, '{0.__class__.__name__}'),
|
||||
(requests.exceptions.RequestException, '{0.__class__.__name__}'),
|
||||
]
|
||||
|
||||
@@ -184,7 +184,7 @@ class Page(object):
|
||||
|
||||
prompt = 'Are you sure you want to delete this? (y/n): '
|
||||
if not self.term.prompt_y_or_n(prompt):
|
||||
self.term.show_notification('Aborted')
|
||||
self.term.show_notification('Canceled')
|
||||
return
|
||||
|
||||
with self.term.loader('Deleting', delay=0):
|
||||
@@ -220,7 +220,7 @@ class Page(object):
|
||||
|
||||
text = self.term.open_editor(info)
|
||||
if text == content:
|
||||
self.term.show_notification('Aborted')
|
||||
self.term.show_notification('Canceled')
|
||||
return
|
||||
|
||||
with self.term.loader('Editing', delay=0):
|
||||
|
||||
@@ -104,7 +104,7 @@ class SubmissionPage(Page):
|
||||
|
||||
comment = self.term.open_editor(comment_info)
|
||||
if not comment:
|
||||
self.term.show_notification('Aborted')
|
||||
self.term.show_notification('Canceled')
|
||||
return
|
||||
|
||||
with self.term.loader('Posting', delay=0):
|
||||
|
||||
@@ -121,7 +121,7 @@ class SubredditPage(Page):
|
||||
submission_info = docs.SUBMISSION_FILE.format(name=name)
|
||||
text = self.term.open_editor(submission_info)
|
||||
if not text or '\n' not in text:
|
||||
self.term.show_notification('Aborted')
|
||||
self.term.show_notification('Canceled')
|
||||
return
|
||||
|
||||
title, content = text.split('\n', 1)
|
||||
|
||||
@@ -303,7 +303,7 @@ class Terminal(object):
|
||||
# If it blocks or returns an error, something went wrong.
|
||||
try:
|
||||
start = time.time()
|
||||
while time.time() - start < 5:
|
||||
while time.time() - start < 10:
|
||||
code = p.poll()
|
||||
if code == 0:
|
||||
break # Success
|
||||
|
||||
@@ -142,7 +142,7 @@ def test_subreddit_post(subreddit_page, terminal, reddit, refresh_token):
|
||||
with mock.patch.object(terminal, 'open_editor'):
|
||||
terminal.open_editor.return_value = 'title'
|
||||
subreddit_page.controller.trigger('c')
|
||||
text = "Aborted".encode('utf-8')
|
||||
text = 'Canceled'.encode('utf-8')
|
||||
terminal.stdscr.subwin.addstr.assert_called_with(1, 1, text)
|
||||
|
||||
# Post a fake submission
|
||||
|
||||
Reference in New Issue
Block a user