Aka: Fix listCommands, which returned tuples instead of strings.

This commit is contained in:
Valentin Lorentz 2013-08-01 10:44:19 +02:00
parent 6cce96868e
commit ba434b1896
2 changed files with 4 additions and 2 deletions

View File

@ -242,8 +242,9 @@ class Aka(callbacks.Plugin):
def listCommands(self): def listCommands(self):
channel = dynamic.channel or 'global' channel = dynamic.channel or 'global'
return list(set(self._db.get_aka_list(channel) + return list(set(map(callbacks.formatCommand,
self._db.get_aka_list('global') + self._db.get_aka_list(channel) +
self._db.get_aka_list('global')) +
self.__parent.listCommands())) self.__parent.listCommands()))
def getCommand(self, args): def getCommand(self, args):

View File

@ -106,6 +106,7 @@ class AkaChannelTestCase(ChannelPluginTestCase):
cb._add_aka('global', 'foobar', 'echo sbbone') cb._add_aka('global', 'foobar', 'echo sbbone')
cb._db.lock_aka('global', 'foobar', 'evil_admin') cb._db.lock_aka('global', 'foobar', 'evil_admin')
self.assertResponse('foobar', 'sbbone') self.assertResponse('foobar', 'sbbone')
self.assertRegexp('list Aka', 'foobar')
self.assertRaises(Aka.AkaError, cb._remove_aka, 'global', 'foobar') self.assertRaises(Aka.AkaError, cb._remove_aka, 'global', 'foobar')
cb._remove_aka('global', 'foobar', evenIfLocked=True) cb._remove_aka('global', 'foobar', evenIfLocked=True)
self.assertNotRegexp('list Aka', 'foobar') self.assertNotRegexp('list Aka', 'foobar')