mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-24 11:42:52 +01:00
Fixed bug with commandsOnStart not being called unless they were already canonical names.
This commit is contained in:
parent
8d9eb27a2f
commit
094bdee30b
@ -640,7 +640,7 @@ class Privmsg(irclib.IrcCallback):
|
||||
fakeIrc = ConfigIrcProxy(irc)
|
||||
for args in conf.commandsOnStart:
|
||||
args = args[:]
|
||||
command = args.pop(0)
|
||||
command = canonicalName(args.pop(0))
|
||||
if self.isCommand(command):
|
||||
#debug.printf('%s: %r' % (command, args))
|
||||
method = getattr(self, command)
|
||||
|
@ -260,6 +260,17 @@ class PrivmsgTestCase(ChannelPluginTestCase):
|
||||
self.assertError('first blah')
|
||||
self.assertResponse('third foo bar baz', 'foo bar baz')
|
||||
|
||||
def testConfigureHandlesNonCanonicalCommands(self):
|
||||
try:
|
||||
original = conf.commandsOnStart
|
||||
tokens = callbacks.tokenize('Admin setprefixchar $')
|
||||
conf.commandsOnStart = [tokens]
|
||||
self.assertNotError('load Admin')
|
||||
self.assertEqual(conf.prefixChars, '$')
|
||||
finally:
|
||||
conf.commandsOnStart = original
|
||||
|
||||
|
||||
|
||||
class PrivmsgCommandAndRegexpTestCase(PluginTestCase):
|
||||
plugins = ('Utilities',) # Gotta put something.
|
||||
@ -269,7 +280,7 @@ class PrivmsgCommandAndRegexpTestCase(PluginTestCase):
|
||||
raise callbacks.ArgumentError
|
||||
def testNoEscapingArgumentError(self):
|
||||
self.irc.addCallback(self.PCAR())
|
||||
self.assertResponse('test', 'test <foo>')
|
||||
self.assertResponse('test', 'PCAR test <foo>')
|
||||
|
||||
|
||||
# vim:set shiftwidth=4 tabstop=8 expandtab textwidth=78:
|
||||
|
Loading…
Reference in New Issue
Block a user