X-Git-Url: http://git.cielonegro.org/gitweb.cgi?a=blobdiff_plain;f=test%2Ftest_utils.py;h=17017a8c082ea1a023b99ee3b248e5abc49cb56b;hb=79adb09baa26928e62f4c3b64b0ac011eed9de0c;hp=4e524aca3b80ae5359403b7bda8d052be4f8955b;hpb=ba9e68f40261355ceae5bb87c5707adc7f7beb2e;p=youtube-dl.git diff --git a/test/test_utils.py b/test/test_utils.py index 4e524aca3..17017a8c0 100644 --- a/test/test_utils.py +++ b/test/test_utils.py @@ -58,6 +58,8 @@ from youtube_dl.utils import ( xpath_text, render_table, match_str, + parse_dfxp_time_expr, + dfxp2srt, ) @@ -227,6 +229,7 @@ class TestUtil(unittest.TestCase): self.assertEqual( unified_strdate('2/2/2015 6:47:40 PM', day_first=False), '20150202') + self.assertEqual(unified_strdate('25-09-2014'), '20140925') def test_find_xpath_attr(self): testxml = ''' @@ -580,6 +583,42 @@ ffmpeg version 2.4.4 Copyright (c) 2000-2014 the FFmpeg ...'''), '2.4.4') 'like_count > 100 & dislike_count + + +
+

The following line contains Chinese characters and special symbols

+

第二行
♪♪

+

Third
Line

+
+ +
''' + srt_data = '''1 +00:00:00,000 --> 00:00:01,000 +The following line contains Chinese characters and special symbols + +2 +00:00:01,000 --> 00:00:02,000 +第二行 +♪♪ + +3 +00:00:02,000 --> 00:00:03,000 +Third +Line + +''' + self.assertEqual(dfxp2srt(dfxp_data), srt_data) + if __name__ == '__main__': unittest.main()