Changeset 1763
- Timestamp:
- 10/26/07 00:44:51
- Files:
-
- trunk/cherrypy/lib/wsgiapp.py (modified) (2 diffs)
- trunk/cherrypy/test/test_wsgiapps.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/lib/wsgiapp.py
r1460 r1763 2 2 3 3 import sys 4 import warnings 4 5 5 6 import cherrypy … … 51 52 def run(app, env=None): 52 53 """Run the given WSGI app and set response.body to its output.""" 54 warnings.warn("This module is deprecated and will be removed in " 55 "Cherrypy 3.2. See http://www.cherrypy.org/ticket/700 " 56 "for more information.") 57 53 58 try: 54 59 environ = cherrypy.request.wsgi_environ.copy() trunk/cherrypy/test/test_wsgiapps.py
r1586 r1763 43 43 44 44 45 class HostedWSGI(object):46 _cp_config = {'tools.wsgiapp.on': True,47 'tools.wsgiapp.app': test_app,48 }49 50 45 cherrypy.config.update({'environment': 'test_suite'}) 51 46 cherrypy.tree.mount(Root()) 52 47 53 conf0 = {'/static': {'tools.staticdir.on': True,54 'tools.staticdir.root': curdir,55 'tools.staticdir.dir': 'static',56 }}57 cherrypy.tree.mount(HostedWSGI(), '/hosted/app0', conf0)58 48 cherrypy.tree.graft(test_app, '/hosted/app1') 59 49 cherrypy.tree.graft(test_empty_string_app, '/hosted/app3') … … 67 57 68 58 69 class WSGI AppTest(helper.CPWebCase):59 class WSGIGraftTests(helper.CPWebCase): 70 60 71 61 wsgi_output = '''Hello, world! … … 75 65 self.getPage("/") 76 66 self.assertBody("I'm a regular CherryPy page handler!") 77 78 def test_02_wrapped_wsgi(self):79 self.getPage("/hosted/app0")80 self.assertHeader("Content-Type", "text/plain")81 self.assertInBody(self.wsgi_output)82 83 def test_03_static_subdir(self):84 self.getPage("/hosted/app0/static/index.html")85 self.assertStatus('200 OK')86 self.assertHeader('Content-Type', 'text/html')87 self.assertBody('Hello, world\r\n')88 67 89 68 def test_04_pure_wsgi(self):

