Fixed bug with reload not working with non-canonicalNames.

This commit is contained in:
Jeremy Fincher 2003-10-30 18:05:57 +00:00
parent c318d5e384
commit c3d7efa68b
2 changed files with 7 additions and 1 deletions

View File

@ -439,7 +439,10 @@ class Irc(IrcCommandDispatcher):
def removeCallback(self, name): def removeCallback(self, name):
"""Removes a callback from the callback list.""" """Removes a callback from the callback list."""
(bad, good) = partition(lambda cb: cb.name() == name, self.callbacks) name = name.lower()
def nameMatches(cb):
return cb.name().lower() == name
(bad, good) = partition(nameMatches, self.callbacks)
self.callbacks[:] = good self.callbacks[:] = good
return bad return bad

View File

@ -99,12 +99,15 @@ class OwnerTestCase(PluginTestCase, PluginDocumentation):
self.assertError('reload Admin') self.assertError('reload Admin')
self.assertNotError('load Admin') self.assertNotError('load Admin')
self.assertNotError('reload Admin') self.assertNotError('reload Admin')
self.assertNotError('reload ADMIN')
def testUnload(self): def testUnload(self):
self.assertError('unload Admin') self.assertError('unload Admin')
self.assertNotError('load Admin') self.assertNotError('load Admin')
self.assertNotError('unload Admin') self.assertNotError('unload Admin')
self.assertError('unload Admin') self.assertError('unload Admin')
self.assertNotError('load ADMIN')
self.assertNotError('unload ADMIN')
def testSetconf(self): def testSetconf(self):
self.assertRegexp('setconf', 'confDir') self.assertRegexp('setconf', 'confDir')