Remove first person modification of the reason clause and add tests to support it.

This commit is contained in:
James Vega 2006-11-13 20:27:23 +00:00
parent 78f03078d8
commit b57311a68e
2 changed files with 19 additions and 4 deletions

View File

@ -68,7 +68,7 @@ class Lart(plugins.ChannelIdDatabasePlugin):
irc.error(format('There are no larts in my database '
'for %s.', channel))
return
text = self._replaceFirstPerson(lart.text, msg.nick)
text = lart.text
if ircutils.strEqual(target, irc.nick):
target = msg.nick
reason = self._replaceFirstPerson('trying to dis me', irc.nick)

View File

@ -29,13 +29,28 @@
from supybot.test import *
class LartTestCase(PluginTestCase):
plugins = ('Lart',)
class LartTestCase(ChannelPluginTestCase):
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):
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.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: