Robert Brewer avatar Robert Brewer committed 5382c0b

Ignore some maxsize tests if not using wsgi server.

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()
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.