mirror of
https://github.com/progval/irctest.git
synced 2025-04-05 06:49:47 +00:00
Use getRegistrationMessage()
when relevant
It's an alias for `filter_pred=lambda m: m.command != "NOTICE", synchronize=False`
This commit is contained in:
@ -18,9 +18,7 @@ class AccountTagTestCase(cases.BaseServerTestCase, cases.OptionalityHelper):
|
||||
self.getRegistrationMessage(2)
|
||||
|
||||
self.sendLine(2, "AUTHENTICATE PLAIN")
|
||||
m = self.getMessage(
|
||||
2, filter_pred=lambda m: m.command != "NOTICE", synchronize=False
|
||||
)
|
||||
m = self.getRegistrationMessage(2)
|
||||
self.assertMessageMatch(
|
||||
m,
|
||||
command="AUTHENTICATE",
|
||||
@ -29,9 +27,7 @@ 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", synchronize=False
|
||||
)
|
||||
m = self.getRegistrationMessage(2)
|
||||
self.assertMessageMatch(
|
||||
m,
|
||||
command="900",
|
||||
|
@ -12,7 +12,7 @@ class MetadataTestCase(cases.BaseServerTestCase, cases.OptionalityHelper):
|
||||
capabilities = self.getCapLs(2)
|
||||
assert "sasl" in capabilities
|
||||
self.sendLine(2, "AUTHENTICATE PLAIN")
|
||||
m = self.getMessage(2, filter_pred=lambda m: m.command != "NOTICE")
|
||||
m = self.getRegistrationMessage(2)
|
||||
self.assertMessageMatch(
|
||||
m,
|
||||
command="AUTHENTICATE",
|
||||
@ -21,7 +21,7 @@ class MetadataTestCase(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.getRegistrationMessage(2)
|
||||
self.assertMessageMatch(
|
||||
m,
|
||||
command="900",
|
||||
|
@ -137,9 +137,8 @@ class RegressionsTestCase(cases.BaseServerTestCase):
|
||||
self.addClient(2)
|
||||
self.sendLine(2, "NICK alice")
|
||||
self.sendLine(2, "USER u s e r")
|
||||
replies = set(msg.command for msg in self.getMessages(2))
|
||||
self.assertNotIn(ERR_NICKNAMEINUSE, replies)
|
||||
self.assertIn(RPL_WELCOME, replies)
|
||||
m = self.getRegistrationMessage(2)
|
||||
self.assertMessageMatch(m, command=RPL_WELCOME)
|
||||
|
||||
@cases.mark_specifications("RFC1459")
|
||||
def testNickReleaseQuit(self):
|
||||
|
@ -32,7 +32,7 @@ class SaslTestCase(cases.BaseServerTestCase, cases.OptionalityHelper):
|
||||
fail_msg="Does not have PLAIN mechanism as the controller " "claims",
|
||||
)
|
||||
self.sendLine(1, "AUTHENTICATE PLAIN")
|
||||
m = self.getMessage(1, filter_pred=lambda m: m.command != "NOTICE")
|
||||
m = self.getRegistrationMessage(1)
|
||||
self.assertMessageMatch(
|
||||
m,
|
||||
command="AUTHENTICATE",
|
||||
@ -41,7 +41,7 @@ class SaslTestCase(cases.BaseServerTestCase, cases.OptionalityHelper):
|
||||
"replied with “AUTHENTICATE +”, but instead sent: {msg}",
|
||||
)
|
||||
self.sendLine(1, "AUTHENTICATE amlsbGVzAGppbGxlcwBzZXNhbWU=")
|
||||
m = self.getMessage(1, filter_pred=lambda m: m.command != "NOTICE")
|
||||
m = self.getRegistrationMessage(1)
|
||||
self.assertMessageMatch(
|
||||
m,
|
||||
command="900",
|
||||
@ -91,7 +91,7 @@ class SaslTestCase(cases.BaseServerTestCase, cases.OptionalityHelper):
|
||||
fail_msg="Does not have PLAIN mechanism as the controller " "claims",
|
||||
)
|
||||
self.sendLine(1, "AUTHENTICATE PLAIN")
|
||||
m = self.getMessage(1, filter_pred=lambda m: m.command != "NOTICE")
|
||||
m = self.getRegistrationMessage(1)
|
||||
self.assertMessageMatch(
|
||||
m,
|
||||
command="AUTHENTICATE",
|
||||
@ -100,7 +100,7 @@ class SaslTestCase(cases.BaseServerTestCase, cases.OptionalityHelper):
|
||||
"replied with “AUTHENTICATE +”, but instead sent: {msg}",
|
||||
)
|
||||
self.sendLine(1, "AUTHENTICATE AGppbGxlcwBzZXNhbWU=")
|
||||
m = self.getMessage(1, filter_pred=lambda m: m.command != "NOTICE")
|
||||
m = self.getRegistrationMessage(1)
|
||||
self.assertMessageMatch(
|
||||
m,
|
||||
command="900",
|
||||
|
Reference in New Issue
Block a user