1
0
Fork 0
mirror of synced 2024-10-01 01:30:52 +13:00
bulk-downloader-for-reddit/tests/site_downloaders/test_vreddit.py

24 lines
649 B
Python
Raw Normal View History

2021-03-01 17:53:07 +13:00
#!/usr/bin/env python3
# coding=utf-8
import praw
import pytest
2021-04-12 19:58:32 +12:00
from bdfr.resource import Resource
from bdfr.site_downloaders.vreddit import VReddit
2021-03-01 17:53:07 +13:00
@pytest.mark.online
@pytest.mark.reddit
2021-04-23 23:05:49 +12:00
@pytest.mark.parametrize('test_submission_id', (
'lu8l8g',
2021-03-01 17:53:07 +13:00
))
2021-04-17 23:07:20 +12:00
def test_find_resources(test_submission_id: str, reddit_instance: praw.Reddit):
2021-03-01 17:53:07 +13:00
test_submission = reddit_instance.submission(id=test_submission_id)
downloader = VReddit(test_submission)
resources = downloader.find_resources()
assert len(resources) == 1
assert isinstance(resources[0], Resource)
resources[0].download(120)
2021-04-17 23:07:20 +12:00
assert resources[0].content is not None