Fixed final syntax error, added test.

This commit is contained in:
Jeremy Fincher 2007-10-23 05:04:23 +00:00 committed by James Vega
parent 67d262a575
commit 9a43f04248
2 changed files with 12 additions and 1 deletions

View File

@ -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()

View File

@ -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: