Fixing tests and adding cassettes

This commit is contained in:
Michael Lazar
2018-08-04 01:42:43 -04:00
parent b959b5d4bd
commit b8fb0cf418
8 changed files with 8866 additions and 2143 deletions

View File

@@ -18,7 +18,7 @@ try:
from unittest import mock
except ImportError:
import mock
# Test entering a bunch of text into the prompt
# (text, parsed subreddit, parsed order)
SUBREDDIT_PROMPTS = OrderedDict([
@@ -31,8 +31,7 @@ SUBREDDIT_PROMPTS = OrderedDict([
('top', ('pics/top', '/r/pics', 'top')),
('rising', ('r/pics/rising', '/r/pics', 'rising')),
('controversial', ('/r/pics/controversial', '/r/pics', 'controversial')),
# Need a cassette for this, I think
# ('gilded', ('/r/pics/gilded', '/r/pics', 'gilded')),
('gilded', ('/r/pics/gilded', '/r/pics', 'gilded')),
('top-day', ('/r/pics/top-day', '/r/pics', 'top-day')),
('top-hour', ('/r/pics/top-hour', '/r/pics', 'top-hour')),
('top-month', ('/r/pics/top-month', '/r/pics', 'top-month')),
@@ -458,6 +457,14 @@ def test_content_subreddit_random(reddit, terminal):
assert content.name != name
def test_content_subreddit_gilded(reddit, terminal):
name = '/r/python/gilded'
content = SubredditContent.from_name(reddit, name, terminal.loader)
assert content.order == 'gilded'
assert content.get(0)['object'].gilded
def test_content_subreddit_me(reddit, oauth, refresh_token, terminal):
# Not logged in