Skip to content

Commit

Permalink
Fix doc tests with unquote.
Browse files Browse the repository at this point in the history
  • Loading branch information
chr15m committed May 16, 2019
1 parent a3d48d9 commit 9d6830c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions multidimensional_urlencode/urlencoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,12 @@ def parametrize(params):
def urlencode(params, encode_list_key=False, array_braces=True):
"""Urlencode a multidimensional dict.
>>> urlencode({'a': {"b": [1, 2, 3]}})
>>> from urllib import unquote
>>> unquote(urlencode({'a': {"b": [1, 2, 3]}}))
'a[b][]=1&a[b][]=2&a[b][]=3'
>>> urlencode({'a': {"b": [1, 2, 3]}}, array_braces=False)
>>> unquote(urlencode({'a': {"b": [1, 2, 3]}}, array_braces=False))
'a[b]=1&a[b]=2&a[b]=3'
>>> urlencode({'a': {"b": [1, 2, 3]}}, encode_list_key=True)
>>> unquote(urlencode({'a': {"b": [1, 2, 3]}}, encode_list_key=True))
'a[b][0]=1&a[b][1]=2&a[b][2]=3'
"""
Expand Down

0 comments on commit 9d6830c

Please sign in to comment.