mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 13:19:24 +01:00
Changed karma pluralization to use utils.pluralize() and fixed the tests to
avoid erroring due to ambiguous commands for 'stats' (since 'User' is also loaded for the tests)
This commit is contained in:
parent
0400f02f13
commit
bfdbda625a
@ -370,8 +370,8 @@ class ChannelDB(plugins.ChannelDBHandler, callbacks.PrivmsgCommandAndRegexp):
|
||||
total = added - subtracted
|
||||
s = 'Karma for %r has been increased %s %s ' \
|
||||
'and decreased %s %s for a total karma of %s.' % \
|
||||
(name, added, added == 1 and 'time' or 'times',
|
||||
subtracted, subtracted == 1 and 'time' or 'times', total)
|
||||
(name, added, utils.pluralize(added, 'time'),
|
||||
subtracted, utils.pluralize(subtracted, 'time'), total)
|
||||
irc.reply(msg, s)
|
||||
elif len(args) > 1:
|
||||
criteria = ' OR '.join(['name=%s'] * len(args))
|
||||
|
@ -54,11 +54,11 @@ if sqlite is not None:
|
||||
self.assertNotError('channelstats')
|
||||
|
||||
def testStats(self):
|
||||
self.assertError('stats %s' % self.nick)
|
||||
self.assertNotError('stats %s' % self.nick)
|
||||
self.assertNotError('stats %s' % self.nick.upper())
|
||||
self.assertNotError('stats')
|
||||
self.assertRegexp('stats', self.nick)
|
||||
self.assertError('channeldb stats %s' % self.nick)
|
||||
self.assertNotError('channeldb stats %s' % self.nick)
|
||||
self.assertNotError('channeldb stats %s' % self.nick.upper())
|
||||
self.assertNotError('channeldb stats')
|
||||
self.assertRegexp('channeldb stats', self.nick)
|
||||
|
||||
def testNoKeyErrorEscapeFromSeen(self):
|
||||
self.assertRegexp('seen asldfkjasdlfkj', 'I have not seen')
|
||||
|
Loading…
Reference in New Issue
Block a user