Changeset 897
- Timestamp:
- 12/29/05 18:03:29
- Files:
-
- trunk/cherrypy/_cperror.py (modified) (1 diff)
- trunk/cherrypy/_cpserver.py (modified) (2 diffs)
- trunk/cherrypy/test/test_states.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/_cperror.py
r865 r897 11 11 12 12 class WrongConfigValue(Error): 13 """ Happens when unrepr can't parse a config value"""13 """ Happens when a config value can't be parsed, or is otherwise illegal. """ 14 14 pass 15 15 trunk/cherrypy/_cpserver.py
r889 r897 64 64 self.blocking = not initOnly 65 65 self.httpserverclass = serverClass 66 67 # Hmmm...we *could* check config in _start instead, but I think 68 # most people would like CP to fail before autoreload kicks in. 69 check_config() 66 70 67 71 # Autoreload, but check serverClass. If None, we're not starting … … 269 273 270 274 275 def check_config(): 276 err = cherrypy.WrongConfigValue 277 for name, section in cherrypy.config.configs.iteritems(): 278 for k, v in section.iteritems(): 279 if k == "server.environment": 280 if v and v not in cherrypy.config.environments: 281 raise err("'%s' is not a registered environment." % v) 282 283 271 284 def configure(): 272 285 """Perform one-time actions to prepare the CherryPy core.""" trunk/cherrypy/test/test_states.py
r856 r897 163 163 self.assertEqual(db_connection.running, False) 164 164 self.assertEqual(len(db_connection.threads), 0) 165 166 def test_3_ConfigErrors(self): 167 cherrypy.config.update({'server.environment': 'destruction'}) 168 try: 169 self.assertRaises(cherrypy.WrongConfigValue, 170 cherrypy.server.start, True, self.serverClass) 171 finally: 172 cherrypy.server.stop() 165 173 166 174

