1
0
Fork 0
mirror of synced 2024-05-29 16:40:06 +12:00

Add some more Gallery tests

This commit is contained in:
Serene-Arc 2021-03-17 20:42:35 +10:00 committed by Ali Parlakci
parent ed26907e0d
commit 423155a846

View file

@ -8,6 +8,26 @@ from bulkredditdownloader.resource import Resource
from bulkredditdownloader.site_downloaders.gallery import Gallery
@pytest.mark.online
@pytest.mark.parametrize(('test_url', 'expected'), (
('https://www.reddit.com/gallery/m6lvrh', {
'https://preview.redd.it/18nzv9ch0hn61.jpg',
'https://preview.redd.it/jqkizcch0hn61.jpg',
'https://preview.redd.it/k0fnqzbh0hn61.jpg',
'https://preview.redd.it/m3gamzbh0hn61.jpg'
}),
('https://www.reddit.com/gallery/ljyy27', {
'https://preview.redd.it/04vxj25uqih61.png',
'https://preview.redd.it/0fnx83kpqih61.png',
'https://preview.redd.it/7zkmr1wqqih61.png',
'https://preview.redd.it/u37k5gxrqih61.png'
}),
))
def test_gallery_get_links(test_url: str, expected: set[str]):
results = Gallery._get_links(test_url)
assert set(results) == expected
@pytest.mark.online
@pytest.mark.reddit
@pytest.mark.parametrize(('test_submission_id', 'expected_len'), (