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

Changeset 1893

Show
Ignore:
Timestamp:
02/18/08 13:17:11
Author:
lawouach
Message:

Test and fix for #706

Files:

Legend:

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

    r1791 r1893  
    314314            action = result.get('action', None) 
    315315            if action is not None: 
    316                 handler = getattr(controller, action
     316                handler = getattr(controller, action, None
    317317                # Get config from the handler  
    318318                if hasattr(handler, "_cp_config"):  
  • trunk/cherrypy/test/test_routes.py

    r1597 r1893  
    99 
    1010def setup_server(): 
     11 
     12    class Dummy: 
     13        def index(self): 
     14            return "I said good day!" 
    1115     
    1216    class City: 
     
    3135    d.mapper.connect('surbiton', controller='surbiton', 
    3236                     action='update', conditions=dict(method=['POST'])) 
     37    d.connect('main', ':action', controller=Dummy()) 
    3338     
    3439    conf = {'/': {'request.dispatch': d}} 
     
    4550        self.assertStatus("200 OK") 
    4651        self.assertBody("Welcome to Hounslow, pop. 10000") 
     52         
     53        self.getPage("/foo") 
     54        self.assertStatus("404 Not Found") 
    4755         
    4856        self.getPage("/surbiton") 

Hosted by WebFaction

Log in as guest/cpguest to create tickets