mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-14 22:22:42 +01:00
Fixed a failing test, showed a results number in search, and added to our standardSubstitute for Dunnos.
This commit is contained in:
parent
eed842270d
commit
6341b26755
@ -78,7 +78,8 @@ class Dunno(plugins.ChannelIdDatabasePlugin):
|
||||
if dunno is not None:
|
||||
dunno = dunno.text
|
||||
prefixName = self.registryValue('prefixNick', channel)
|
||||
dunno = ircutils.standardSubstitute(irc, msg, dunno)
|
||||
env = {'command': tokens[0]}
|
||||
dunno = ircutils.standardSubstitute(irc, msg, dunno, env=env)
|
||||
irc.reply(dunno, prefixName=prefixName)
|
||||
|
||||
|
||||
|
@ -460,7 +460,7 @@ class ChannelIdDatabasePlugin(callbacks.Privmsg):
|
||||
L.append(self.searchSerializeRecord(record))
|
||||
if L:
|
||||
L.sort()
|
||||
irc.reply(utils.commaAndify(L))
|
||||
irc.reply('%s found: %s' % (len(L), utils.commaAndify(L)))
|
||||
else:
|
||||
irc.reply('No matching %s were found.' %
|
||||
utils.pluralize(self.name().lower()))
|
||||
|
@ -46,14 +46,14 @@ class DunnoTestCase(ChannelPluginTestCase, PluginDocumentation):
|
||||
|
||||
def testDunnoSearch(self):
|
||||
self.assertNotError('dunno add foo')
|
||||
self.assertRegexp('dunno search moo', 'No dunnos found')
|
||||
self.assertRegexp('dunno search moo', 'No.*dunnos.*found')
|
||||
self.assertNotError('dunno add moo')
|
||||
self.assertRegexp('dunno search moo', r'\(1 found\)')
|
||||
self.assertRegexp('dunno search m', r'\(1 found\)')
|
||||
self.assertRegexp('dunno search moo', r'1 found')
|
||||
self.assertRegexp('dunno search m', r'1 found')
|
||||
# Test multiple adds
|
||||
for i in range(5):
|
||||
self.assertNotError('dunno add moo%s' % i)
|
||||
self.assertRegexp('dunno search moo', r'\(6 found\)')
|
||||
self.assertRegexp('dunno search moo', r'6 found')
|
||||
|
||||
def testDunnoGet(self):
|
||||
self.assertNotError('dunno add moo')
|
||||
@ -67,3 +67,7 @@ class DunnoTestCase(ChannelPluginTestCase, PluginDocumentation):
|
||||
self.assertNotError('dunno add moo')
|
||||
self.assertNotError('dunno change 1 s/moo/bar/')
|
||||
self.assertRegexp('dunno get 1', '.*?: \'bar\'')
|
||||
|
||||
def testDollarCommand(self):
|
||||
self.assertNotError("dunno add I can't $command.")
|
||||
self.assertResponse('asdf', "I can't asdf.")
|
||||
|
Loading…
Reference in New Issue
Block a user