示例#1
0
 def test_overwrite_default_plugins(self):
     plugins_that_should_be_checked = ['optional_plugin']
     plugin_dict = self.mocked_interface.get_available_analysis_plugins()
     result = AnalysisRoutes._overwrite_default_plugins(
         plugin_dict, plugins_that_should_be_checked)  # pylint: disable=protected-access
     assert len(result.keys()) == 4, 'number of plug-ins changed'
     assert result['default_plugin'][2][
         'default'] is False, 'default plugin still checked'
     assert result['optional_plugin'][2][
         'default'] is True, 'optional plugin not checked'
    def _setup_app(self):
        self.app = Flask(__name__)
        self.app.config.from_object(__name__)

        Flask.secret_key = os.urandom(24)

        RestBase(app=self.app, config=self.config)

        AjaxRoutes(self.app, self.config)
        AnalysisRoutes(self.app, self.config)
        CompareRoutes(self.app, self.config)
        DatabaseRoutes(self.app, self.config)
        IORoutes(self.app, self.config)
        MiscellaneousRoutes(self.app, self.config)
        StatisticRoutes(self.app, self.config)

        FilterClass(self.app, self.program_version, self.config)
示例#3
0
    def _setup_app(self):
        self.app = Flask(__name__)
        self.app.config.from_object(__name__)

        self.app.config['SECRET_KEY'] = os.urandom(24)
        add_config_from_configparser_to_app(self.app, self.config)
        self.user_db, self.user_datastore = add_flask_security_to_app(self.app)

        AjaxRoutes(self.app, self.config)
        AnalysisRoutes(self.app, self.config)
        CompareRoutes(self.app, self.config)
        DatabaseRoutes(self.app, self.config)
        IORoutes(self.app, self.config)
        MiscellaneousRoutes(self.app, self.config)
        StatisticRoutes(self.app, self.config)
        UserManagementRoutes(self.app,
                             self.config,
                             user_db=self.user_db,
                             user_db_interface=self.user_datastore)

        rest_base = RestBase(app=self.app, config=self.config)
        PluginRoutes(self.app, self.config, api=rest_base.api)
        FilterClass(self.app, self.program_version, self.config)