RootWarner is a ChannelPluginTestCase and should use assertSnarf* asserts

This commit is contained in:
James Vega 2004-08-26 13:26:47 +00:00
parent df5c1b4f79
commit ae8af84e6f

View File

@ -31,31 +31,30 @@
from testsupport import *
class RootWarnerTestCase(PluginTestCase):
class RootWarnerTestCase(ChannelPluginTestCase):
plugins = ('RootWarner',)
config = {'supybot.reply.whenNotCommand': False}
def test(self):
self.irc.feedMsg(ircmsgs.join('#foo', prefix='foo!root@host'))
self.assertNotError(' ')
self.assertSnarfNotError(' ')
self.irc.feedMsg(ircmsgs.join('#foo', prefix='foo!~root@host'))
self.assertNotError(' ')
self.assertSnarfNotError(' ')
self.irc.feedMsg(ircmsgs.join('#foo', prefix='foo!~foo@host'))
self.assertNoResponse(' ', 1)
self.assertSnarfNoResponse(' ', 1)
def testConfigWarn(self):
self.irc.feedMsg(ircmsgs.join('#foo', prefix='foo!root@host'))
self.assertNotError(' ')
self.assertSnarfNotError(' ')
try:
conf.supybot.plugins.RootWarner.warn.setValue(False)
self.irc.feedMsg(ircmsgs.join('#foo', prefix='foo!root@host'))
self.assertNoResponse(' ', 1)
self.assertSnarfNoResponse(' ', 1)
finally:
conf.supybot.plugins.RootWarner.warn.setValue(True)
def testConfigKick(self):
self.irc.feedMsg(ircmsgs.join('#foo', prefix='foo!root@host'))
self.assertNotError(' ')
self.assertSnarfNotError(' ')
try:
conf.supybot.plugins.RootWarner.warn.setValue(False)
conf.supybot.plugins.RootWarner.kick.setValue(True)
@ -67,11 +66,5 @@ class RootWarnerTestCase(PluginTestCase):
conf.supybot.plugins.RootWarner.kick.setValue(False)
# vim:set shiftwidth=4 tabstop=8 expandtab textwidth=78: