Commits

Robert Brewer committed 2ee2abb

Silenced some cpmodpy errors due to not using WSGI.

Comments (0)

Files changed (6)

cherrypy/test/modfcgid.py

     """TestHarness for fcgid and CherryPy."""
     
     def _run(self, conf):
+        cherrypy.server.using_wsgi = True
         cherrypy.server.using_apache = True
         cherrypy.server.httpserver = servers.FlupFCGIServer(
             application=cherrypy.tree, bindAddress=('127.0.0.1', 4000))

cherrypy/test/modpy.py

         print "Running tests:", self.server
         
         if self.use_wsgi:
+            cherrypy.server.using_wsgi = True
             conf_template = conf_modpython_gateway
         else:
+            cherrypy.server.using_wsgi = False
             conf_template = conf_cpmodpy
         
         # mod_python, since it runs in the Apache process, must be

cherrypy/test/modwsgi.py

     use_wsgi = True
     
     def _run(self, conf):
+        cherrypy.server.using_wsgi = True
         cherrypy.server.using_apache = True
         
         from cherrypy.test import webtest

cherrypy/test/test.py

         print "PID:", os.getpid()
         print
         
+        # Override these in _run as needed:
+        cherrypy.server.using_wsgi = True
+        cherrypy.server.using_apache = False
+        
         if isinstance(conf, basestring):
             parser = cherrypy.config._Parser()
             conf = parser.dict_from_file(conf).get('global', {})

cherrypy/test/test_wsgi_vhost.py

 class WSGI_VirtualHost_Test(helper.CPWebCase):
     
     def test_welcome(self):
+        if not cherrypy.server.using_wsgi:
+            print "skipped (not using WSGI)...",
+            return
+        
         for year in xrange(1997, 2008):
             self.getPage("/", headers=[('Host', 'www.classof%s.example' % year)])
             self.assertBody("Welcome to the Class of %s website!" % year)

cherrypy/test/test_wsgiapps.py

         self.assertBody("I'm a regular CherryPy page handler!")
     
     def test_04_pure_wsgi(self):
+        import cherrypy
+        if not cherrypy.server.using_wsgi:
+            print "skipped (not using WSGI)...",
+            return
         self.getPage("/hosted/app1")
         self.assertHeader("Content-Type", "text/plain")
         self.assertInBody(self.wsgi_output)
 
     def test_05_wrapped_cp_app(self):
+        import cherrypy
+        if not cherrypy.server.using_wsgi:
+            print "skipped (not using WSGI)...",
+            return
         self.getPage("/hosted/app2/")
         body = list("I'm a regular CherryPy page handler!")
         body.reverse()
         self.assertInBody(body)
 
     def test_06_empty_string_app(self):
+        import cherrypy
+        if not cherrypy.server.using_wsgi:
+            print "skipped (not using WSGI)...",
+            return
         self.getPage("/hosted/app3")
         self.assertHeader("Content-Type", "text/plain")
         self.assertInBody('Hello world')