diff --git a/plugins/ChannelStats/plugin.py b/plugins/ChannelStats/plugin.py index 5c6dbfa99..4dc30fb03 100644 --- a/plugins/ChannelStats/plugin.py +++ b/plugins/ChannelStats/plugin.py @@ -309,7 +309,7 @@ class ChannelStats(callbacks.Plugin): str(e).split()[1], Raise=True) except Exception, e: irc.error(utils.exnToString(e), Raise=True) - finally: + else: users.append((v, ircdb.users.getUser(id).name)) users.sort() users.reverse() diff --git a/plugins/ChannelStats/test.py b/plugins/ChannelStats/test.py index 523affa17..dbef82d55 100644 --- a/plugins/ChannelStats/test.py +++ b/plugins/ChannelStats/test.py @@ -75,6 +75,17 @@ class ChannelStatsTestCase(ChannelPluginTestCase): def testNoKeyErrorStats(self): self.assertNotRegexp('stats sweede', 'KeyError') + def testRank(self): + self.assertError('channelstats stats %s' % self.irc.nick) + self.assertNotError('channelstats stats %s' % self.irc.nick) + self.assertNotError('channelstats stats %s' % self.irc.nick) + self.assertNotError('channelstats stats %s' % self.irc.nick.upper()) + self.assertNotError('channelstats stats %s' % self.nick) + self.assertNotError('channelstats stats %s' % self.nick.upper()) + self.assertNotError('channelstats stats') + + self.assertNotError('channelstats rank chars / msgs') + # vim:set shiftwidth=4 softtabstop=4 expandtab textwidth=79: