X-Git-Url: https://git.rapsys.eu/youtubedl/blobdiff_plain/28d5370e4a3ed87a622c07b81844b14420e5bcba..bc5059672e222ec4df4fe3983c399c0d0fca84d5:/test/test_utils.py
diff --git a/test/test_utils.py b/test/test_utils.py
index c4b7136..e9e590e 100644
--- a/test/test_utils.py
+++ b/test/test_utils.py
@@ -1,21 +1,32 @@
#!/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,
+ shell_quote,
+ encodeFilename,
+)
if sys.version_info < (3, 0):
_compat_str = lambda b: b.decode('unicode-escape')
@@ -112,5 +123,59 @@ 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'''