MCPcopy Index your code
hub / github.com/python/cpython / test_cgi_get

Method test_cgi_get

Lib/test/test_xmlrpc.py:1440–1455  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1438 self.cgi = None
1439
1440 def test_cgi_get(self):
1441 with os_helper.EnvironmentVarGuard() as env:
1442 env['REQUEST_METHOD'] = 'GET'
1443 # if the method is GET and no request_text is given, it runs handle_get
1444 # get sysout output
1445 with captured_stdout(encoding=self.cgi.encoding) as data_out:
1446 self.cgi.handle_request()
1447
1448 # parse Status header
1449 data_out.seek(0)
1450 handle = data_out.read()
1451 status = handle.split()[1]
1452 message = ' '.join(handle.split()[2:4])
1453
1454 self.assertEqual(status, '400')
1455 self.assertEqual(message, 'Bad Request')
1456
1457
1458 def test_cgi_xmlrpc_response(self):

Callers

nothing calls this directly

Calls 7

captured_stdoutFunction · 0.70
handle_requestMethod · 0.45
seekMethod · 0.45
readMethod · 0.45
splitMethod · 0.45
joinMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected