Fix time filters (#279)

This commit is contained in:
Serene
2021-04-18 21:24:11 +10:00
committed by Ali Parlakci
parent aefe8b79b6
commit b37ff0714f
7 changed files with 121 additions and 62 deletions

View File

@@ -1,9 +1,10 @@
#!/usr/bin/env python3
# coding=utf-8
import pytest
from unittest.mock import MagicMock
import pytest
from bdfr.resource import Resource
@@ -15,8 +16,9 @@ from bdfr.resource import Resource
('https://www.resource.com/test/example.jpg', '.jpg'),
('hard.png.mp4', '.mp4'),
('https://preview.redd.it/7zkmr1wqqih61.png?width=237&format=png&auto=webp&s=19de214e634cbcad99', '.png'),
('test.jpg#test','.jpg'),
('test.jpg?width=247#test','.jpg'),
('test.jpg#test', '.jpg'),
('test.jpg?width=247#test', '.jpg'),
('https://www.test.com/test/test2/example.png?random=test#thing', '.png'),
))
def test_resource_get_extension(test_url: str, expected: str):
test_resource = Resource(MagicMock(), test_url)