mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 05:09:23 +01:00
Fixed escaping KeyError and added test.
This commit is contained in:
parent
2719812074
commit
e386518997
@ -276,8 +276,8 @@ class ChannelDB(callbacks.PrivmsgCommandAndRegexp, ChannelDBHandler):
|
||||
channel = privmsgs.getChannel(msg, args)
|
||||
name = privmsgs.getArgs(args)
|
||||
if not ircdb.users.hasUser(name):
|
||||
hostmask = irc.state.nickToHostmask(name)
|
||||
try:
|
||||
hostmask = irc.state.nickToHostmask(name)
|
||||
name = ircdb.users.getUserName(hostmask)
|
||||
except KeyError:
|
||||
irc.error(msg, conf.replyNoUser)
|
||||
|
@ -38,6 +38,10 @@ class ChannelDBTestCase(ChannelPluginTestCase, PluginDocumentation):
|
||||
self.assertNotError('channelstats')
|
||||
self.assertNotError('channelstats')
|
||||
|
||||
def testNoKeyErrorEscapeFromSeen(self):
|
||||
self.assertRegexp('seen asldfkjasdlfkj', conf.replyNoUser)
|
||||
self.assertNotRegexp('seen asldfkjasdlfkj', 'KeyError')
|
||||
|
||||
|
||||
# vim:set shiftwidth=4 tabstop=8 expandtab textwidth=78:
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user