Merge remote-tracking branch 'upstream/master'

This commit is contained in:
David Foucher
2016-07-30 12:52:37 +02:00
28 changed files with 1791 additions and 154 deletions

View File

@@ -329,20 +329,19 @@ def test_submission_urlview(submission_page, terminal, refresh_token):
submission_page.config.refresh_token = refresh_token
submission_page.oauth.authorize()
# Positive Case
# Submission case
data = submission_page.content.get(submission_page.nav.absolute_index)
data['body'] = 'test comment body'
with mock.patch.object(terminal, 'open_urlview') as open_urlview, \
mock.patch('subprocess.Popen'):
data['body'] = 'test comment body'
with mock.patch.object(terminal, 'open_urlview') as open_urlview:
submission_page.controller.trigger('b')
open_urlview.assert_called_with('test comment body')
open_urlview.assert_called_with('test comment body')
# Negative Case
# Subreddit case
data = submission_page.content.get(submission_page.nav.absolute_index)
data['text'] = ''
data['body'] = ''
data['url_full'] = 'http://test.url.com'
data['url_full'] = 'http://test.url.com'
with mock.patch.object(terminal, 'open_urlview') as open_urlview, \
mock.patch('subprocess.Popen'):
submission_page.controller.trigger('b')
open_urlview.assert_called_with('http://test.url.com')
open_urlview.assert_called_with('http://test.url.com')