mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-05 09:42:33 +01:00
Add some Raise=True and a test for multiple replies from Misc.hostmask.
This commit is contained in:
parent
c8af5c886b
commit
cedd6a2b59
@ -316,7 +316,8 @@ class User(callbacks.Privmsg):
|
|||||||
user = ircdb.users.getUser(msg.prefix)
|
user = ircdb.users.getUser(msg.prefix)
|
||||||
if name:
|
if name:
|
||||||
if name != user.name and not user.checkCapability('owner'):
|
if name != user.name and not user.checkCapability('owner'):
|
||||||
irc.error('You may only retrieve your own hostmasks.')
|
irc.error('You may only retrieve your own hostmasks.',
|
||||||
|
Raise=True)
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
user = ircdb.users.getUser(name)
|
user = ircdb.users.getUser(name)
|
||||||
|
@ -344,7 +344,7 @@ def getSeenNick(irc, msg, args, state, errmsg=None):
|
|||||||
except KeyError:
|
except KeyError:
|
||||||
if errmsg is None:
|
if errmsg is None:
|
||||||
errmsg = 'I haven\'t seen %s.' % args[0]
|
errmsg = 'I haven\'t seen %s.' % args[0]
|
||||||
irc.error(errmsg)
|
irc.error(errmsg, Raise=True)
|
||||||
|
|
||||||
def getChannel(irc, msg, args, state):
|
def getChannel(irc, msg, args, state):
|
||||||
if args and irc.isChannel(args[0]):
|
if args and irc.isChannel(args[0]):
|
||||||
|
@ -244,6 +244,9 @@ class MiscTestCase(ChannelPluginTestCase):
|
|||||||
|
|
||||||
def testHostmask(self):
|
def testHostmask(self):
|
||||||
self.assertResponse('hostmask', self.prefix)
|
self.assertResponse('hostmask', self.prefix)
|
||||||
|
self.assertError('@hostmask asdf')
|
||||||
|
m = self.irc.takeMsg()
|
||||||
|
self.failIf(m is not None, m)
|
||||||
|
|
||||||
def testApropos(self):
|
def testApropos(self):
|
||||||
self.assertNotError('apropos f')
|
self.assertNotError('apropos f')
|
||||||
|
Loading…
Reference in New Issue
Block a user