mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-11 12:42:34 +01:00
Fixed Dunno.change and added a test to make sure it works
This commit is contained in:
parent
a027966aad
commit
0d2724d0f3
@ -202,11 +202,12 @@ class Dunno(callbacks.Privmsg):
|
||||
except:
|
||||
irc.error(msg, '%r is not a valid regexp' % regexp)
|
||||
return
|
||||
dunno = cursor.fetchone()[0]
|
||||
new_dunno = replacer(dunno)
|
||||
cursor.execute("""UPDATE dunnos SET dunno=%s WHERE id=%s""",
|
||||
new_dunno, id)
|
||||
self.db.commit()
|
||||
irc.reply(msg, conf.replySuccess)
|
||||
irc.replySuccess()
|
||||
|
||||
|
||||
|
||||
|
@ -74,3 +74,8 @@ if sqlite is not None:
|
||||
self.assertResponse('dunno get 2', 'Dunno #2: \'$who\'')
|
||||
self.assertError('dunno get 3')
|
||||
self.assertError('dunno get a')
|
||||
|
||||
def testDunnoChange(self):
|
||||
self.assertNotError('dunno add moo')
|
||||
self.assertNotError('dunno change 1 s/moo/bar/')
|
||||
self.assertRegexp('dunno get 1', '.*?: \'bar\'')
|
||||
|
Loading…
Reference in New Issue
Block a user