def cmd_is_good(cfg, func, cmd=None, private=False, channel=None, user=None): protocol = Mock(name='protocol') plugin = Mock(name='plugin') plugin.name = 'test' mm = ModuleManager(protocol) mm.get_plugin_cfg = Mock(name='get_plugin_cfg', return_value=cfg) return mm.cmd_is_good(plugin, func, cmd, private, channel, user)
def cmd_is_good( cfg, func, cmd=None, private=False, channel=None, user=None, whois=None): protocol = Mock(name='protocol') @asyncio.coroutine def whois_func(nick): return whois protocol.whois = whois_func plugin = Mock(name='plugin') plugin.name = 'test' mm = ModuleManager(protocol) mm.get_plugin_cfg = Mock(name='get_plugin_cfg', return_value=cfg) return mm.cmd_is_good(plugin, func, cmd, private, channel, user)
def cmd_is_good(cfg, func, cmd=None, private=False, channel=None, user=None, whois=None): protocol = Mock(name='protocol') @asyncio.coroutine def whois_func(nick): return whois protocol.whois = whois_func plugin = Mock(name='plugin') plugin.name = 'test' mm = ModuleManager(protocol) mm.get_plugin_cfg = Mock(name='get_plugin_cfg', return_value=cfg) return mm.cmd_is_good(plugin, func, cmd, private, channel, user)