mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-23 02:24:12 +01:00
Fixed an error in hostmask.list when there are no hostmasks.
This commit is contained in:
parent
5c8677cf22
commit
766dad2f70
@ -246,8 +246,11 @@ class User(callbacks.Plugin):
|
||||
"""
|
||||
def getHostmasks(user):
|
||||
hostmasks = map(repr, user.hostmasks)
|
||||
if hostmasks:
|
||||
hostmasks.sort()
|
||||
return format('%L', hostmasks)
|
||||
else:
|
||||
irc.reply(format('%s has no registered hostmasks.', user))
|
||||
try:
|
||||
user = ircdb.users.getUser(msg.prefix)
|
||||
if name:
|
||||
|
@ -47,6 +47,15 @@ class UserTestCase(PluginTestCase):
|
||||
self.assertNotError('hostmask add foo')
|
||||
self.assertNotRegexp('hostmask add foo', 'IrcSet')
|
||||
|
||||
def testHostmaskListHandlesEmptyListGracefully(self):
|
||||
self.assertError('hostmask list')
|
||||
self.prefix = self.prefix1
|
||||
self.assertNotError('register foo bar')
|
||||
self.assertNotError('hostmask remove foo %s' % self.prefix1)
|
||||
self.assertNotError('identify foo bar')
|
||||
self.assertRegexp('hostmask list', 'no registered hostmasks')
|
||||
|
||||
|
||||
def testHostmask(self):
|
||||
self.assertResponse('hostmask', self.prefix)
|
||||
self.assertError('@hostmask asdf')
|
||||
|
Loading…
Reference in New Issue
Block a user