Check for empty subreddit name.

This commit is contained in:
Michael Lazar
2016-06-14 00:59:18 -07:00
parent e8568c3fd6
commit 81e618b40b
2 changed files with 13 additions and 0 deletions

View File

@@ -259,6 +259,13 @@ def test_content_subreddit_from_name(reddit, terminal):
SubredditContent.from_name(reddit, name, terminal.loader)
assert isinstance(terminal.loader.exception, exceptions.SubredditError)
# A couple of edge cases
names = ['', '/', '//', '/////////////////']
for name in names:
with terminal.loader():
SubredditContent.from_name(reddit, name, terminal.loader)
assert isinstance(terminal.loader.exception, exceptions.SubredditError)
# Front page alias
name = '/r/front/rising'
content = SubredditContent.from_name(reddit, name, terminal.loader)