summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_cgi.py
diff options
context:
space:
mode:
authorFlorent Xicluna <florent.xicluna@gmail.com>2010-03-17 20:05:11 (GMT)
committerFlorent Xicluna <florent.xicluna@gmail.com>2010-03-17 20:05:11 (GMT)
commit78c1871d2171b091d7249af63a4b5e3a927c0bc2 (patch)
tree43a34ea07dd9c26baf1e7b02ddf011e4d9bf82c8 /Lib/test/test_cgi.py
parent945a8ba635e2f46de0c883771f2a4b3fa1bd9df4 (diff)
downloadcpython-78c1871d2171b091d7249af63a4b5e3a927c0bc2.zip
cpython-78c1871d2171b091d7249af63a4b5e3a927c0bc2.tar.gz
cpython-78c1871d2171b091d7249af63a4b5e3a927c0bc2.tar.bz2
Fix and check cgi module deprecation warnings. Revert an unwanted rename in test_import.
Diffstat (limited to 'Lib/test/test_cgi.py')
-rw-r--r--Lib/test/test_cgi.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/Lib/test/test_cgi.py b/Lib/test/test_cgi.py
index c5e07a0..791553b 100644
--- a/Lib/test/test_cgi.py
+++ b/Lib/test/test_cgi.py
@@ -4,7 +4,6 @@ import os
import sys
import tempfile
import unittest
-from StringIO import StringIO
class HackedSysModule:
# The regression test will have real values in sys.argv, which
@@ -340,14 +339,16 @@ this is the content of the fake file
self.assertEqual(result, v)
def test_deprecated_parse_qs(self):
- with check_warnings(quiet=False):
- # this func is moved to urlparse, this is just a sanity check
+ # this func is moved to urlparse, this is just a sanity check
+ with check_warnings(('cgi.parse_qs is deprecated, use urlparse.'
+ 'parse_qs instead', PendingDeprecationWarning)):
self.assertEqual({'a': ['A1'], 'B': ['B3'], 'b': ['B2']},
cgi.parse_qs('a=A1&b=B2&B=B3'))
def test_deprecated_parse_qsl(self):
- with check_warnings(quiet=False):
- # this func is moved to urlparse, this is just a sanity check
+ # this func is moved to urlparse, this is just a sanity check
+ with check_warnings(('cgi.parse_qsl is deprecated, use urlparse.'
+ 'parse_qsl instead', PendingDeprecationWarning)):
self.assertEqual([('a', 'A1'), ('b', 'B2'), ('B', 'B3')],
cgi.parse_qsl('a=A1&b=B2&B=B3'))