comparison Lib/test/test_httpservers.py @ 65076:945a55d4e73e 3.1

Merged revisions 85202 via svnmerge from svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r85202 | senthil.kumaran | 2010-10-03 23:25:45 +0530 (Sun, 03 Oct 2010) | 4 lines Fix Issue9272 - Change CGIHTTPServer to give the child program a copy of os.environ ........
author Senthil Kumaran <orsenthil@gmail.com>
date Sun, 03 Oct 2010 18:04:52 +0000
parents d787ef9acb72
children 2beb25369289
comparison
equal deleted inserted replaced
65073:f7c9107f7abd 65076:945a55d4e73e
468 # http://bugs.python.org/issue2254 468 # http://bugs.python.org/issue2254
469 res = self.request('cgi-bin/file1.py') 469 res = self.request('cgi-bin/file1.py')
470 self.assertEquals((b'Hello World\n', 'text/html', 200), 470 self.assertEquals((b'Hello World\n', 'text/html', 200),
471 (res.read(), res.getheader('Content-type'), res.status)) 471 (res.read(), res.getheader('Content-type'), res.status))
472 472
473 def test_os_environ_is_not_altered(self):
474 signature = "Test CGI Server"
475 os.environ['SERVER_SOFTWARE'] = signature
476 res = self.request('/cgi-bin/file1.py')
477 self.assertEqual((b'Hello World\n', 'text/html', 200),
478 (res.read(), res.getheader('Content-type'), res.status))
479 self.assertEqual(os.environ['SERVER_SOFTWARE'], signature)
473 480
474 def test_main(verbose=None): 481 def test_main(verbose=None):
475 try: 482 try:
476 cwd = os.getcwd() 483 cwd = os.getcwd()
477 support.run_unittest(BaseHTTPRequestHandlerTestCase, 484 support.run_unittest(BaseHTTPRequestHandlerTestCase,