def testPlugin(self): w = Worker() w.register_plugin(PluginTrafficAccountingInfoMox) w.register_plugin(PluginAgentInfo) assert len(w.plugins) == 2 w.clear_plugin() assert len(w.plugins) == 0 print "Plugin test \t[\033[1;33mOK\033[0m]"
def testInfoPush(self): self.mox.ReplayAll() w = Worker(context = ZmqContextMox()) w.register_plugin(PluginTrafficAccountingInfoMox) w.register_plugin(PluginAgentInfo) w.info_push() self.mox.VerifyAll() print "info_push test \t[\033[1;33mOK\033[0m]"