diff --git a/plugins/ChannelDB.py b/plugins/ChannelDB.py index 29d4f4f6d..1c9d5a7ef 100644 --- a/plugins/ChannelDB.py +++ b/plugins/ChannelDB.py @@ -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)) diff --git a/test/test_ChannelDB.py b/test/test_ChannelDB.py index 436193bd3..ccb367229 100644 --- a/test/test_ChannelDB.py +++ b/test/test_ChannelDB.py @@ -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')