Add test for unauthenticated instances
This commit is contained in:
parent
c4aa617737
commit
8db9d0bcc4
|
@ -242,6 +242,9 @@ class RedditConnector(metaclass=ABCMeta):
|
|||
if self.args.subreddit:
|
||||
out = []
|
||||
for reddit in self.split_args_input(self.args.subreddit):
|
||||
if reddit == 'friends' and self.authenticated is False:
|
||||
logger.error('Cannot read friends subreddit without an authenticated instance')
|
||||
continue
|
||||
try:
|
||||
reddit = self.reddit_instance.subreddit(reddit)
|
||||
try:
|
||||
|
|
|
@ -214,6 +214,7 @@ def test_cli_download_long(test_args: list[str], tmp_path: Path):
|
|||
['--subreddit', 'submitters', '-L', 10], # Private subreddit
|
||||
['--subreddit', 'donaldtrump', '-L', 10], # Banned subreddit
|
||||
['--user', 'djnish', '--user', 'helen_darten', '-m', 'cuteanimalpics', '-L', 10],
|
||||
['--subreddit', 'friends', '-L', 10],
|
||||
))
|
||||
def test_cli_download_soft_fail(test_args: list[str], tmp_path: Path):
|
||||
runner = CliRunner()
|
||||
|
|
Loading…
Reference in a new issue