mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 05:09:23 +01:00
Made removeHostmask remove all the matching hostmasks.
This commit is contained in:
parent
0b90d80fee
commit
9a7de79467
@ -267,7 +267,7 @@ class IrcUser(object):
|
|||||||
|
|
||||||
def removeHostmask(self, hostmask):
|
def removeHostmask(self, hostmask):
|
||||||
"""Removes a hostmask from the user's hostmasks."""
|
"""Removes a hostmask from the user's hostmasks."""
|
||||||
self.hostmasks.remove(hostmask)
|
self.hostmasks = [s for s in self.hostmasks if s != hostmask]
|
||||||
|
|
||||||
def setAuth(self, hostmask):
|
def setAuth(self, hostmask):
|
||||||
"""Sets a user's authenticated hostmask. This times out in 1 hour."""
|
"""Sets a user's authenticated hostmask. This times out in 1 hour."""
|
||||||
|
@ -203,6 +203,14 @@ class IrcUserTestCase(unittest.TestCase):
|
|||||||
self.assertRaises(KeyError, u.checkCapability, 'foo')
|
self.assertRaises(KeyError, u.checkCapability, 'foo')
|
||||||
self.assertRaises(KeyError, u.checkCapability, '-bar')
|
self.assertRaises(KeyError, u.checkCapability, '-bar')
|
||||||
|
|
||||||
|
def testRemoveHostmask(self):
|
||||||
|
u = ircdb.IrcUser()
|
||||||
|
u.addHostmask('foo!bar@baz')
|
||||||
|
self.failUnless(u.checkHostmask('foo!bar@baz'))
|
||||||
|
u.addHostmask('foo!bar@baz')
|
||||||
|
u.removeHostmask('foo!bar@baz')
|
||||||
|
self.failIf(u.checkHostmask('foo!bar@baz'))
|
||||||
|
|
||||||
def testOwner(self):
|
def testOwner(self):
|
||||||
u = ircdb.IrcUser()
|
u = ircdb.IrcUser()
|
||||||
u.addCapability('owner')
|
u.addCapability('owner')
|
||||||
|
Loading…
Reference in New Issue
Block a user