Add working unit tests for new channel command
This commit is contained in:
parent
aa5a07f6d0
commit
3c4578b648
7 changed files with 309 additions and 134 deletions
|
|
@ -208,6 +208,7 @@ class DefaultChannel(ChannelDB, metaclass=TypeclassBase):
|
|||
banlist = self.banlist
|
||||
if target not in banlist:
|
||||
banlist.append(target)
|
||||
self.db.ban_list = banlist
|
||||
return True
|
||||
return False
|
||||
|
||||
|
|
@ -226,9 +227,10 @@ class DefaultChannel(ChannelDB, metaclass=TypeclassBase):
|
|||
bool: True if unbanning was successful, False if target was not
|
||||
previously banned.
|
||||
"""
|
||||
banlist = self.banlist
|
||||
if target not in banlist:
|
||||
banlist.append(target)
|
||||
banlist = list(self.banlist)
|
||||
if target in banlist:
|
||||
banlist = [banned for banned in banlist if banned != target]
|
||||
self.db.ban_list = banlist
|
||||
return True
|
||||
return False
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue