mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-24 11:42:52 +01:00
Channel: Fix test failures from making ignores and bans use banmask
Signed-off-by: James Vega <jamessan@users.sourceforge.net>
This commit is contained in:
parent
8bd37dbff7
commit
b644e30bb6
@ -1,5 +1,6 @@
|
|||||||
###
|
###
|
||||||
# Copyright (c) 2002-2005, Jeremiah Fincher
|
# Copyright (c) 2002-2005, Jeremiah Fincher
|
||||||
|
# Copyright (c) 2009, James Vega
|
||||||
# All rights reserved.
|
# All rights reserved.
|
||||||
#
|
#
|
||||||
# Redistribution and use in source and binary forms, with or without
|
# Redistribution and use in source and binary forms, with or without
|
||||||
@ -169,6 +170,9 @@ class ChannelTestCase(ChannelPluginTestCase):
|
|||||||
## self.assertError('kban %s' % self.irc.nick)
|
## self.assertError('kban %s' % self.irc.nick)
|
||||||
|
|
||||||
def testBan(self):
|
def testBan(self):
|
||||||
|
origban = conf.supybot.protocols.irc.banmask()
|
||||||
|
try:
|
||||||
|
conf.supybot.protocols.irc.banmask.setValue(['exact'])
|
||||||
self.assertNotError('ban add foo!bar@baz')
|
self.assertNotError('ban add foo!bar@baz')
|
||||||
self.assertNotError('ban remove foo!bar@baz')
|
self.assertNotError('ban remove foo!bar@baz')
|
||||||
orig = conf.supybot.protocols.irc.strictRfc()
|
orig = conf.supybot.protocols.irc.strictRfc()
|
||||||
@ -180,12 +184,19 @@ class ChannelTestCase(ChannelPluginTestCase):
|
|||||||
self.assertNotRegexp('ban add not!a.hostmask', 'KeyError')
|
self.assertNotRegexp('ban add not!a.hostmask', 'KeyError')
|
||||||
finally:
|
finally:
|
||||||
conf.supybot.protocols.irc.strictRfc.setValue(orig)
|
conf.supybot.protocols.irc.strictRfc.setValue(orig)
|
||||||
|
finally:
|
||||||
|
conf.supybot.protocols.irc.banmask.setValue(origban)
|
||||||
|
|
||||||
def testIgnore(self):
|
def testIgnore(self):
|
||||||
|
orig = conf.supybot.protocols.irc.banmask()
|
||||||
|
try:
|
||||||
|
conf.supybot.protocols.irc.banmask.setValue(['exact'])
|
||||||
self.assertNotError('channel ignore add foo!bar@baz')
|
self.assertNotError('channel ignore add foo!bar@baz')
|
||||||
self.assertResponse('channel ignore list', "'foo!bar@baz'")
|
self.assertResponse('channel ignore list', "'foo!bar@baz'")
|
||||||
self.assertNotError('channel ignore remove foo!bar@baz')
|
self.assertNotError('channel ignore remove foo!bar@baz')
|
||||||
self.assertError('ban add not!a.hostmask')
|
self.assertError('ban add not!a.hostmask')
|
||||||
|
finally:
|
||||||
|
conf.supybot.protocols.irc.banmask.setValue(orig)
|
||||||
|
|
||||||
# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
|
# vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79:
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user