Lines Matching refs:cgi
2 import cgi
18 cgi.sys = HackedSysModule()
50 return cgi.parse(fp, env, strict_parsing=1)
114 form = cgi.FieldStorage(fp=fake_stdin, environ=environ, encoding=encoding)
128 result = cgi.parse_multipart(fp, env)
144 result = cgi.parse_multipart(fp, env, encoding="ascii",
152 fs = cgi.FieldStorage()
160 self.assertRaises(TypeError, cgi.FieldStorage, "not-a-file-obj",
162 self.assertRaises(TypeError, cgi.FieldStorage, "foo", "bar")
163 fs = cgi.FieldStorage(headers={'content-type':'text/plain'})
171 self.assertEqual("test & string", cgi.escape("test & string"))
172 self.assertEqual("<test string>", cgi.escape("<test string>"))
173 self.assertEqual(""test string"", cgi.escape('"test string"', True))
184 fs = cgi.FieldStorage(environ=env)
202 cgi.log("Testing")
204 cgi.logfp = StringIO()
205 cgi.initlog("%s", "Testing initlog 1")
206 cgi.log("%s", "Testing log 2")
207 self.assertEqual(cgi.logfp.getvalue(), "Testing initlog 1\nTesting log 2\n")
209 cgi.logfp = None
210 cgi.logfile = os.devnull
211 cgi.initlog("%s", "Testing log 3")
212 self.addCleanup(cgi.closelog)
213 cgi.log("Testing log 4")
244 fs = cgi.FieldStorage(fp=f, environ=env)
259 fs = cgi.FieldStorage(fp, environ=env, encoding="latin-1")
278 fs = cgi.FieldStorage(fp, environ=env, encoding="latin-1")
296 fs = cgi.FieldStorage(fp, environ=env,encoding=encoding)
334 fs = cgi.FieldStorage(fp, environ=env, encoding="latin-1")
361 fs = cgi.FieldStorage(fp, environ=env, encoding="latin-1")
369 with cgi.FieldStorage(fp=fp, environ=env) as fs:
404 cgi.FieldStorage(
437 cgi.FieldStorage(
442 cgi.FieldStorage(
511 cgi.parse_qs('a=A1&b=B2&B=B3'))
518 cgi.parse_qsl('a=A1&b=B2&B=B3'))
522 cgi.parse_header("text/plain"),
525 cgi.parse_header("text/vnd.just.made.this.up ; "),
528 cgi.parse_header("text/plain;charset=us-ascii"),
531 cgi.parse_header('text/plain ; charset="us-ascii"'),
534 cgi.parse_header('text/plain ; charset="us-ascii"; another=opt'),
537 cgi.parse_header('attachment; filename="silly.txt"'),
540 cgi.parse_header('attachment; filename="strange;name"'),
543 cgi.parse_header('attachment; filename="strange;name";size=123;'),
546 cgi.parse_header('form-data; name="files"; filename="fo\\"o;bar"'),
552 support.check__all__(self, cgi, blacklist=blacklist)