@@ -802,20 +802,6 @@ def test_path_without_leading_slash(self):
802802print("</pre>")
803803"""
804804
805- cgi_file7 = """\
806- #!%s
807- import os
808- import sys
809-
810- print("Content-type: text/plain")
811- print()
812-
813- content_length = int(os.environ["CONTENT_LENGTH"])
814- body = sys.stdin.buffer.read(content_length)
815-
816- print(f"{content_length} {len(body)}")
817- """
818-
819805
820806@unittest .skipIf (hasattr (os , 'geteuid' ) and os .geteuid () == 0 ,
821807 "This test can't be run reliably as root (issue #13308)." )
@@ -855,8 +841,6 @@ def setUp(self):
855841 self .file3_path = None
856842 self .file4_path = None
857843 self .file5_path = None
858- self .file6_path = None
859- self .file7_path = None
860844
861845 # The shebang line should be pure ASCII: use symlink if possible.
862846 # See issue #7668.
@@ -911,11 +895,6 @@ def setUp(self):
911895 file6 .write (cgi_file6 % self .pythonexe )
912896 os .chmod (self .file6_path , 0o777 )
913897
914- self .file7_path = os .path .join (self .cgi_dir , 'file7.py' )
915- with open (self .file7_path , 'w' , encoding = 'utf-8' ) as file7 :
916- file7 .write (cgi_file7 % self .pythonexe )
917- os .chmod (self .file7_path , 0o777 )
918-
919898 os .chdir (self .parent_dir )
920899
921900 def tearDown (self ):
@@ -938,8 +917,6 @@ def tearDown(self):
938917 os .remove (self .file5_path )
939918 if self .file6_path :
940919 os .remove (self .file6_path )
941- if self .file7_path :
942- os .remove (self .file7_path )
943920 os .rmdir (self .cgi_child_dir )
944921 os .rmdir (self .cgi_dir )
945922 os .rmdir (self .cgi_dir_in_sub_dir )
@@ -1012,21 +989,6 @@ def test_post(self):
1012989
1013990 self .assertEqual (res .read (), b'1, python, 123456' + self .linesep )
1014991
1015- def test_large_content_length (self ):
1016- for w in range (15 , 25 ):
1017- size = 1 << w
1018- body = b'X' * size
1019- headers = {'Content-Length' : str (size )}
1020- res = self .request ('/cgi-bin/file7.py' , 'POST' , body , headers )
1021- self .assertEqual (res .read (), b'%d %d' % (size , size ) + self .linesep )
1022-
1023- def test_large_content_length_truncated (self ):
1024- for w in range (18 , 65 ):
1025- size = 1 << w
1026- headers = {'Content-Length' : str (size )}
1027- res = self .request ('/cgi-bin/file1.py' , 'POST' , b'x' , headers )
1028- self .assertEqual (res .read (), b'Hello World' + self .linesep )
1029-
1030992 def test_invaliduri (self ):
1031993 res = self .request ('/cgi-bin/invalid' )
1032994 res .read ()
0 commit comments