コード例 #1
0
ファイル: test_runserver.py プロジェクト: RebuiltBits/hooky
    def testGetConfigObject(self):
        """Test the getConfigObject() method"""
        cfg_class = 'config.file.FileConfig'
        cfg_file = '%s/test_data/config.ini' % utils.getRootPath()

        cfg_object = runserver.getConfigObject(cfg_class, cfg_file)
        self.assertTrue(isinstance(cfg_object, file.FileConfig))
コード例 #2
0
ファイル: test_app.py プロジェクト: RebuiltBits/hooky
 def get_app(self):
     # Generate a real application server based on our test config data
     cfg = runserver.getConfigObject(
         'hooky.config.file.FileConfig',
         '%s/test_data/config.ini' % utils.getRootPath())
     server = app.getApplication(cfg)
     return server
コード例 #3
0
ファイル: test_hook.py プロジェクト: RebuiltBits/hooky
    def get_app(self):
        cfg_class = 'config.file.FileConfig'
        cfg_file = '%s/test_data/config.ini' % utils.getRootPath()
        config = runserver.getConfigObject(cfg_class, cfg_file)

        URLS = [
            ('/hook', hook.HookRootHandler, {'config': config}),
            (r"/hook/(.*)", hook.HookHandler, {'config': config})]

        return web.Application(URLS)