Changeset 900
- Timestamp:
- 12/30/05 01:04:41
- Files:
-
- trunk/cherrypy/filters/staticfilter.py (modified) (1 diff)
- trunk/cherrypy/test/test_static_filter.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/filters/staticfilter.py
r896 r900 27 27 if not filename: 28 28 staticDir = config.get('static_filter.dir') 29 if not staticDir: 30 msg = ("StaticFilter requires either static_filter.file " 31 "or static_filter.dir (%s)" % request.path) 32 raise cherrypy.WrongConfigValue(msg) 29 33 section = config.get('static_filter.dir', return_section=True) 30 34 if section == 'global': trunk/cherrypy/test/test_static_filter.py
r896 r900 45 45 'static_filter.dir': 'static', 46 46 'static_filter.index': 'index.html', 47 }, 48 '/error': { 49 'static_filter.on': True, 50 'server.show_tracebacks': True, 47 51 }, 48 52 }) … … 100 104 self.assertHeader('Content-Type', 'text/html') 101 105 self.assertBody('Hello, world\r\n') 106 107 # Check that we get a WrongConfigValue error if no .file or .dir 108 self.getPage("/error/thing.html") 109 self.assertErrorPage(500) 110 self.assertInBody("WrongConfigValue: StaticFilter requires either " 111 "static_filter.file or static_filter.dir " 112 "(/error/thing.html)") 102 113 103 114

