Esempio n. 1
0
def addResources():
    getApi().representations = DEFAULT_REPRESENTATIONS
    getApi().add_resource(ChannelsListResource, getPathWithPrefix(
        '/service/<string:serviceName>/channel'))
    getApi().add_resource(ChannelResource, getPathWithPrefix(
        '/service/<string:serviceName>/channel/<string:channelId>'))
    getApi().add_resource(PointResource, getPathWithPrefix(
        '/service/<string:serviceName>/point/<string:pointId>'))
    getApi().add_resource(PointListResource, getPathWithPrefix(
        '/service/<string:serviceName>/point'))
    getApi().add_resource(LogoutResource, getPathWithPrefix('/logout'))
    getApi().add_resource(LoginResource, getPathWithPrefix('/login'))
    getApi().add_resource(LoginGoogleResource, getPathWithPrefix(
        '/login/google'))
    getApi().add_resource(LoginFacebookResource,
                          getPathWithPrefix('/login/facebook'))
    getApi().add_resource(DebugLoginResource, getPathWithPrefix(
        '/login/debug'))
    getApi().add_resource(TestsResource, getPathWithPrefix('/tests'))
    getApi().add_resource(AdminServiceListResource, getPathWithPrefix(
        '/admin/service'))
    getApi().add_resource(AdminServiceResource, getPathWithPrefix(
        '/admin/service/<service_id>'))
    getApi().add_resource(
        MapResource,
        getPathWithPrefix('/service/<string:serviceName>/map'))
    getApi().add_resource(
        GetAllPluginsWithStatusResource,
        getPathWithPrefix('/plugin'))
    getApi().add_resource(
        ManagePluginsResource,
        getPathWithPrefix('/manage_plugins'))
    getApi().add_resource(
        InternalTestsResource,
        getPathWithPrefix('/internal_tests'))
    getApi().add_resource(
        AdminResource,
        getPathWithPrefix('/admin'))
    getApi().add_resource(
        AdminLogResource,
        getPathWithPrefix('/admin/log'))
    getApi().add_resource(
        ServiceResource,
        getPathWithPrefix('/service/<string:serviceName>'))
    getApi().add_resource(
        StatusResource,
        getPathWithPrefix('/status'))
    getApi().add_resource(
        ServiceListResource,
        getPathWithPrefix('/service'))
    getApi().add_resource(
        DebugInfoResource,
        getPathWithPrefix('/debug_info'))
    getApi().add_resource(
        LogResource,
        getPathWithPrefix('/service/<string:serviceName>/log'),
        getPathWithPrefix('/log'))
    getApi().add_resource(
        UserFindResource,
        getPathWithPrefix('/user/<string:user_id>'))
    getApi().add_resource(
        PluginConfigResource,
        getPathWithPrefix('/plugin_config/<string:pluginName>'))
    getApi().add_resource(
        UserListResource,
        getPathWithPrefix('/user'))
    getApi().add_resource(
        MacrosTestsResource,
        getPathWithPrefix('/macros_tests'))
    getApi().add_resource(
        MetadataResource,
        getPathWithPrefix(
            '/service/<string:serviceName>/metadata/<string:metadata_id>'))
    getApi().add_resource(
        MetadataListResource,
        getPathWithPrefix(
            '/service/<string:serviceName>/metadata'))
    getApi().add_resource(AdminPluginListResource, getPathWithPrefix(
        '/admin/plugin'))
    getApi().add_resource(AdminPluginConfigResource, getPathWithPrefix(
        '/admin/plugin/config/<string:pluginName>'))
    getApi().add_resource(IconResource, getPathWithPrefix(
        '/service/<string:serviceName>/get_icon'))

    # end of the list of imported resources

    atexit.register(closeConnection)

    initApp(getApi())
Esempio n. 2
0
 def testGt1417(self):
     app = Flask(__name__)
     api = Api(app)
     initApp(api)
     resources = api.endpoints
     self.assertTrue('resource_gt_1416' in resources)
Esempio n. 3
0
 def testGt1417(self):
     app = Flask(__name__)
     api = Api(app)
     initApp(api)
     resources = api.endpoints
     self.assertTrue('resource_gt_1416' in resources)
Esempio n. 4
0
def addResources():
    getApi().representations = DEFAULT_REPRESENTATIONS
    getApi().add_resource(ChannelsListResource, getPathWithPrefix(
        '/service/<string:serviceName>/channel'))
    getApi().add_resource(ChannelResource, getPathWithPrefix(
        '/service/<string:serviceName>/channel/<string:channelId>'))
    getApi().add_resource(PointResource, getPathWithPrefix(
        '/service/<string:serviceName>/point/<string:pointId>'))
    getApi().add_resource(PointListResource, getPathWithPrefix(
        '/service/<string:serviceName>/point'))
    getApi().add_resource(LogoutResource, getPathWithPrefix('/logout'))
    getApi().add_resource(LoginResource, getPathWithPrefix('/login'))
    getApi().add_resource(LoginGoogleResource, getPathWithPrefix(
        '/login/google'))
    getApi().add_resource(LoginFacebookResource,
                          getPathWithPrefix('/login/facebook'))
    getApi().add_resource(DebugLoginResource, getPathWithPrefix(
        '/login/debug'))
    getApi().add_resource(TestsResource, getPathWithPrefix('/tests'))
    getApi().add_resource(AdminServiceListResource, getPathWithPrefix(
        '/admin/service'))
    getApi().add_resource(AdminServiceResource, getPathWithPrefix(
        '/admin/service/<service_id>'))
    getApi().add_resource(
        MapResource,
        getPathWithPrefix('/service/<string:serviceName>/map'))
    getApi().add_resource(
        GetAllPluginsWithStatusResource,
        getPathWithPrefix('/plugin'))
    getApi().add_resource(
        ManagePluginsResource,
        getPathWithPrefix('/manage_plugins'))
    getApi().add_resource(
        InternalTestsResource,
        getPathWithPrefix('/internal_tests'))
    getApi().add_resource(
        AdminResource,
        getPathWithPrefix('/admin'))
    getApi().add_resource(
        AdminLogResource,
        getPathWithPrefix('/admin/log'))
    getApi().add_resource(
        ServiceResource,
        getPathWithPrefix('/service/<string:serviceName>'))
    getApi().add_resource(
        StatusResource,
        getPathWithPrefix('/status'))
    getApi().add_resource(
        ServiceListResource,
        getPathWithPrefix('/service'))
    getApi().add_resource(
        DebugInfoResource,
        getPathWithPrefix('/debug_info'))
    getApi().add_resource(
        LogResource,
        getPathWithPrefix('/service/<string:serviceName>/log'),
        getPathWithPrefix('/log'))
    getApi().add_resource(
        UserFindResource,
        getPathWithPrefix('/user/<string:user_id>'))
    getApi().add_resource(
        PluginConfigResource,
        getPathWithPrefix('/plugin_config/<string:pluginName>'))
    getApi().add_resource(
        UserListResource,
        getPathWithPrefix('/user'))
    getApi().add_resource(
        MacrosTestsResource,
        getPathWithPrefix('/macros_tests'))
    getApi().add_resource(
        MetadataResource,
        getPathWithPrefix(
            '/service/<string:serviceName>/metadata/<string:metadata_id>'))
    getApi().add_resource(
        MetadataListResource,
        getPathWithPrefix(
            '/service/<string:serviceName>/metadata'))
    # end of the list of imported resources

    atexit.register(closeConnection)

    initApp(getApi())