def getApplication(ndsr, monitor, dispatcher): # Group our passed in options into a common settings dict settings = { 'ndsr': ndsr, 'monitor': monitor, 'dispatcher': dispatcher, } # Default list of URLs provided by Hooky and links to their classes URLS = [ # Handle initial web clients at the root of our service. (r"/", root.RootHandler), # Handle initial web clients at the root of our service. (r"/status", state.StatusHandler, dict(settings=settings)), # Provide access to our static content (r'/static/(.*)', web.StaticFileHandler, { 'path': utils.getStaticPath() }), # Handle incoming hook requests ] application = web.Application(URLS) return application
def getApplication(ndsr, monitor, dispatcher): # Group our passed in options into a common settings dict settings = {"ndsr": ndsr, "monitor": monitor, "dispatcher": dispatcher} # Default list of URLs provided by Hooky and links to their classes URLS = [ # Handle initial web clients at the root of our service. (r"/", root.RootHandler), # Handle initial web clients at the root of our service. (r"/status", state.StatusHandler, dict(settings=settings)), # Provide access to our static content (r"/static/(.*)", web.StaticFileHandler, {"path": utils.getStaticPath()}), # Handle incoming hook requests ] application = web.Application(URLS) return application
def testGetStaticPath(self): """Test the getStaticPath() method""" path = utils.getStaticPath() self.assertTrue(os.path.exists(path)) self.assertTrue(os.path.exists(path))