aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2019-10-18 04:03:53 +0700
committerSergey M․ <dstftw@gmail.com>2019-10-18 04:03:53 +0700
commit824fa51165d92ceee01589bf995ebbf009df328c (patch)
tree20c31ecdef57d2ce71de14462ed4dcc0fdd58d2a /test
parent34e3885bc9e3aecab104b96eabce03854ac8f7a2 (diff)
[utils] Improve subtitles_filename (closes #22753)
Diffstat (limited to 'test')
-rw-r--r--test/test_utils.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/test_utils.py b/test/test_utils.py
index 659c6ece5..3920542bb 100644
--- a/test/test_utils.py
+++ b/test/test_utils.py
@@ -74,6 +74,7 @@ from youtube_dl.utils import (
str_to_int,
strip_jsonp,
strip_or_none,
+ subtitles_filename,
timeconvert,
unescapeHTML,
unified_strdate,
@@ -261,6 +262,11 @@ class TestUtil(unittest.TestCase):
self.assertEqual(replace_extension('.abc', 'temp'), '.abc.temp')
self.assertEqual(replace_extension('.abc.ext', 'temp'), '.abc.temp')
+ def test_subtitles_filename(self):
+ self.assertEqual(subtitles_filename('abc.ext', 'en', 'vtt'), 'abc.en.vtt')
+ self.assertEqual(subtitles_filename('abc.ext', 'en', 'vtt', 'ext'), 'abc.en.vtt')
+ self.assertEqual(subtitles_filename('abc.unexpected_ext', 'en', 'vtt', 'ext'), 'abc.unexpected_ext.en.vtt')
+
def test_remove_start(self):
self.assertEqual(remove_start(None, 'A - '), None)
self.assertEqual(remove_start('A - B', 'A - '), 'B')