mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-26 12:49:24 +01:00
test_callbacks: Add PluginRegexpTestCase.testReply to check basic behavior
This commit is contained in:
parent
6a943b8342
commit
3ecb37de10
@ -975,19 +975,33 @@ class MultilinePrivmsgTestCase(ChannelPluginTestCase):
|
||||
'-' + batch_name,)))
|
||||
|
||||
|
||||
class PluginRegexpTestCase(PluginTestCase):
|
||||
class PluginRegexpTestCase(ChannelPluginTestCase):
|
||||
plugins = ()
|
||||
class PCAR(callbacks.PluginRegexp):
|
||||
regexps = ("test",)
|
||||
regexps = ("test", "test2")
|
||||
|
||||
def test(self, irc, msg, args):
|
||||
"<foo>"
|
||||
raise callbacks.ArgumentError
|
||||
|
||||
def testNoEscapingArgumentError(self):
|
||||
def test2(self, irc, msg, args):
|
||||
"<bar>"
|
||||
irc.reply("hello")
|
||||
|
||||
def setUp(self):
|
||||
super().setUp()
|
||||
self.irc.addCallback(self.PCAR(self.irc))
|
||||
|
||||
def testNoEscapingArgumentError(self):
|
||||
self.assertResponse('test', 'test <foo>')
|
||||
|
||||
def testReply(self):
|
||||
self.irc.feedMsg(ircmsgs.IrcMsg(
|
||||
prefix=self.prefix,
|
||||
command='PRIVMSG',
|
||||
args=(self.channel, 'foo <bar> baz')))
|
||||
self.assertResponse(' ', 'hello')
|
||||
|
||||
class RichReplyMethodsTestCase(PluginTestCase):
|
||||
plugins = ('Config',)
|
||||
class NoCapability(callbacks.Plugin):
|
||||
|
Loading…
Reference in New Issue
Block a user