youtube-dl

Another place where youtube-dl lives on
git clone git://git.oshgnacknak.de/youtube-dl.git
Log | Files | Refs | README | LICENSE

commit 5035536e3f32d4c47b2d3067c12e074cb9a4a199
parent 3e12bc583af9d5abf5f144ed6e092c59f4b83fdf
Author: Sergey M․ <dstftw@gmail.com>
Date:   Sun, 22 Nov 2015 06:33:52 +0600

[test_utils] Add tests for determine_ext

Diffstat:
Mtest/test_utils.py | 5+++++
1 file changed, 5 insertions(+), 0 deletions(-)

diff --git 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, + determine_ext, 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) + 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/>