mirror of
https://github.com/progval/irctest.git
synced 2025-04-07 15:59:49 +00:00
whox: Add test for individual chars (#227)
It makes it easier to debug missing params
This commit is contained in:
4
Makefile
4
Makefile
@ -35,22 +35,18 @@ INSPIRCD_SELECTORS := \
|
||||
and not strict \
|
||||
$(EXTRA_SELECTORS)
|
||||
|
||||
# HelpTestCase fails because it returns NOTICEs instead of numerics
|
||||
IRCU2_SELECTORS := \
|
||||
not Ergo \
|
||||
and not deprecated \
|
||||
and not strict \
|
||||
$(EXTRA_SELECTORS)
|
||||
|
||||
# same justification as ircu2
|
||||
# lusers "unregistered" tests fail because
|
||||
NEFARIOUS_SELECTORS := \
|
||||
not Ergo \
|
||||
and not deprecated \
|
||||
and not strict \
|
||||
$(EXTRA_SELECTORS)
|
||||
|
||||
# same justification as ircu2
|
||||
SNIRCD_SELECTORS := \
|
||||
not Ergo \
|
||||
and not deprecated \
|
||||
|
@ -802,7 +802,7 @@ def xfailIf(
|
||||
def decorator(f: Callable[..., _TReturn]) -> Callable[..., _TReturn]:
|
||||
@functools.wraps(f)
|
||||
def newf(self: _TSelf, *args: Any, **kwargs: Any) -> _TReturn:
|
||||
if condition(self):
|
||||
if condition(self, *args, **kwargs):
|
||||
try:
|
||||
return f(self, *args, **kwargs)
|
||||
except Exception:
|
||||
@ -819,7 +819,10 @@ def xfailIf(
|
||||
def xfailIfSoftware(
|
||||
names: List[str], reason: str
|
||||
) -> Callable[[Callable[..., _TReturn]], Callable[..., _TReturn]]:
|
||||
return xfailIf(lambda testcase: testcase.controller.software_name in names, reason)
|
||||
def pred(testcase: _IrcTestCase, *args: Any, **kwargs: Any) -> bool:
|
||||
return testcase.controller.software_name in names
|
||||
|
||||
return xfailIf(pred, reason)
|
||||
|
||||
|
||||
def mark_services(cls: TClass) -> TClass:
|
||||
|
@ -496,6 +496,46 @@ class WhoTestCase(BaseWhoTestCase, cases.BaseServerTestCase):
|
||||
params=["otherNick", InsensitiveStr("coolNick"), ANYSTR],
|
||||
)
|
||||
|
||||
@pytest.mark.parametrize("char", "cuihsnfdlaor")
|
||||
@cases.xfailIf(
|
||||
lambda self, char: bool(
|
||||
char == "l" and self.controller.software_name == "ircu2"
|
||||
),
|
||||
"https://github.com/UndernetIRC/ircu2/commit/17c539103abbd0055b2297e17854cd0756c85d62",
|
||||
)
|
||||
@cases.xfailIf(
|
||||
lambda self, char: bool(
|
||||
char == "l" and self.controller.software_name == "Nefarious"
|
||||
),
|
||||
"https://github.com/evilnet/nefarious2/pull/73",
|
||||
)
|
||||
def testWhoxOneChar(self, char):
|
||||
self._init()
|
||||
if "WHOX" not in self.server_support:
|
||||
raise runner.IsupportTokenNotSupported("WHOX")
|
||||
|
||||
self.sendLine(2, f"WHO coolNick %{char}")
|
||||
messages = self.getMessages(2)
|
||||
|
||||
self.assertEqual(len(messages), 2, "Unexpected number of messages")
|
||||
|
||||
(reply, end) = messages
|
||||
|
||||
self.assertMessageMatch(
|
||||
reply,
|
||||
command=RPL_WHOSPCRPL,
|
||||
params=[
|
||||
"otherNick",
|
||||
StrRe(".+"),
|
||||
],
|
||||
)
|
||||
|
||||
self.assertMessageMatch(
|
||||
end,
|
||||
command=RPL_ENDOFWHO,
|
||||
params=["otherNick", InsensitiveStr("coolNick"), ANYSTR],
|
||||
)
|
||||
|
||||
def testWhoxToken(self):
|
||||
"""https://github.com/ircv3/ircv3-specifications/pull/482"""
|
||||
self._init()
|
||||
|
Reference in New Issue
Block a user