[utils] Check ext with trailing slash against the list of known extensions

This commit is contained in:
Sergey M․ 2015-11-22 17:27:13 +06:00
parent 5035536e3f
commit 9cb9a5df77
2 changed files with 19 additions and 1 deletions

View file

@ -242,6 +242,9 @@ class TestUtil(unittest.TestCase):
def test_determine_ext(self):
self.assertEqual(determine_ext('http://example.com/foo/bar.mp4/?download'), 'mp4')
self.assertEqual(determine_ext('http://example.com/foo/bar/?download', None), None)
self.assertEqual(determine_ext('http://example.com/foo/bar.nonext/?download', None), None)
self.assertEqual(determine_ext('http://example.com/foo/bar/mp4?download', None), None)
self.assertEqual(determine_ext('http://example.com/foo/bar.m3u8//?download'), 'm3u8')
def test_find_xpath_attr(self):
testxml = '''<root>