mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-29 22:29: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,)))
|
'-' + batch_name,)))
|
||||||
|
|
||||||
|
|
||||||
class PluginRegexpTestCase(PluginTestCase):
|
class PluginRegexpTestCase(ChannelPluginTestCase):
|
||||||
plugins = ()
|
plugins = ()
|
||||||
class PCAR(callbacks.PluginRegexp):
|
class PCAR(callbacks.PluginRegexp):
|
||||||
regexps = ("test",)
|
regexps = ("test", "test2")
|
||||||
|
|
||||||
def test(self, irc, msg, args):
|
def test(self, irc, msg, args):
|
||||||
"<foo>"
|
"<foo>"
|
||||||
raise callbacks.ArgumentError
|
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))
|
self.irc.addCallback(self.PCAR(self.irc))
|
||||||
|
|
||||||
|
def testNoEscapingArgumentError(self):
|
||||||
self.assertResponse('test', 'test <foo>')
|
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):
|
class RichReplyMethodsTestCase(PluginTestCase):
|
||||||
plugins = ('Config',)
|
plugins = ('Config',)
|
||||||
class NoCapability(callbacks.Plugin):
|
class NoCapability(callbacks.Plugin):
|
||||||
|
Loading…
Reference in New Issue
Block a user