X-Git-Url: https://git.rapsys.eu/youtubedl/blobdiff_plain/c7b4d76a372777e3af76ecf9966a8ab9952e52f4..80f96043cb349c4235e242e323556f561d147911:/test/test_utils.py
diff --git a/test/test_utils.py b/test/test_utils.py
index c4b7136..f3fbff0 100644
--- a/test/test_utils.py
+++ b/test/test_utils.py
@@ -1,21 +1,30 @@
#!/usr/bin/env python
+# coding: utf-8
-# Various small unit tests
-
+# Allow direct execution
+import os
import sys
import unittest
+sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
-# Allow direct execution
-import os
-sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
+
+# Various small unit tests
+import xml.etree.ElementTree
#from youtube_dl.utils import htmlentity_transform
-from youtube_dl.utils import timeconvert
-from youtube_dl.utils import sanitize_filename
-from youtube_dl.utils import unescapeHTML
-from youtube_dl.utils import orderedSet
-from youtube_dl.utils import DateRange
-from youtube_dl.utils import unified_strdate
+from youtube_dl.utils import (
+ timeconvert,
+ sanitize_filename,
+ unescapeHTML,
+ orderedSet,
+ DateRange,
+ unified_strdate,
+ find_xpath_attr,
+ get_meta_content,
+ xpath_with_ns,
+ smuggle_url,
+ unsmuggle_url,
+)
if sys.version_info < (3, 0):
_compat_str = lambda b: b.decode('unicode-escape')
@@ -112,5 +121,55 @@ class TestUtil(unittest.TestCase):
self.assertEqual(unified_strdate('Dec 14, 2012'), '20121214')
self.assertEqual(unified_strdate('2012/10/11 01:56:38 +0000'), '20121011')
+ def test_find_xpath_attr(self):
+ testxml = u'''