mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-24 11:04:05 +01:00
Admin: Fix @acmd
This commit is contained in:
parent
1455a83391
commit
fd97f78f93
@ -355,8 +355,8 @@ class Admin(callbacks.Plugin):
|
||||
|
||||
Perform <command> (with associated <arg>s on all channels on current network."""
|
||||
for channel in irc.state.channels:
|
||||
msg.args[0] = channel
|
||||
self.Proxy(irc, msg, commandAndArgs)
|
||||
msg = ircmsgs.IrcMsg(msg=msg, args=(channel, *msg.args[1:]))
|
||||
self.Proxy(irc.getRealIrc(), msg, commandAndArgs)
|
||||
acmd = wrap(acmd, ['admin', many('something')])
|
||||
|
||||
|
||||
|
@ -30,7 +30,7 @@
|
||||
from supybot.test import *
|
||||
|
||||
class AdminTestCase(PluginTestCase):
|
||||
plugins = ('Admin',)
|
||||
plugins = ('Admin', 'Utilities')
|
||||
def testChannels(self):
|
||||
def getAfterJoinMessages():
|
||||
m = self.irc.takeMsg()
|
||||
@ -121,5 +121,19 @@ class AdminTestCase(PluginTestCase):
|
||||
finally:
|
||||
world.testing = True
|
||||
|
||||
def testAcmd(self):
|
||||
self.irc.feedMsg(ircmsgs.join('#foo', prefix=self.prefix))
|
||||
self.irc.feedMsg(ircmsgs.join('#bar', prefix=self.prefix))
|
||||
while self.irc.takeMsg():
|
||||
pass
|
||||
msgs = []
|
||||
msg = self.getMsg('acmd echo hi $channel')
|
||||
while msg:
|
||||
msgs.append(msg)
|
||||
msg = self.irc.takeMsg()
|
||||
self.assertCountEqual(
|
||||
[(msg.command, *msg.args) for msg in msgs],
|
||||
[("PRIVMSG", "#foo", "hi #foo"), ("PRIVMSG", "#bar", "hi #bar")])
|
||||
|
||||
# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user