1
0
Fork 0
mirror of synced 2024-06-26 18:10:26 +12:00

Add additional test

This commit is contained in:
Serene-Arc 2021-03-28 10:05:45 +10:00 committed by Ali Parlakci
parent 49b0fac7c7
commit 8753fa0e45

View file

@ -36,12 +36,17 @@ def test_get_data_album(test_url: str, expected_gen_dict: dict, expected_image_d
assert any([all([image.get(key) == image_dict[key] for key in image_dict.keys()])
for image_dict in expected_image_dict for image in result['album_images']['images']])
@pytest.mark.online
@pytest.mark.parametrize(('test_url', 'expected_image_dict'), (
('https://i.imgur.com/dLk3FGY.gifv',
{'hash': 'dLk3FGY', 'title': '', 'ext': '.mp4', 'animated': True}),
{'hash': 'dLk3FGY', 'title': '', 'ext': '.mp4', 'animated': True}
),
('https://i.imgur.com/dLk3FGY.gifv',
{'hash': 'dLk3FGY', 'title': '', 'ext': '.mp4'}
),
))
def test_get_data_image(test_url: str, expected_image_dict: dict):
def test_get_data_gif(test_url: str, expected_image_dict: dict):
result = Imgur._get_data(test_url)
assert all([result.get(key) == expected_image_dict[key] for key in expected_image_dict.keys()])