Commits

Robert Brewer committed 5382c0b

Ignore some maxsize tests if not using wsgi server.

  • Participants
  • Parent commits 66ad903

Comments (0)

Files changed (1)

cherrypy/test/test_core.py

     def testMaxRequestSize(self):
         self.getPage("/maxrequestsize/index")
         self.assertBody("OK")
-        cherrypy.config.update({'server.maxRequestHeaderSize': 10})
-        self.getPage("/maxrequestsize/index")
-        self.assertStatus("413 Request Entity Too Large")
-        self.assertBody("Request Entity Too Large")
-        cherrypy.config.update({'server.maxRequestHeaderSize': 0})
-
+        
+        if cherrypy._httpserver.__class__.__name__ == "WSGIServer":
+            cherrypy.config.update({'server.maxRequestHeaderSize': 10})
+            self.getPage("/maxrequestsize/index")
+            self.assertStatus("413 Request Entity Too Large")
+            self.assertBody("Request Entity Too Large")
+            cherrypy.config.update({'server.maxRequestHeaderSize': 0})
+        
         # Test upload
         h = [("Content-type", "multipart/form-data; boundary=x"),
              ("Content-Length", "110")]
 """
         self.getPage('/maxrequestsize/upload', h, "POST", b)
         self.assertBody('Size: 5')
-        cherrypy.config.update({
-            '/maxrequestsize': {'server.maxRequestBodySize': 3}})
-        self.getPage('/maxrequestsize/upload', h, "POST", b)
-        self.assertStatus("413 Request Entity Too Large")
-        self.assertInBody("Request Entity Too Large")
+        
+        if cherrypy._httpserver.__class__.__name__ == "WSGIServer":
+            cherrypy.config.update({
+                '/maxrequestsize': {'server.maxRequestBodySize': 3}})
+            self.getPage('/maxrequestsize/upload', h, "POST", b)
+            self.assertStatus("413 Request Entity Too Large")
+            self.assertInBody("Request Entity Too Large")
 
 if __name__ == '__main__':
     helper.testmain()