Add working unit tests for new channel command

This commit is contained in:
Griatch 2021-04-20 23:57:18 +02:00
parent aa5a07f6d0
commit 3c4578b648
7 changed files with 309 additions and 134 deletions

View file

@ -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