mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-20 09:29:24 +01:00
Network: accept empty args in 'command' and 'cmdall'
Closes GH-1541
This commit is contained in:
parent
2902a85dbd
commit
b4bf877e77
@ -150,7 +150,7 @@ class Network(callbacks.Plugin):
|
|||||||
Gives the bot <command> (with its associated <arg>s) on <network>.
|
Gives the bot <command> (with its associated <arg>s) on <network>.
|
||||||
"""
|
"""
|
||||||
self.Proxy(otherIrc, msg, commandAndArgs, replyIrc=irc)
|
self.Proxy(otherIrc, msg, commandAndArgs, replyIrc=irc)
|
||||||
command = wrap(command, ['admin', ('networkIrc', True), many('something')])
|
command = wrap(command, ['admin', ('networkIrc', True), many('anything')])
|
||||||
|
|
||||||
def cmdall(self, irc, msg, args, commandAndArgs):
|
def cmdall(self, irc, msg, args, commandAndArgs):
|
||||||
"""<command> [<arg> ...]
|
"""<command> [<arg> ...]
|
||||||
@ -160,7 +160,7 @@ class Network(callbacks.Plugin):
|
|||||||
ircs = world.ircs
|
ircs = world.ircs
|
||||||
for ircd in ircs:
|
for ircd in ircs:
|
||||||
self.Proxy(ircd, msg, commandAndArgs)
|
self.Proxy(ircd, msg, commandAndArgs)
|
||||||
cmdall = wrap(cmdall, ['admin', many('something')])
|
cmdall = wrap(cmdall, ['admin', many('anything')])
|
||||||
|
|
||||||
###
|
###
|
||||||
# whois command-related stuff.
|
# whois command-related stuff.
|
||||||
|
@ -38,6 +38,9 @@ class NetworkTestCase(PluginTestCase):
|
|||||||
def testCommand(self):
|
def testCommand(self):
|
||||||
self.assertResponse('network command %s echo 1' % self.irc.network,
|
self.assertResponse('network command %s echo 1' % self.irc.network,
|
||||||
'1')
|
'1')
|
||||||
|
# empty args should be allowed, see
|
||||||
|
# https://github.com/progval/Limnoria/issues/1541
|
||||||
|
self.assertResponse('network command %s len ""' % self.irc.network, '0')
|
||||||
|
|
||||||
def testCommandRoutesBackToCaller(self):
|
def testCommandRoutesBackToCaller(self):
|
||||||
self.otherIrc = getTestIrc("testnet1")
|
self.otherIrc = getTestIrc("testnet1")
|
||||||
|
Loading…
Reference in New Issue
Block a user