Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e99d5ea commit e78b92aCopy full SHA for e78b92a
1 file changed
Lib/test/test_urllib.py
@@ -34,3 +34,19 @@
34
35
verify(urllib.quote(in2) == out2_1, "urllib.quote problem 4")
36
verify(urllib.quote(in2, '?') == out2_2, "urllib.quote problem 5")
37
+
38
+in3 = {"p1":"v1","p2":"v2"}
39
+exp3_1 = "p2=v2&p1=v1"
40
+exp3_2 = "p1=v1&p2=v2"
41
+act3 = urllib.urlencode(in3)
42
+verify(act3==exp3_1 or act3==exp3_2, "urllib.urlencode problem 1")
43
44
+in4 = {"p1":["v1","v2"]}
45
+exp4 = "p1=v1&p1=v2"
46
+act4 = urllib.urlencode(in4,doseq=1)
47
+verify(act4==exp4, "urllib.urlencode problem 2")
48
49
+in5 = in4
50
+exp5 = "p1=%5B%27v1%27%2C+%27v2%27%5D"
51
+act5 = urllib.urlencode(in5)
52
+verify(act5==exp5, "urllib.urlencode problem 3")
0 commit comments