Skip to content

Commit

Permalink
[test_compat] Add tests for compat_urllib_parse_unquote_plus
Browse files Browse the repository at this point in the history
  • Loading branch information
dstftw committed Jul 17, 2015
1 parent aa99aa4 commit 8954e48
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/test_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
compat_getenv,
compat_expanduser,
compat_urllib_parse_unquote,
compat_urllib_parse_unquote_plus,
)


Expand Down Expand Up @@ -44,6 +45,8 @@ def test_all_present(self):
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('%%'), '%%')
Expand All @@ -60,5 +63,9 @@ def test_compat_urllib_parse_unquote(self):
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()

0 comments on commit 8954e48

Please sign in to comment.