mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-02 07:59:32 +01:00
RootWarner is a ChannelPluginTestCase and should use assertSnarf* asserts
This commit is contained in:
parent
df5c1b4f79
commit
ae8af84e6f
@ -31,31 +31,30 @@
|
|||||||
|
|
||||||
from testsupport import *
|
from testsupport import *
|
||||||
|
|
||||||
class RootWarnerTestCase(PluginTestCase):
|
class RootWarnerTestCase(ChannelPluginTestCase):
|
||||||
plugins = ('RootWarner',)
|
plugins = ('RootWarner',)
|
||||||
config = {'supybot.reply.whenNotCommand': False}
|
|
||||||
|
|
||||||
def test(self):
|
def test(self):
|
||||||
self.irc.feedMsg(ircmsgs.join('#foo', prefix='foo!root@host'))
|
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.irc.feedMsg(ircmsgs.join('#foo', prefix='foo!~root@host'))
|
||||||
self.assertNotError(' ')
|
self.assertSnarfNotError(' ')
|
||||||
self.irc.feedMsg(ircmsgs.join('#foo', prefix='foo!~foo@host'))
|
self.irc.feedMsg(ircmsgs.join('#foo', prefix='foo!~foo@host'))
|
||||||
self.assertNoResponse(' ', 1)
|
self.assertSnarfNoResponse(' ', 1)
|
||||||
|
|
||||||
def testConfigWarn(self):
|
def testConfigWarn(self):
|
||||||
self.irc.feedMsg(ircmsgs.join('#foo', prefix='foo!root@host'))
|
self.irc.feedMsg(ircmsgs.join('#foo', prefix='foo!root@host'))
|
||||||
self.assertNotError(' ')
|
self.assertSnarfNotError(' ')
|
||||||
try:
|
try:
|
||||||
conf.supybot.plugins.RootWarner.warn.setValue(False)
|
conf.supybot.plugins.RootWarner.warn.setValue(False)
|
||||||
self.irc.feedMsg(ircmsgs.join('#foo', prefix='foo!root@host'))
|
self.irc.feedMsg(ircmsgs.join('#foo', prefix='foo!root@host'))
|
||||||
self.assertNoResponse(' ', 1)
|
self.assertSnarfNoResponse(' ', 1)
|
||||||
finally:
|
finally:
|
||||||
conf.supybot.plugins.RootWarner.warn.setValue(True)
|
conf.supybot.plugins.RootWarner.warn.setValue(True)
|
||||||
|
|
||||||
def testConfigKick(self):
|
def testConfigKick(self):
|
||||||
self.irc.feedMsg(ircmsgs.join('#foo', prefix='foo!root@host'))
|
self.irc.feedMsg(ircmsgs.join('#foo', prefix='foo!root@host'))
|
||||||
self.assertNotError(' ')
|
self.assertSnarfNotError(' ')
|
||||||
try:
|
try:
|
||||||
conf.supybot.plugins.RootWarner.warn.setValue(False)
|
conf.supybot.plugins.RootWarner.warn.setValue(False)
|
||||||
conf.supybot.plugins.RootWarner.kick.setValue(True)
|
conf.supybot.plugins.RootWarner.kick.setValue(True)
|
||||||
@ -67,11 +66,5 @@ class RootWarnerTestCase(PluginTestCase):
|
|||||||
conf.supybot.plugins.RootWarner.kick.setValue(False)
|
conf.supybot.plugins.RootWarner.kick.setValue(False)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# vim:set shiftwidth=4 tabstop=8 expandtab textwidth=78:
|
# vim:set shiftwidth=4 tabstop=8 expandtab textwidth=78:
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user