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

Changeset 1728

Show
Ignore:
Timestamp:
09/27/07 15:14:26
Author:
fumanchu
Message:

couple new tests and a docstring.

Files:

Legend:

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

    r1721 r1728  
    6666     
    6767    def _merged_args(self, d=None): 
     68        """Return a dict of configuration entries for this Tool.""" 
    6869        if d: 
    6970            conf = d.copy() 
  • trunk/cherrypy/test/test_core.py

    r1717 r1728  
    163163            raise cherrypy.InternalRedirect("/") 
    164164         
     165        def choke(self): 
     166            return 3 / 0 
     167        choke.exposed = True 
     168        choke._cp_config = {'hooks.before_error_response': redir_custom} 
     169         
    165170        def relative(self, a, b): 
    166171            raise cherrypy.InternalRedirect("cousin?t=6") 
     
    192197        def login(self): 
    193198            return "Please log in" 
    194         login._cp_config = {'hooks.before_error_response': redir_custom} 
    195199         
    196200        def custom_err(self): 
     
    200204            return "whatever" 
    201205        early_ir._cp_config = {'hooks.before_request_body': redir_custom} 
     206     
    202207     
    203208    class Image(Test): 
     
    667672         
    668673        # InternalRedirect on error 
    669         self.getPage("/internalredirect/login/illegal/extra/vpath/atoms") 
     674        self.getPage("/internalredirect/choke") 
    670675        self.assertStatus(200) 
    671676        self.assertBody("Something went horribly wrong.") 
  • trunk/cherrypy/test/test_objectmapping.py

    r1469 r1728  
    259259        self.getPage("/dir1/dir2/5/3/sir") 
    260260        self.assertBody("default for dir1, param is:('dir2', '5', '3', 'sir')") 
     261         
     262        # test that extra positional args raises 404 
     263        self.getPage("/dir1/dir2/script_name/extra/stuff") 
     264        self.assertStatus("404 Not Found") 
    261265     
    262266    def testExpose(self): 

Hosted by WebFaction

Log in as guest/cpguest to create tickets