X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=test%2Ftest_utils.py;h=4f0ffd4824506f2f171e8b0e374d034d6ae8ccea;hb=dc03a42537cba83597ca8acb2bbe03f686f2136c;hp=28bda654e2bc88a41d7145b73c59a621cb0d94cc;hpb=f18ef2d14463a13d80e967d1b18ece6a076f60fa;p=youtube-dl diff --git a/test/test_utils.py b/test/test_utils.py index 28bda654e..4f0ffd482 100644 --- a/test/test_utils.py +++ b/test/test_utils.py @@ -55,6 +55,7 @@ from youtube_dl.utils import ( xpath_with_ns, render_table, match_str, + url_sanitize_consecutive_slashes, ) @@ -163,6 +164,11 @@ class TestUtil(unittest.TestCase): self.assertEqual(sanitize_path('abc.../def'), 'abc..#\\def') self.assertEqual(sanitize_path('abc.../def...'), 'abc..#\\def..#') + self.assertEqual(sanitize_path('../abc'), '..\\abc') + self.assertEqual(sanitize_path('../../abc'), '..\\..\\abc') + self.assertEqual(sanitize_path('./abc'), 'abc') + self.assertEqual(sanitize_path('./../abc'), '..\\abc') + def test_ordered_set(self): self.assertEqual(orderedSet([1, 1, 2, 3, 4, 4, 5, 6, 7, 3, 5]), [1, 2, 3, 4, 5, 6, 7]) self.assertEqual(orderedSet([]), []) @@ -533,6 +539,21 @@ ffmpeg version 2.4.4 Copyright (c) 2000-2014 the FFmpeg ...'''), '2.4.4') 'like_count > 100 & dislike_count