def test_plugin_errors(): count = 0 for (name, err) in cache.get_errors().iteritems(): count += 1 if err.__class__.__name__ == 'ImportError': log.warn("Import Error [%s]: %s", name, err) else: log.warn("Syntax Error [%s]: %s: %s", name, err.__class__.__name__, err) yield assertTrue(False) # yield failure assert count==0
def test_plugin_errors(): count = 0 for (name, err) in cache.get_errors().iteritems(): count += 1 if err.__class__.__name__ == 'ImportError': log.warn("Import Error [%s]: %s", name, err) else: log.warn("Syntax Error [%s]: %s: %s", name, err.__class__.__name__, err) yield assertTrue(False) # yield failure assert count == 0
def test_pluginscan(): plugins = [] d = os.path.dirname(__file__) for path in [ os.path.join(d, '../../plugin'), os.path.join(d, '../../rndplugins') ]: path = os.path.normpath(os.path.abspath(path)) if not os.path.exists(path): logger.debug("skipping '%s'", path) continue for (dirpath, dirnames, filenames) in os.walk(path): for name in dirnames: launchsh = os.path.join(dirpath, name, 'launch.sh') if os.path.exists(launchsh): plugins.append((name, launchsh)) continue # Find all instances of PluginName/PluginName.py plugindef = os.path.join(dirpath, name, name + '.py') if os.path.exists(plugindef): #sys.path.append(os.path.join(dirpath, name)) plugins.append((name, plugindef)) logger.debug("Plugins: '%s'", plugins) cache.set_installed_modules(plugins) for (name, err) in cache.get_errors().iteritems(): if err.__class__.__name__ == 'ImportError': logger.warn("Import Error [%s]: %s", name, err) else: logger.warn("Syntax Error [%s]: %s: %s", name, err.__class__.__name__, err) for m in cache.get_plugins(): cls = cache.get_plugin(m) if not cls: continue logger.info("Plugin Name: %s", m) yield check_plugin, cls
def test_pluginscan(): plugins = [] d = os.path.dirname(__file__) for path in [os.path.join(d,'../../plugin'), os.path.join(d,'../../rndplugins') ]: path = os.path.normpath(os.path.abspath(path)) if not os.path.exists(path): logger.debug("skipping '%s'", path) continue for (dirpath, dirnames, filenames) in os.walk(path): for name in dirnames: launchsh = os.path.join(dirpath, name, 'launch.sh') if os.path.exists(launchsh): plugins.append( (name, launchsh) ) continue # Find all instances of PluginName/PluginName.py plugindef = os.path.join(dirpath, name, name + '.py') if os.path.exists(plugindef): #sys.path.append(os.path.join(dirpath, name)) plugins.append( (name, plugindef) ) logger.debug("Plugins: '%s'", plugins) cache.set_installed_modules(plugins) for (name, err) in cache.get_errors().iteritems(): if err.__class__.__name__ == 'ImportError': logger.warn("Import Error [%s]: %s", name, err) else: logger.warn("Syntax Error [%s]: %s: %s", name, err.__class__.__name__, err) for m in cache.get_plugins(): cls = cache.get_plugin(m) if not cls: continue logger.info("Plugin Name: %s", m) yield check_plugin, cls