diff 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
line wrap: on
line diff
--- a/Lib/test/test_httpservers.py	Sun Oct 03 14:46:36 2010 +0000
+++ b/Lib/test/test_httpservers.py	Sun Oct 03 18:04:52 2010 +0000
@@ -470,6 +470,13 @@
         self.assertEquals((b'Hello World\n', 'text/html', 200),
              (res.read(), res.getheader('Content-type'), res.status))
 
+    def test_os_environ_is_not_altered(self):
+        signature = "Test CGI Server"
+        os.environ['SERVER_SOFTWARE'] = signature
+        res = self.request('/cgi-bin/file1.py')
+        self.assertEqual((b'Hello World\n', 'text/html', 200),
+                (res.read(), res.getheader('Content-type'), res.status))
+        self.assertEqual(os.environ['SERVER_SOFTWARE'], signature)
 
 def test_main(verbose=None):
     try: