]> gitweb @ CieloNegro.org - youtube-dl.git/commitdiff
[test_utils] add test for smuggling a smuggled url
authorRemita Amine <remitamine@gmail.com>
Mon, 4 Jul 2016 20:36:32 +0000 (21:36 +0100)
committerRemita Amine <remitamine@gmail.com>
Mon, 4 Jul 2016 20:36:32 +0000 (21:36 +0100)
test/test_utils.py

index ed61e4c2751c82c062db6339b4245cb4cae6c9bf..85928dbc2357567c51a2fe87468c3a8361825a03 100644 (file)
@@ -405,6 +405,12 @@ class TestUtil(unittest.TestCase):
         self.assertEqual(res_url, url)
         self.assertEqual(res_data, None)
 
+        smug_url = smuggle_url(url, {'a': 'b'})
+        smug_smug_url = smuggle_url(smug_url, {'c': 'd'})
+        res_url, res_data = unsmuggle_url(smug_smug_url)
+        self.assertEqual(res_url, url)
+        self.assertEqual(res_data, {'a': 'b', 'c': 'd'})
+
     def test_shell_quote(self):
         args = ['ffmpeg', '-i', encodeFilename('ñ€ß\'.mp4')]
         self.assertEqual(shell_quote(args), """ffmpeg -i 'ñ€ß'"'"'.mp4'""")