Download Install Tutorial Docs FAQ Tools WikiLicense Team IRC Planet Involvement Shop Book

Changeset 1763

Show
Ignore:
Timestamp:
10/26/07 00:44:51
Author:
fumanchu
Message:

Fix for #700 (Deprecate the wsgiapp Tool).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/cherrypy/lib/wsgiapp.py

    r1460 r1763  
    22 
    33import sys 
     4import warnings 
    45 
    56import cherrypy 
     
    5152def run(app, env=None): 
    5253    """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     
    5358    try: 
    5459        environ = cherrypy.request.wsgi_environ.copy() 
  • trunk/cherrypy/test/test_wsgiapps.py

    r1586 r1763  
    4343     
    4444     
    45     class HostedWSGI(object): 
    46         _cp_config = {'tools.wsgiapp.on': True, 
    47                       'tools.wsgiapp.app': test_app, 
    48                       } 
    49      
    5045    cherrypy.config.update({'environment': 'test_suite'}) 
    5146    cherrypy.tree.mount(Root()) 
    5247     
    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) 
    5848    cherrypy.tree.graft(test_app, '/hosted/app1') 
    5949    cherrypy.tree.graft(test_empty_string_app, '/hosted/app3') 
     
    6757 
    6858 
    69 class WSGIAppTest(helper.CPWebCase): 
     59class WSGIGraftTests(helper.CPWebCase): 
    7060     
    7161    wsgi_output = '''Hello, world! 
     
    7565        self.getPage("/") 
    7666        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') 
    8867     
    8968    def test_04_pure_wsgi(self): 

Hosted by WebFaction

Log in as guest/cpguest to create tickets