AttackProtector: fix testCleanCollectionAfterPunishment

master
Valentin Lorentz 2010-11-28 12:07:04 +01:00
parent c1ae33edd0
commit 6efff4e630
2 changed files with 4 additions and 1 deletions

View File

@ -96,6 +96,9 @@ class AttackProtectorDatabase:
detection = protector.registryValue(kind + '.detection', channel)
if count >= int(filterParser.match(detection).group('number')):
protector._slot(lastItem)
for index, item in enumerate(collection):
if item.prefix == prefix and item.channel == channel:
collection.pop(index)
class AttackProtector(callbacks.Plugin):

View File

@ -188,7 +188,7 @@ class AttackProtectorTestCase(ChannelPluginTestCase):
self.irc.feedMsg(ircmsgs.join(self.channel, prefix=self.prefix))
self._getIfAnswerIsThisBan()
self.irc.feedMsg(ircmsgs.join(self.channel, prefix=self.prefix))
self.failIf(self._getIfAnswerIsThisBan() == False,
self.failIf(self._getIfAnswerIsThisBan(),
'Doesn\'t clean the join collection after having banned.')