diff options
author | Georg Brandl <georg@python.org> | 2014-01-12 08:10:39 +0100 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2014-01-12 08:10:39 +0100 |
commit | 55c9e0366ee4477c34c881c942face4368cd4501 (patch) | |
tree | dcbf2f843faa2051275ee56aaa4bf9d8421d5705 /Lib/test/test_cgi.py | |
parent | 6392ad98d0f194e350c013599fbbb32f7ba5f3af (diff) | |
parent | b4cbb92fbe6290c3574e73288de9e9cbb60b7688 (diff) | |
download | cpython-git-55c9e0366ee4477c34c881c942face4368cd4501.tar.gz |
merge heads
Diffstat (limited to 'Lib/test/test_cgi.py')
-rw-r--r-- | Lib/test/test_cgi.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_cgi.py b/Lib/test/test_cgi.py index d80ec07767..e604c926b9 100644 --- a/Lib/test/test_cgi.py +++ b/Lib/test/test_cgi.py @@ -137,6 +137,13 @@ class CgiTests(unittest.TestCase): fs.list.append(namedtuple('MockFieldStorage', 'name')('fieldvalue')) self.assertTrue(fs) + def test_fieldstorage_invalid(self): + self.assertRaises(TypeError, cgi.FieldStorage, "not-a-file-obj", + environ={"REQUEST_METHOD":"PUT"}) + self.assertRaises(TypeError, cgi.FieldStorage, "foo", "bar") + fs = cgi.FieldStorage(headers={'content-type':'text/plain'}) + self.assertRaises(TypeError, bool, fs) + def test_escape(self): # cgi.escape() is deprecated. with warnings.catch_warnings(): |