X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=test%2Ftest_utils.py;h=9e1808e6bd10dbdab55884476c6a7d7446128f15;hb=a1ebfd449486ae5c4e8c38a38e6d5142ce4740e6;hp=aa4569b819e368381a9ee100a6060e38ae0ce065;hpb=a426ef6d783038e570db252a2e9e72800ffcb381;p=youtube-dl diff --git a/test/test_utils.py b/test/test_utils.py index aa4569b81..9e1808e6b 100644 --- a/test/test_utils.py +++ b/test/test_utils.py @@ -899,6 +899,7 @@ class TestUtil(unittest.TestCase): def test_clean_html(self): self.assertEqual(clean_html('a:\nb'), 'a: b') self.assertEqual(clean_html('a:\n "b"'), 'a: "b"') + self.assertEqual(clean_html('a\xa0b'), 'a\nb') def test_intlist_to_bytes(self): self.assertEqual( @@ -1069,6 +1070,47 @@ The first line ''' self.assertEqual(dfxp2srt(dfxp_data_no_default_namespace), srt_data) + dfxp_data_with_style = ''' + + + + + + + + + + + + default stylecustom style + part 1part 2 + line 3part 3 + inner style + + +''' + srt_data = '''1 +00:00:02,080 --> 00:00:05,839 +default stylecustom style + +2 +00:00:02,080 --> 00:00:05,839 +part 1 +part 2 + +3 +00:00:05,839 --> 00:00:09,560 +line 3 +part 3 + +4 +00:00:09,560 --> 00:00:12,359 +inner + style + +''' + self.assertEqual(dfxp2srt(dfxp_data_with_style), srt_data) + def test_cli_option(self): self.assertEqual(cli_option({'proxy': '127.0.0.1:3128'}, '--proxy', 'proxy'), ['--proxy', '127.0.0.1:3128']) self.assertEqual(cli_option({'proxy': None}, '--proxy', 'proxy'), [])
default stylecustom style
part 1part 2
line 3part 3
inner style