def testIsPluginEnabled(self): os.chdir('../') enablePlugin(api, TEST_PLUGIN_NAME) os.chdir(TEST_PATH) RESULT = isPluginEnabled(TEST_PLUGIN_NAME, app) self.assertTrue(RESULT is True) RESULT = isPluginEnabled(TEST_PLUGIN_NAME_NOT_VALID, app) self.assertTrue(RESULT is False)
def get(self): pluginsDict = dict((key, request.args.get(key)) for key in request.args.keys()) for plugin in pluginsDict: setPluginState(plugin, pluginsDict[plugin]) if pluginsDict[plugin].lower() == u'true' and isPluginEnabled( plugin, getApp()) == False: dirs = os.walk("plugins").next() if plugin not in dirs[1]: raise PluginDoesNotExistException(plugin) else: enablePlugin(getApi(), plugin)