Add test for site downloader gallery

This commit is contained in:
Serene-Arc authored and Ali Parlakci committed 2021-04-18 16:43:55 +03:00
1 parent 1b40b16970
commit bb85fb8934
2 files changed
+26 -5

No files matched your search

@@ -0,0 +1,22 @@
#!/usr/bin/env python3
# coding=utf-8
import praw
import praw.models
import pytest
from bulkredditdownloader.resource import Resource
from bulkredditdownloader.site_downloaders.gallery import Gallery
@pytest.fixture()
def reddit_submission() -> praw.models.Submission:
rd = praw.Reddit(client_id='U-6gk4ZCh3IeNQ', client_secret='7CZHY6AmKweZME5s50SfDGylaPg', user_agent='test')
return rd.submission(id='ljyy27')
def test_gallery(reddit_submission: praw.models.Submission):
gallery = Gallery(reddit_submission)
results = gallery.download()
assert len(results) == 4
assert all([isinstance(result, Resource) for result in results])