@@ -913,20 +913,6 @@ def test_path_without_leading_slash(self):
913913print("</pre>")
914914"""
915915
916- cgi_file7 = """\
917- #!%s
918- import os
919- import sys
920-
921- print("Content-type: text/plain")
922- print()
923-
924- content_length = int(os.environ["CONTENT_LENGTH"])
925- body = sys.stdin.buffer.read(content_length)
926-
927- print(f"{content_length} {len(body)}")
928- """
929-
930916
931917@unittest .skipIf (hasattr (os , 'geteuid' ) and os .geteuid () == 0 ,
932918 "This test can't be run reliably as root (issue #13308)." )
@@ -966,8 +952,6 @@ def setUp(self):
966952 self .file3_path = None
967953 self .file4_path = None
968954 self .file5_path = None
969- self .file6_path = None
970- self .file7_path = None
971955
972956 # The shebang line should be pure ASCII: use symlink if possible.
973957 # See issue #7668.
@@ -1022,11 +1006,6 @@ def setUp(self):
10221006 file6 .write (cgi_file6 % self .pythonexe )
10231007 os .chmod (self .file6_path , 0o777 )
10241008
1025- self .file7_path = os .path .join (self .cgi_dir , 'file7.py' )
1026- with open (self .file7_path , 'w' , encoding = 'utf-8' ) as file7 :
1027- file7 .write (cgi_file7 % self .pythonexe )
1028- os .chmod (self .file7_path , 0o777 )
1029-
10301009 os .chdir (self .parent_dir )
10311010
10321011 def tearDown (self ):
@@ -1049,8 +1028,6 @@ def tearDown(self):
10491028 os .remove (self .file5_path )
10501029 if self .file6_path :
10511030 os .remove (self .file6_path )
1052- if self .file7_path :
1053- os .remove (self .file7_path )
10541031 os .rmdir (self .cgi_child_dir )
10551032 os .rmdir (self .cgi_dir )
10561033 os .rmdir (self .cgi_dir_in_sub_dir )
@@ -1123,21 +1100,6 @@ def test_post(self):
11231100
11241101 self .assertEqual (res .read (), b'1, python, 123456' + self .linesep )
11251102
1126- def test_large_content_length (self ):
1127- for w in range (15 , 25 ):
1128- size = 1 << w
1129- body = b'X' * size
1130- headers = {'Content-Length' : str (size )}
1131- res = self .request ('/cgi-bin/file7.py' , 'POST' , body , headers )
1132- self .assertEqual (res .read (), b'%d %d' % (size , size ) + self .linesep )
1133-
1134- def test_large_content_length_truncated (self ):
1135- for w in range (18 , 65 ):
1136- size = 1 << w
1137- headers = {'Content-Length' : str (size )}
1138- res = self .request ('/cgi-bin/file1.py' , 'POST' , b'x' , headers )
1139- self .assertEqual (res .read (), b'Hello World' + self .linesep )
1140-
11411103 def test_invaliduri (self ):
11421104 res = self .request ('/cgi-bin/invalid' )
11431105 res .read ()
0 commit comments