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

@ -1405,6 +1405,11 @@ class NickHandler(AttributeHandler):
a string.
kwargs (any, optional): These are passed on to `AttributeHandler.get`.
Returns:
str or tuple: The nick replacement string or nick tuple.
"""
if return_tuple or "return_obj" in kwargs:
return super().get(key=key, category=category, **kwargs)
@ -1431,10 +1436,10 @@ class NickHandler(AttributeHandler):
kwargs (any, optional): These are passed on to `AttributeHandler.get`.
"""
if category == "channel":
nick_regex, nick_template = initialize_nick_templates(key + " $1", replacement + " $1")
else:
nick_regex, nick_template = initialize_nick_templates(key, replacement)
# if category == "channel":
# nick_regex, nick_template = initialize_nick_templates(key + " $1", replacement + " $1")
# else:
nick_regex, nick_template = initialize_nick_templates(key, replacement)
super().add(key, (nick_regex, nick_template, key, replacement), category=category, **kwargs)
def remove(self, key, category="inputline", **kwargs):