diff options
author | Philipp Hagemeister <[email protected]> | 2013-10-15 12:05:13 +0200 |
---|---|---|
committer | Philipp Hagemeister <[email protected]> | 2013-10-15 12:05:13 +0200 |
commit | 9d4660cab15f374176f87d3f747a559142e4af9b (patch) | |
tree | 6b3fe1b19cc7ca4c8123a0e0dcd80508105f5028 /test/test_utils.py | |
parent | cd054fc491198a5a7c69d76f19693b1cd4d5c086 (diff) | |
download | youtube-dl-9d4660cab15f374176f87d3f747a559142e4af9b.tar.gz youtube-dl-9d4660cab15f374176f87d3f747a559142e4af9b.zip |
[generic] Support embedded vimeo videos (#1602)
Diffstat (limited to 'test/test_utils.py')
-rw-r--r-- | test/test_utils.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/test_utils.py b/test/test_utils.py index 270669044..f3fbff042 100644 --- a/test/test_utils.py +++ b/test/test_utils.py @@ -1,4 +1,5 @@ #!/usr/bin/env python +# coding: utf-8 # Allow direct execution import os @@ -21,6 +22,8 @@ from youtube_dl.utils import ( find_xpath_attr, get_meta_content, xpath_with_ns, + smuggle_url, + unsmuggle_url, ) if sys.version_info < (3, 0): @@ -155,5 +158,18 @@ class TestUtil(unittest.TestCase): self.assertEqual(find('media:song/media:author').text, u'The Author') self.assertEqual(find('media:song/url').text, u'http://server.com/download.mp3') + def test_smuggle_url(self): + data = {u"ö": u"ö", u"abc": [3]} + url = 'https://foo.bar/baz?x=y#a' + smug_url = smuggle_url(url, data) + unsmug_url, unsmug_data = unsmuggle_url(smug_url) + self.assertEqual(url, unsmug_url) + self.assertEqual(data, unsmug_data) + + res_url, res_data = unsmuggle_url(url) + self.assertEqual(res_url, url) + self.assertEqual(res_data, None) + + if __name__ == '__main__': unittest.main() |