mirror of
https://github.com/progval/irctest.git
synced 2025-04-05 14:59:49 +00:00
Remove some Ergo-specific assumptions.
We need to remove them before we can start running these tests on Inspircd.
This commit is contained in:
@ -577,7 +577,9 @@ class BaseServerTestCase(
|
||||
Returns the list of all messages received after registration,
|
||||
just like `skipToWelcome`."""
|
||||
client = self.addClient(name, show_io=show_io)
|
||||
if capabilities is not None and 0 < len(capabilities):
|
||||
if capabilities:
|
||||
self.sendLine(client, "CAP LS 302")
|
||||
m = self.getRegistrationMessage(client)
|
||||
self.sendLine(client, "CAP REQ :{}".format(" ".join(capabilities)))
|
||||
m = self.getRegistrationMessage(client)
|
||||
try:
|
||||
@ -592,12 +594,18 @@ class BaseServerTestCase(
|
||||
raise runner.CapabilityNotSupported(" or ".join(capabilities))
|
||||
else:
|
||||
raise
|
||||
self.sendLine(client, "CAP END")
|
||||
if password is not None:
|
||||
self.sendLine(client, "AUTHENTICATE PLAIN")
|
||||
m = self.getRegistrationMessage(client)
|
||||
self.assertMessageMatch(m, command="AUTHENTICATE", params=["+"])
|
||||
self.sendLine(client, sasl_plain_blob(account or nick, password))
|
||||
m = self.getRegistrationMessage(client)
|
||||
self.assertIn(m.command, ["900", "903"], str(m))
|
||||
|
||||
self.sendLine(client, "NICK {}".format(nick))
|
||||
self.sendLine(client, "USER %s * * :Realname" % (ident,))
|
||||
if capabilities:
|
||||
self.sendLine(client, "CAP END")
|
||||
|
||||
welcome = self.skipToWelcome(client)
|
||||
self.sendLine(client, "PING foo")
|
||||
|
@ -11,8 +11,16 @@ class AccountTagTestCase(cases.BaseServerTestCase, cases.OptionalityHelper):
|
||||
self.sendLine(2, "CAP LS 302")
|
||||
capabilities = self.getCapLs(2)
|
||||
assert "sasl" in capabilities
|
||||
|
||||
self.sendLine(2, "USER f * * :Realname")
|
||||
self.sendLine(2, "NICK {}".format(nick))
|
||||
self.sendLine(2, "CAP REQ :sasl")
|
||||
self.getRegistrationMessage(2)
|
||||
|
||||
self.sendLine(2, "AUTHENTICATE PLAIN")
|
||||
m = self.getMessage(2, filter_pred=lambda m: m.command != "NOTICE")
|
||||
m = self.getMessage(
|
||||
2, filter_pred=lambda m: m.command != "NOTICE", synchronize=False
|
||||
)
|
||||
self.assertMessageMatch(
|
||||
m,
|
||||
command="AUTHENTICATE",
|
||||
@ -21,7 +29,9 @@ class AccountTagTestCase(cases.BaseServerTestCase, cases.OptionalityHelper):
|
||||
"replied with “AUTHENTICATE +”, but instead sent: {msg}",
|
||||
)
|
||||
self.sendLine(2, "AUTHENTICATE amlsbGVzAGppbGxlcwBzZXNhbWU=")
|
||||
m = self.getMessage(2, filter_pred=lambda m: m.command != "NOTICE")
|
||||
m = self.getMessage(
|
||||
2, filter_pred=lambda m: m.command != "NOTICE", synchronize=False
|
||||
)
|
||||
self.assertMessageMatch(
|
||||
m,
|
||||
command="900",
|
||||
|
@ -121,7 +121,9 @@ class WhoisTestCase(cases.BaseServerTestCase, cases.OptionalityHelper):
|
||||
|
||||
<https://defs.ircdocs.horse/defs/numerics.html#rpl-whoisaccount-330>"""
|
||||
self.controller.registerUser(self, "shivaram", "sesame")
|
||||
self.connectClient("netcat", account="shivaram", password="sesame")
|
||||
self.connectClient(
|
||||
"netcat", account="shivaram", password="sesame", capabilities=["sasl"]
|
||||
)
|
||||
self.getMessages(1)
|
||||
|
||||
self.connectClient("curious")
|
||||
@ -129,7 +131,7 @@ class WhoisTestCase(cases.BaseServerTestCase, cases.OptionalityHelper):
|
||||
messages = self.getMessages(2)
|
||||
# 330 RPL_WHOISACCOUNT
|
||||
whoisaccount = [message for message in messages if message.command == "330"]
|
||||
self.assertEqual(len(whoisaccount), 1)
|
||||
self.assertEqual(len(whoisaccount), 1, messages)
|
||||
params = whoisaccount[0].params
|
||||
# <client> <nick> <authname> :<info>
|
||||
self.assertEqual(len(params), 4)
|
||||
|
Reference in New Issue
Block a user