]> granicus.if.org Git - python/commitdiff
Added sanity checks for the deprecated parse_qs() and
authorFacundo Batista <facundobatista@gmail.com>
Mon, 8 Sep 2008 00:23:29 +0000 (00:23 +0000)
committerFacundo Batista <facundobatista@gmail.com>
Mon, 8 Sep 2008 00:23:29 +0000 (00:23 +0000)
parse_qsl() functions in cgi module.

Lib/test/test_cgi.py

index ff2fc466532d6ec2430ea7dc365602b8b4ade0f8..9491001bb47911c194c9ac4e6593a0c4b8233b37 100644 (file)
@@ -306,6 +306,16 @@ this is the content of the fake file
         v = gen_result(data, environ)
         self.assertEqual(result, v)
 
+    def test_deprecated_parse_qs(self):
+        # this func is moved to urlparse, this is just a sanity check
+        self.assertEqual({'a': ['A1'], 'B': ['B3'], 'b': ['B2']},
+                         cgi.parse_qs('a=A1&b=B2&B=B3'))
+
+    def test_deprecated_parse_qsl(self):
+        # this func is moved to urlparse, this is just a sanity check
+        self.assertEqual([('a', 'A1'), ('b', 'B2'), ('B', 'B3')],
+                         cgi.parse_qsl('a=A1&b=B2&B=B3'))
+
 def test_main():
     run_unittest(CgiTests)