def initApp(api): homeDir = os.getcwd() if homeDir.find('/var/www') != -1: homeDir = '/var/www/geomongo/' os.chdir(homeDir) else: if homeDir.find('src/tst') != -1: os.chdir('..') pluginList = getPluginList() for pluginName in pluginList: if getPluginState(pluginName) is True and \ checkConfigPlugin(pluginName) is True: enablePlugin(api, pluginName) os.chdir(homeDir)
def get(self, pluginName): checkConfigPlugin(pluginName) return PluginConfigReader(pluginName).getConfigContent()
def testCheckConfigPlugin(self): os.chdir("../") self.assertTrue(checkConfigPlugin("testPlugin1")) self.assertFalse(checkConfigPlugin("testPlugin2")) os.chdir("tst")
def testCheckConfigPlugin(self): os.chdir('../') self.assertTrue(checkConfigPlugin("testPlugin1")) self.assertFalse(checkConfigPlugin("testPlugin2")) os.chdir('tst')
def testExcetPluginNotConfig_check(self): with self.assertRaises(PluginIsNotConfigurable): checkConfigPlugin(TEST_PLUG)