projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
3e12bc5
)
[test_utils] Add tests for determine_ext
author
Sergey M․
<dstftw@gmail.com>
Sun, 22 Nov 2015 00:33:52 +0000
(06:33 +0600)
committer
Sergey M․
<dstftw@gmail.com>
Sun, 22 Nov 2015 00:33:52 +0000
(06:33 +0600)
test/test_utils.py
patch
|
blob
|
history
diff --git
a/test/test_utils.py
b/test/test_utils.py
index ea1ff0547cbb1e9dd081fb6b90243c0269d7d9ef..4f0d9e4819e721c9c61665e87c24e6af1fa1fd09 100644
(file)
--- a/
test/test_utils.py
+++ b/
test/test_utils.py
@@
-21,6
+21,7
@@
from youtube_dl.utils import (
clean_html,
DateRange,
detect_exe_version,
clean_html,
DateRange,
detect_exe_version,
+ determine_ext,
encodeFilename,
escape_rfc3986,
escape_url,
encodeFilename,
escape_rfc3986,
escape_url,
@@
-238,6
+239,10
@@
class TestUtil(unittest.TestCase):
self.assertEqual(unified_strdate('25-09-2014'), '20140925')
self.assertEqual(unified_strdate('UNKNOWN DATE FORMAT'), None)
self.assertEqual(unified_strdate('25-09-2014'), '20140925')
self.assertEqual(unified_strdate('UNKNOWN DATE FORMAT'), None)
+ 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)
+
def test_find_xpath_attr(self):
testxml = '''<root>
<node/>
def test_find_xpath_attr(self):
testxml = '''<root>
<node/>