mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-23 11:09:23 +01:00
Fixed tests.
This commit is contained in:
parent
781ff46653
commit
55c392fae3
@ -197,8 +197,7 @@ class ChannelStats(plugins.ChannelDBHandler, callbacks.Privmsg):
|
||||
actions=actions+%s, smileys=smileys+%s,
|
||||
frowns=frowns+%s
|
||||
WHERE user_id=%s""",
|
||||
int(time.time()), s, chars, words, int(isAction),
|
||||
smileys, frowns, id)
|
||||
chars, words, int(isAction), smileys, frowns, id)
|
||||
db.commit()
|
||||
|
||||
def outFilter(self, irc, msg):
|
||||
@ -312,7 +311,9 @@ class ChannelStats(plugins.ChannelDBHandler, callbacks.Privmsg):
|
||||
"""
|
||||
channel = privmsgs.getChannel(msg, args)
|
||||
name = privmsgs.getArgs(args, required=0, optional=1)
|
||||
if not name:
|
||||
if name == irc.nick:
|
||||
id = 0
|
||||
elif not name:
|
||||
try:
|
||||
id = ircdb.users.getUserId(msg.prefix)
|
||||
name = ircdb.users.getUser(id).name
|
||||
|
@ -71,10 +71,13 @@ if sqlite is not None:
|
||||
u = ircdb.users.getUser(id)
|
||||
u.addCapability(ircdb.makeChannelCapability(self.channel, 'op'))
|
||||
ircdb.users.setUser(id, u)
|
||||
self.assertNotError('channelstats config self-stats off')
|
||||
try:
|
||||
conf.supybot.plugins.ChannelStats.selfStats.setValue(False)
|
||||
m1 = self.getMsg('channelstats stats %s' % self.irc.nick)
|
||||
m2 = self.getMsg('channelstats stats %s' % self.irc.nick)
|
||||
self.assertEqual(m1.args[1], m2.args[1])
|
||||
finally:
|
||||
conf.supybot.plugins.ChannelStats.selfStats.setValue(True)
|
||||
|
||||
def testNoKeyErrorStats(self):
|
||||
self.assertNotRegexp('stats sweede', 'KeyError')
|
||||
|
Loading…
Reference in New Issue
Block a user