aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2016-09-14 23:13:55 +0700
committerSergey M․ <dstftw@gmail.com>2016-09-14 23:59:38 +0700
commitf6717dec8abe7c0d34e704732b53665a9415fa2e (patch)
treef0fdffc8864a9ebc9304a545ed66a8f7ca2ca4fd /test
parenta942d6cb48994c5ff14ccef8773fb086a5544970 (diff)
[utils] Improve month_by_name and add tests
Diffstat (limited to 'test')
-rw-r--r--test/test_utils.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/test_utils.py b/test/test_utils.py
index 405c5d351..4ebca8744 100644
--- a/test/test_utils.py
+++ b/test/test_utils.py
@@ -40,6 +40,7 @@ from youtube_dl.utils import (
js_to_json,
limit_length,
mimetype2ext,
+ month_by_name,
ohdave_rsa_encrypt,
OnDemandPagedList,
orderedSet,
@@ -634,6 +635,16 @@ class TestUtil(unittest.TestCase):
self.assertEqual(mimetype2ext('text/vtt;charset=utf-8'), 'vtt')
self.assertEqual(mimetype2ext('text/html; charset=utf-8'), 'html')
+ def test_month_by_name(self):
+ self.assertEqual(month_by_name(None), None)
+ self.assertEqual(month_by_name('December', 'en'), 12)
+ self.assertEqual(month_by_name('decembre', 'fr'), 12)
+ self.assertEqual(month_by_name('December'), 12)
+ self.assertEqual(month_by_name('decembre'), None)
+ self.assertEqual(month_by_name('Unknown', 'unknown'), None)
+
+ def test_m
+
def test_parse_codecs(self):
self.assertEqual(parse_codecs(''), {})
self.assertEqual(parse_codecs('avc1.77.30, mp4a.40.2'), {