aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSergey M․ <dstftw@gmail.com>2015-07-17 23:31:23 +0600
committerSergey M․ <dstftw@gmail.com>2015-07-17 23:31:23 +0600
commit8954e481404746c65ae1e82a6c5edec69114bfb1 (patch)
tree727312687933ed984eac1bd02b482f472927e471 /test
parentaa99aa4e853966d4f01e280313e3aadf2ddf7ad6 (diff)
[test_compat] Add tests for compat_urllib_parse_unquote_plus
Diffstat (limited to 'test')
-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 d816a9236..c3ba8ad2e 100644
--- a/test/test_compat.py
+++ b/test/test_compat.py
@@ -15,6 +15,7 @@ from youtube_dl.compat import (
compat_getenv,
compat_expanduser,
compat_urllib_parse_unquote,
+ compat_urllib_parse_unquote_plus,
)
@@ -44,6 +45,8 @@ class TestCompat(unittest.TestCase):
self.assertEqual(all_names, sorted(present_names))
def test_compat_urllib_parse_unquote(self):
+ self.assertEqual(compat_urllib_parse_unquote('abc%20def'), 'abc def')
+ self.assertEqual(compat_urllib_parse_unquote('%7e/abc+def'), '~/abc+def')
self.assertEqual(compat_urllib_parse_unquote(''), '')
self.assertEqual(compat_urllib_parse_unquote('%'), '%')
self.assertEqual(compat_urllib_parse_unquote('%%'), '%%')
@@ -60,5 +63,9 @@ class TestCompat(unittest.TestCase):
compat_urllib_parse_unquote('''%28%5E%E2%97%A3_%E2%97%A2%5E%29%E3%81%A3%EF%B8%BB%E3%83%87%E2%95%90%E4%B8%80 %E2%87%80 %E2%87%80 %E2%87%80 %E2%87%80 %E2%87%80 %E2%86%B6%I%Break%25Things%'''),
'''(^◣_◢^)っ︻デ═一 ⇀ ⇀ ⇀ ⇀ ⇀ ↶%I%Break%Things%''')
+ def test_compat_urllib_parse_unquote_plus(self):
+ self.assertEqual(compat_urllib_parse_unquote_plus('abc%20def'), 'abc def')
+ self.assertEqual(compat_urllib_parse_unquote_plus('%7e/abc+def'), '~/abc def')
+
if __name__ == '__main__':
unittest.main()