mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-11 20:52:42 +01:00
Remove first person modification of the reason clause and add tests to support it.
This commit is contained in:
parent
78f03078d8
commit
b57311a68e
@ -68,7 +68,7 @@ class Lart(plugins.ChannelIdDatabasePlugin):
|
|||||||
irc.error(format('There are no larts in my database '
|
irc.error(format('There are no larts in my database '
|
||||||
'for %s.', channel))
|
'for %s.', channel))
|
||||||
return
|
return
|
||||||
text = self._replaceFirstPerson(lart.text, msg.nick)
|
text = lart.text
|
||||||
if ircutils.strEqual(target, irc.nick):
|
if ircutils.strEqual(target, irc.nick):
|
||||||
target = msg.nick
|
target = msg.nick
|
||||||
reason = self._replaceFirstPerson('trying to dis me', irc.nick)
|
reason = self._replaceFirstPerson('trying to dis me', irc.nick)
|
||||||
|
@ -29,13 +29,28 @@
|
|||||||
|
|
||||||
from supybot.test import *
|
from supybot.test import *
|
||||||
|
|
||||||
class LartTestCase(PluginTestCase):
|
class LartTestCase(ChannelPluginTestCase):
|
||||||
plugins = ('Lart',)
|
plugins = ('Lart', 'User')
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
ChannelPluginTestCase.setUp(self)
|
||||||
|
# Create a valid user to use
|
||||||
|
self.prefix = 'mf!bar@baz'
|
||||||
|
self.irc.feedMsg(ircmsgs.privmsg(self.nick, 'register tester moo',
|
||||||
|
prefix=self.prefix))
|
||||||
|
m = self.irc.takeMsg() # Response to register.
|
||||||
|
|
||||||
def testAdd(self):
|
def testAdd(self):
|
||||||
self.assertError('lart add foo') # needs $who
|
self.assertError('lart add foo') # needs $who
|
||||||
|
self.assertNotError('lart add smacks $who')
|
||||||
|
|
||||||
def testPraise(self):
|
def testLart(self):
|
||||||
self.assertError('lart foo') # no praises!
|
self.assertError('lart foo') # no praises!
|
||||||
|
self.assertNotError('lart add smacks $who')
|
||||||
|
self.assertAction('lart foo', 'smacks foo')
|
||||||
|
|
||||||
|
def testMeInReason(self):
|
||||||
|
self.assertNotError('lart add makes $who sit by me')
|
||||||
|
self.assertAction('lart foo', 'makes foo sit by me')
|
||||||
|
|
||||||
# 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