aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2016-03-26 02:38:33 +0600
committerSergey M․ <dstftw@gmail.com>2016-03-26 02:38:33 +0600
commite289d6d62cae85ded46ad6e92b33385f221b8370 (patch)
treeb02ad1a67d7dc3983dc982a7f41d088e378bbd6c
parent6e6bc8dae577c29c072ffc5c25078b5668435435 (diff)
[test_compat] Add tests for compat_urllib_parse_urlencode
-rw-r--r--test/test_compat.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/test_compat.py b/test/test_compat.py
index b6bfad05e..cc105807a 100644
--- a/test/test_compat.py
+++ b/test/test_compat.py
@@ -19,6 +19,7 @@ from youtube_dl.compat import (
compat_str,
compat_urllib_parse_unquote,
compat_urllib_parse_unquote_plus,
+ compat_urllib_parse_urlencode,
)
@@ -70,6 +71,12 @@ class TestCompat(unittest.TestCase):
self.assertEqual(compat_urllib_parse_unquote_plus('abc%20def'), 'abc def')
self.assertEqual(compat_urllib_parse_unquote_plus('%7e/abc+def'), '~/abc def')
+ def test_compat_urllib_parse_urlencode(self):
+ self.assertEqual(compat_urllib_parse_urlencode({'abc': 'def'}), 'abc=def')
+ self.assertEqual(compat_urllib_parse_urlencode({'abc': b'def'}), 'abc=def')
+ self.assertEqual(compat_urllib_parse_urlencode({b'abc': 'def'}), 'abc=def')
+ self.assertEqual(compat_urllib_parse_urlencode({b'abc': b'def'}), 'abc=def')
+
def test_compat_shlex_split(self):
self.assertEqual(compat_shlex_split('-option "one two"'), ['-option', 'one two'])