mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-02 17:29:22 +01:00
For some reason I was replacing the bot's name with the user's name
This commit is contained in:
parent
8c93488146
commit
d50d435363
@ -154,7 +154,7 @@ class FunDB(callbacks.Privmsg):
|
|||||||
else:
|
else:
|
||||||
(id, insult) = cursor.fetchone()
|
(id, insult) = cursor.fetchone()
|
||||||
nick = nick.strip()
|
nick = nick.strip()
|
||||||
nick = re.sub(r'\b(?:me|%s)\b' % irc.nick, msg.nick, nick)
|
nick = re.sub(r'\bme\b', msg.nick, nick)
|
||||||
nick = re.sub(r'\bmy\b', '%s\'s' % msg.nick, nick)
|
nick = re.sub(r'\bmy\b', '%s\'s' % msg.nick, nick)
|
||||||
insultee = nick
|
insultee = nick
|
||||||
insult = insult.replace("$who", insultee)
|
insult = insult.replace("$who", insultee)
|
||||||
@ -426,8 +426,8 @@ class FunDB(callbacks.Privmsg):
|
|||||||
irc.error(msg, 'There are currently no available larts.')
|
irc.error(msg, 'There are currently no available larts.')
|
||||||
else:
|
else:
|
||||||
(id, lart) = cursor.fetchone()
|
(id, lart) = cursor.fetchone()
|
||||||
nick = re.sub(r'\b(?:me|%s)\b' % irc.nick, msg.nick, nick)
|
nick = re.sub(r'\bme\b', msg.nick, nick)
|
||||||
reason = re.sub(r'\b(?:me|%s)\b' % irc.nick, msg.nick, reason)
|
reason = re.sub(r'\bme\b', msg.nick, reason)
|
||||||
nick = re.sub(r'\bmy\b', '%s\'s' % msg.nick, nick)
|
nick = re.sub(r'\bmy\b', '%s\'s' % msg.nick, nick)
|
||||||
reason = re.sub(r'\bmy\b', '%s\'s' % msg.nick, reason)
|
reason = re.sub(r'\bmy\b', '%s\'s' % msg.nick, reason)
|
||||||
lartee = nick
|
lartee = nick
|
||||||
@ -478,8 +478,8 @@ class FunDB(callbacks.Privmsg):
|
|||||||
irc.error(msg, 'There are currently no available praises.')
|
irc.error(msg, 'There are currently no available praises.')
|
||||||
else:
|
else:
|
||||||
(id, praise) = cursor.fetchone()
|
(id, praise) = cursor.fetchone()
|
||||||
nick = re.sub(r'\b(?:me|%s)\b' % irc.nick, msg.nick, nick)
|
nick = re.sub(r'\bme\b', msg.nick, nick)
|
||||||
reason = re.sub(r'\b(?:me|%s)\b' % irc.nick, msg.nick, reason)
|
reason = re.sub(r'\bme\b', msg.nick, reason)
|
||||||
nick = re.sub(r'\bmy\b', '%s\'s' % msg.nick, nick)
|
nick = re.sub(r'\bmy\b', '%s\'s' % msg.nick, nick)
|
||||||
reason = re.sub(r'\bmy\b', '%s\'s' % msg.nick, reason)
|
reason = re.sub(r'\bmy\b', '%s\'s' % msg.nick, reason)
|
||||||
praisee = nick
|
praisee = nick
|
||||||
|
@ -38,7 +38,12 @@ except ImportError:
|
|||||||
|
|
||||||
if sqlite is not None:
|
if sqlite is not None:
|
||||||
class TestFunDB(PluginTestCase, PluginDocumentation):
|
class TestFunDB(PluginTestCase, PluginDocumentation):
|
||||||
plugins = ('FunDB',)
|
plugins = ('FunDB','User','Utilities')
|
||||||
|
|
||||||
|
def setUp(self):
|
||||||
|
PluginTestCase.setUp(self)
|
||||||
|
self.prefix = 't3st!bar@foo.com'
|
||||||
|
self.assertNotError('register t3st moo')
|
||||||
|
|
||||||
def testAdd(self):
|
def testAdd(self):
|
||||||
self.assertError('add l4rt foo')
|
self.assertError('add l4rt foo')
|
||||||
@ -74,24 +79,26 @@ if sqlite is not None:
|
|||||||
self.assertNotError('add lart jabs $who')
|
self.assertNotError('add lart jabs $who')
|
||||||
self.assertNotError('add praise pets $who')
|
self.assertNotError('add praise pets $who')
|
||||||
self.assertNotError('add insult foo')
|
self.assertNotError('add insult foo')
|
||||||
self.assertRegexp('lart me', 'jabs test \(#1\)')
|
self.assertRegexp('lart me', 'jabs t3st \(#1\)')
|
||||||
self.assertRegexp('praise me', 'pets test \(#1\)')
|
self.assertRegexp('praise me', 'pets t3st \(#1\)')
|
||||||
self.assertRegexp('insult me', 'test: foo \(#1\)')
|
self.assertRegexp('insult me', 't3st: foo \(#1\)')
|
||||||
self.assertRegexp('lart whamme', 'jabs whamme \(#1\)')
|
self.assertRegexp('lart whamme', 'jabs whamme \(#1\)')
|
||||||
self.assertRegexp('praise whamme', 'pets whamme \(#1\)')
|
self.assertRegexp('praise whamme', 'pets whamme \(#1\)')
|
||||||
self.assertRegexp('insult whamme', 'whamme: foo \(#1\)')
|
self.assertRegexp('insult whamme', 'whamme: foo \(#1\)')
|
||||||
self.assertRegexp('lart my knee', 'jabs test\'s knee \(#1\)')
|
self.assertRegexp('lart my knee', 'jabs t3st\'s knee \(#1\)')
|
||||||
self.assertRegexp('praise my knee', 'pets test\'s knee \(#1\)')
|
self.assertRegexp('praise my knee', 'pets t3st\'s knee \(#1\)')
|
||||||
self.assertRegexp('insult my knee', 'test\'s knee: foo \(#1\)')
|
self.assertRegexp('insult my knee', 't3st\'s knee: foo \(#1\)')
|
||||||
self.assertRegexp('lart sammy the snake', 'jabs sammy the snake'\
|
self.assertRegexp('lart sammy the snake', 'jabs sammy the snake'\
|
||||||
' \(#1\)')
|
' \(#1\)')
|
||||||
self.assertRegexp('praise sammy the snake', 'pets sammy the snake'\
|
self.assertRegexp('praise sammy the snake', 'pets sammy the snake'\
|
||||||
' \(#1\)')
|
' \(#1\)')
|
||||||
self.assertRegexp('insult sammy the snake', 'sammy the snake: foo'\
|
self.assertRegexp('insult sammy the snake', 'sammy the snake: foo'\
|
||||||
' \(#1\)')
|
' \(#1\)')
|
||||||
self.assertRegexp('lart me for my', 'jabs test for test\'s \(#1\)')
|
self.assertRegexp('lart me for my', 'jabs t3st for t3st\'s \(#1\)')
|
||||||
self.assertRegexp('praise me for my','pets test for test\'s '\
|
self.assertRegexp('praise me for my', 'pets t3st for t3st\'s '\
|
||||||
'\(#1\)')
|
'\(#1\)')
|
||||||
|
self.assertRegexp('lart me and %s' % self.irc.nick, 'jabs t3st '\
|
||||||
|
'and %s \(#1\)' % self.irc.nick)
|
||||||
self.assertNotError('remove lart 1')
|
self.assertNotError('remove lart 1')
|
||||||
self.assertNotError('remove praise 1')
|
self.assertNotError('remove praise 1')
|
||||||
self.assertNotError('remove insult 1')
|
self.assertNotError('remove insult 1')
|
||||||
|
Loading…
Reference in New Issue
Block a user