Update tests
This commit is contained in:
@@ -53,10 +53,6 @@ def test_gallery_get_links(test_ids: list[dict], expected: set[str]):
|
|||||||
'808c35267f44acb523ce03bfa5687404',
|
'808c35267f44acb523ce03bfa5687404',
|
||||||
'ec8b65bdb7f1279c4b3af0ea2bbb30c3',
|
'ec8b65bdb7f1279c4b3af0ea2bbb30c3',
|
||||||
}),
|
}),
|
||||||
('nxyahw', {
|
|
||||||
'b89a3f41feb73ec1136ec4ffa7353eb1',
|
|
||||||
'cabb76fd6fd11ae6e115a2039eb09f04',
|
|
||||||
}),
|
|
||||||
('obkflw', {
|
('obkflw', {
|
||||||
'65163f685fb28c5b776e0e77122718be',
|
'65163f685fb28c5b776e0e77122718be',
|
||||||
'2a337eb5b13c34d3ca3f51b5db7c13e9',
|
'2a337eb5b13c34d3ca3f51b5db7c13e9',
|
||||||
@@ -73,6 +69,7 @@ def test_gallery_download(test_submission_id: str, expected_hashes: set[str], re
|
|||||||
|
|
||||||
@pytest.mark.parametrize('test_id', (
|
@pytest.mark.parametrize('test_id', (
|
||||||
'n0pyzp',
|
'n0pyzp',
|
||||||
|
'nxyahw',
|
||||||
))
|
))
|
||||||
def test_gallery_download_raises_right_error(test_id: str, reddit_instance: praw.Reddit):
|
def test_gallery_download_raises_right_error(test_id: str, reddit_instance: praw.Reddit):
|
||||||
test_submission = reddit_instance.submission(id=test_id)
|
test_submission = reddit_instance.submission(id=test_id)
|
||||||
|
|||||||
@@ -13,8 +13,6 @@ from bdfr.site_downloaders.gfycat import Gfycat
|
|||||||
@pytest.mark.parametrize(('test_url', 'expected_url'), (
|
@pytest.mark.parametrize(('test_url', 'expected_url'), (
|
||||||
('https://gfycat.com/definitivecaninecrayfish', 'https://giant.gfycat.com/DefinitiveCanineCrayfish.mp4'),
|
('https://gfycat.com/definitivecaninecrayfish', 'https://giant.gfycat.com/DefinitiveCanineCrayfish.mp4'),
|
||||||
('https://gfycat.com/dazzlingsilkyiguana', 'https://giant.gfycat.com/DazzlingSilkyIguana.mp4'),
|
('https://gfycat.com/dazzlingsilkyiguana', 'https://giant.gfycat.com/DazzlingSilkyIguana.mp4'),
|
||||||
('https://gfycat.com/webbedimpurebutterfly', 'https://thumbs2.redgifs.com/WebbedImpureButterfly.mp4'),
|
|
||||||
('https://gfycat.com/CornyLoathsomeHarrierhawk', 'https://thumbs2.redgifs.com/CornyLoathsomeHarrierhawk.mp4')
|
|
||||||
))
|
))
|
||||||
def test_get_link(test_url: str, expected_url: str):
|
def test_get_link(test_url: str, expected_url: str):
|
||||||
result = Gfycat._get_link(test_url)
|
result = Gfycat._get_link(test_url)
|
||||||
|
|||||||
@@ -15,10 +15,8 @@ from bdfr.site_downloaders.redgifs import Redgifs
|
|||||||
'https://thumbs2.redgifs.com/FrighteningVictoriousSalamander.mp4'),
|
'https://thumbs2.redgifs.com/FrighteningVictoriousSalamander.mp4'),
|
||||||
('https://redgifs.com/watch/springgreendecisivetaruca',
|
('https://redgifs.com/watch/springgreendecisivetaruca',
|
||||||
'https://thumbs2.redgifs.com/SpringgreenDecisiveTaruca.mp4'),
|
'https://thumbs2.redgifs.com/SpringgreenDecisiveTaruca.mp4'),
|
||||||
('https://www.gifdeliverynetwork.com/regalshoddyhorsechestnutleafminer',
|
('https://www.redgifs.com/watch/palegoldenrodrawhalibut',
|
||||||
'https://thumbs2.redgifs.com/RegalShoddyHorsechestnutleafminer.mp4'),
|
'https://thumbs2.redgifs.com/PalegoldenrodRawHalibut.mp4'),
|
||||||
('https://www.gifdeliverynetwork.com/maturenexthippopotamus',
|
|
||||||
'https://thumbs2.redgifs.com/MatureNextHippopotamus.mp4'),
|
|
||||||
))
|
))
|
||||||
def test_get_link(test_url: str, expected: str):
|
def test_get_link(test_url: str, expected: str):
|
||||||
result = Redgifs._get_link(test_url)
|
result = Redgifs._get_link(test_url)
|
||||||
@@ -29,9 +27,8 @@ def test_get_link(test_url: str, expected: str):
|
|||||||
@pytest.mark.parametrize(('test_url', 'expected_hash'), (
|
@pytest.mark.parametrize(('test_url', 'expected_hash'), (
|
||||||
('https://redgifs.com/watch/frighteningvictorioussalamander', '4007c35d9e1f4b67091b5f12cffda00a'),
|
('https://redgifs.com/watch/frighteningvictorioussalamander', '4007c35d9e1f4b67091b5f12cffda00a'),
|
||||||
('https://redgifs.com/watch/springgreendecisivetaruca', '8dac487ac49a1f18cc1b4dabe23f0869'),
|
('https://redgifs.com/watch/springgreendecisivetaruca', '8dac487ac49a1f18cc1b4dabe23f0869'),
|
||||||
('https://www.gifdeliverynetwork.com/maturenexthippopotamus', '9bec0a9e4163a43781368ed5d70471df'),
|
|
||||||
('https://www.gifdeliverynetwork.com/regalshoddyhorsechestnutleafminer', '8afb4e2c090a87140230f2352bf8beba'),
|
|
||||||
('https://redgifs.com/watch/leafysaltydungbeetle', '076792c660b9c024c0471ef4759af8bd'),
|
('https://redgifs.com/watch/leafysaltydungbeetle', '076792c660b9c024c0471ef4759af8bd'),
|
||||||
|
('https://www.redgifs.com/watch/palegoldenrodrawhalibut', '46d5aa77fe80c6407de1ecc92801c10e'),
|
||||||
))
|
))
|
||||||
def test_download_resource(test_url: str, expected_hash: str):
|
def test_download_resource(test_url: str, expected_hash: str):
|
||||||
mock_submission = Mock()
|
mock_submission = Mock()
|
||||||
|
|||||||
Reference in New Issue
Block a user