aboutsummaryrefslogtreecommitdiff
path: root/test/test_utils.py
diff options
context:
space:
mode:
authorYen Chi Hsuan <yan12125@gmail.com>2015-04-08 17:26:51 +0800
committerYen Chi Hsuan <yan12125@gmail.com>2015-04-08 17:26:51 +0800
commit418c5cc3fc3ea99b791ad1774a6b03504eab7086 (patch)
treee5d7d597e173c26138af915b15b0522c130a324f /test/test_utils.py
parentde5c54564874fd870fdfe3fd24f47e3e5f6cedf7 (diff)
[udn] Add new extractor
Diffstat (limited to 'test/test_utils.py')
-rw-r--r--test/test_utils.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/test_utils.py b/test/test_utils.py
index 2e3a6480c..8291edd9a 100644
--- a/test/test_utils.py
+++ b/test/test_utils.py
@@ -53,6 +53,7 @@ from youtube_dl.utils import (
uppercase_escape,
url_basename,
urlencode_postdata,
+ url_infer_protocol,
version_tuple,
xpath_with_ns,
xpath_text,
@@ -296,6 +297,10 @@ class TestUtil(unittest.TestCase):
url_basename('http://media.w3.org/2010/05/sintel/trailer.mp4'),
'trailer.mp4')
+ def test_url_infer_protocol(self):
+ self.assertEqual(url_infer_protocol('http://foo.com/', '//bar.com/'), 'http://bar.com/')
+ self.assertEqual(url_infer_protocol('http://foo.com/', 'https://bar.com/'), 'https://bar.com/')
+
def test_parse_duration(self):
self.assertEqual(parse_duration(None), None)
self.assertEqual(parse_duration(False), None)