summaryrefslogtreecommitdiff
path: root/Lib/test/test_cgi.py
diff options
context:
space:
mode:
authorFlorent Xicluna <florent.xicluna@gmail.com>2010-03-17 19:15:56 +0000
committerFlorent Xicluna <florent.xicluna@gmail.com>2010-03-17 19:15:56 +0000
commit945a8ba635e2f46de0c883771f2a4b3fa1bd9df4 (patch)
treee0b130c259a8ed38afb5d75b9b311d4ac4951f7f /Lib/test/test_cgi.py
parent2b73c21bedfbabd75c26c1ee700198460344e918 (diff)
downloadcpython-git-945a8ba635e2f46de0c883771f2a4b3fa1bd9df4.tar.gz
Cleanup some test cases using check_warnings and check_py3k_warnings.
Diffstat (limited to 'Lib/test/test_cgi.py')
-rw-r--r--Lib/test/test_cgi.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/test/test_cgi.py b/Lib/test/test_cgi.py
index 5b5329170f..c5e07a0c46 100644
--- a/Lib/test/test_cgi.py
+++ b/Lib/test/test_cgi.py
@@ -115,7 +115,7 @@ def gen_result(data, environ):
result = {}
for k, v in dict(form).items():
- result[k] = type(v) is list and form.getlist(k) or v.value
+ result[k] = isinstance(v, list) and form.getlist(k) or v.value
return result
@@ -133,7 +133,7 @@ class CgiTests(unittest.TestCase):
fcd = cgi.FormContentDict(env)
sd = cgi.SvFormContentDict(env)
fs = cgi.FieldStorage(environ=env)
- if type(expect) == type({}):
+ if isinstance(expect, dict):
# test dict interface
self.assertEqual(len(expect), len(fcd))
self.assertSameElements(expect.keys(), fcd.keys())
@@ -340,13 +340,13 @@ this is the content of the fake file
self.assertEqual(result, v)
def test_deprecated_parse_qs(self):
- with check_warnings():
+ with check_warnings(quiet=False):
# 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):
- with check_warnings():
+ with check_warnings(quiet=False):
# 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'))