mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-10 20:22:36 +01:00
Alias: Fix @remove for escaped aliases.
This commit is contained in:
parent
33a236079f
commit
b09245a1c6
@ -359,7 +359,11 @@ class Alias(callbacks.Plugin):
|
||||
if name in self.aliases and self.isCommandMethod(name):
|
||||
if evenIfLocked or not self.aliases[name][1]:
|
||||
del self.aliases[name]
|
||||
conf.supybot.plugins.Alias.aliases.unregister(name)
|
||||
if '.' in name or '|' in name:
|
||||
conf.supybot.plugins.Alias.escapedaliases.unregister(
|
||||
escapeAlias(name))
|
||||
else:
|
||||
conf.supybot.plugins.Alias.aliases.unregister(name)
|
||||
else:
|
||||
raise AliasError, 'That alias is locked.'
|
||||
else:
|
||||
|
@ -147,6 +147,13 @@ class EscapedAliasTestCase(ChannelPluginTestCase):
|
||||
self.assertNotError('alias add spam|egg echo hey')
|
||||
self.assertResponse('spam|egg', 'hey')
|
||||
|
||||
self.assertNotError('alias remove spam.egg')
|
||||
self.assertError('spam.egg')
|
||||
self.assertNotError('spam|egg')
|
||||
self.assertNotError('alias remove spam|egg')
|
||||
self.assertError('spam.egg')
|
||||
self.assertError('spam|egg')
|
||||
|
||||
def testWriteDatabase(self):
|
||||
self.assertNotError('alias add fooo.spam echo egg')
|
||||
self.assertResponse('fooo.spam', 'egg')
|
||||
|
Loading…
Reference in New Issue
Block a user