mirror of
https://github.com/progval/irctest.git
synced 2025-04-05 14:59:49 +00:00
always negotiate batch with labeled-response, it's required by the spec
This commit is contained in:
@ -97,13 +97,15 @@ def _testEchoMessage(command, solo, server_time):
|
||||
|
||||
|
||||
class EchoMessageTestCase(cases.BaseServerTestCase):
|
||||
@cases.mark_capabilities("labeled-response", "echo-message", "message-tags")
|
||||
@cases.mark_capabilities(
|
||||
"batch", "labeled-response", "echo-message", "message-tags"
|
||||
)
|
||||
def testDirectMessageEcho(self):
|
||||
bar = random_name("bar")
|
||||
self.connectClient(
|
||||
bar,
|
||||
name=bar,
|
||||
capabilities=["labeled-response", "echo-message", "message-tags"],
|
||||
capabilities=["batch", "labeled-response", "echo-message", "message-tags"],
|
||||
skip_if_cap_nak=True,
|
||||
)
|
||||
self.getMessages(bar)
|
||||
@ -112,7 +114,7 @@ class EchoMessageTestCase(cases.BaseServerTestCase):
|
||||
self.connectClient(
|
||||
qux,
|
||||
name=qux,
|
||||
capabilities=["labeled-response", "echo-message", "message-tags"],
|
||||
capabilities=["batch", "labeled-response", "echo-message", "message-tags"],
|
||||
)
|
||||
self.getMessages(qux)
|
||||
|
||||
|
@ -19,29 +19,29 @@ class LabeledResponsesTestCase(cases.BaseServerTestCase, cases.OptionalityHelper
|
||||
capabilities.append("batch")
|
||||
return super().connectClient(nick, capabilities=capabilities, **kwargs)
|
||||
|
||||
@cases.mark_capabilities("echo-message", "labeled-response")
|
||||
@cases.mark_capabilities("echo-message", "batch", "labeled-response")
|
||||
def testLabeledPrivmsgResponsesToMultipleClients(self):
|
||||
self.connectClient(
|
||||
"foo",
|
||||
capabilities=["echo-message", "labeled-response"],
|
||||
capabilities=["echo-message", "batch", "labeled-response"],
|
||||
skip_if_cap_nak=True,
|
||||
)
|
||||
self.getMessages(1)
|
||||
self.connectClient(
|
||||
"bar",
|
||||
capabilities=["echo-message", "labeled-response"],
|
||||
capabilities=["echo-message", "batch", "labeled-response"],
|
||||
skip_if_cap_nak=True,
|
||||
)
|
||||
self.getMessages(2)
|
||||
self.connectClient(
|
||||
"carl",
|
||||
capabilities=["echo-message", "labeled-response"],
|
||||
capabilities=["echo-message", "batch", "labeled-response"],
|
||||
skip_if_cap_nak=True,
|
||||
)
|
||||
self.getMessages(3)
|
||||
self.connectClient(
|
||||
"alice",
|
||||
capabilities=["echo-message", "labeled-response"],
|
||||
capabilities=["echo-message", "batch", "labeled-response"],
|
||||
skip_if_cap_nak=True,
|
||||
)
|
||||
self.getMessages(4)
|
||||
@ -65,17 +65,17 @@ class LabeledResponsesTestCase(cases.BaseServerTestCase, cases.OptionalityHelper
|
||||
m, command="BATCH", fail_msg="No BATCH echo received after sending one out"
|
||||
)
|
||||
|
||||
@cases.mark_capabilities("echo-message", "labeled-response")
|
||||
@cases.mark_capabilities("echo-message", "batch", "labeled-response")
|
||||
def testLabeledPrivmsgResponsesToClient(self):
|
||||
self.connectClient(
|
||||
"foo",
|
||||
capabilities=["echo-message", "labeled-response"],
|
||||
capabilities=["echo-message", "batch", "labeled-response"],
|
||||
skip_if_cap_nak=True,
|
||||
)
|
||||
self.getMessages(1)
|
||||
self.connectClient(
|
||||
"bar",
|
||||
capabilities=["echo-message", "labeled-response"],
|
||||
capabilities=["echo-message", "batch", "labeled-response"],
|
||||
skip_if_cap_nak=True,
|
||||
)
|
||||
self.getMessages(2)
|
||||
@ -89,17 +89,17 @@ class LabeledResponsesTestCase(cases.BaseServerTestCase, cases.OptionalityHelper
|
||||
|
||||
self.assertMessageMatch(m, command="PRIVMSG", tags={"label": "12345"})
|
||||
|
||||
@cases.mark_capabilities("echo-message", "labeled-response")
|
||||
@cases.mark_capabilities("echo-message", "batch", "labeled-response")
|
||||
def testLabeledPrivmsgResponsesToChannel(self):
|
||||
self.connectClient(
|
||||
"foo",
|
||||
capabilities=["echo-message", "labeled-response"],
|
||||
capabilities=["echo-message", "batch", "labeled-response"],
|
||||
skip_if_cap_nak=True,
|
||||
)
|
||||
self.getMessages(1)
|
||||
self.connectClient(
|
||||
"bar",
|
||||
capabilities=["echo-message", "labeled-response"],
|
||||
capabilities=["echo-message", "batch", "labeled-response"],
|
||||
skip_if_cap_nak=True,
|
||||
)
|
||||
self.getMessages(2)
|
||||
@ -123,11 +123,11 @@ class LabeledResponsesTestCase(cases.BaseServerTestCase, cases.OptionalityHelper
|
||||
# ensure sender correctly receives msg
|
||||
self.assertMessageMatch(ms, command="PRIVMSG", tags={"label": "12345"})
|
||||
|
||||
@cases.mark_capabilities("echo-message", "labeled-response")
|
||||
@cases.mark_capabilities("echo-message", "batch", "labeled-response")
|
||||
def testLabeledPrivmsgResponsesToSelf(self):
|
||||
self.connectClient(
|
||||
"foo",
|
||||
capabilities=["echo-message", "labeled-response"],
|
||||
capabilities=["echo-message", "batch", "labeled-response"],
|
||||
skip_if_cap_nak=True,
|
||||
)
|
||||
self.getMessages(1)
|
||||
@ -166,17 +166,17 @@ class LabeledResponsesTestCase(cases.BaseServerTestCase, cases.OptionalityHelper
|
||||
).format(number_of_labels),
|
||||
)
|
||||
|
||||
@cases.mark_capabilities("echo-message", "labeled-response")
|
||||
@cases.mark_capabilities("echo-message", "batch", "labeled-response")
|
||||
def testLabeledNoticeResponsesToClient(self):
|
||||
self.connectClient(
|
||||
"foo",
|
||||
capabilities=["echo-message", "labeled-response"],
|
||||
capabilities=["echo-message", "batch", "labeled-response"],
|
||||
skip_if_cap_nak=True,
|
||||
)
|
||||
self.getMessages(1)
|
||||
self.connectClient(
|
||||
"bar",
|
||||
capabilities=["echo-message", "labeled-response"],
|
||||
capabilities=["echo-message", "batch", "labeled-response"],
|
||||
skip_if_cap_nak=True,
|
||||
)
|
||||
self.getMessages(2)
|
||||
@ -190,17 +190,17 @@ class LabeledResponsesTestCase(cases.BaseServerTestCase, cases.OptionalityHelper
|
||||
|
||||
self.assertMessageMatch(m, command="NOTICE", tags={"label": "12345"})
|
||||
|
||||
@cases.mark_capabilities("echo-message", "labeled-response")
|
||||
@cases.mark_capabilities("echo-message", "batch", "labeled-response")
|
||||
def testLabeledNoticeResponsesToChannel(self):
|
||||
self.connectClient(
|
||||
"foo",
|
||||
capabilities=["echo-message", "labeled-response"],
|
||||
capabilities=["echo-message", "batch", "labeled-response"],
|
||||
skip_if_cap_nak=True,
|
||||
)
|
||||
self.getMessages(1)
|
||||
self.connectClient(
|
||||
"bar",
|
||||
capabilities=["echo-message", "labeled-response"],
|
||||
capabilities=["echo-message", "batch", "labeled-response"],
|
||||
skip_if_cap_nak=True,
|
||||
)
|
||||
self.getMessages(2)
|
||||
@ -224,11 +224,11 @@ class LabeledResponsesTestCase(cases.BaseServerTestCase, cases.OptionalityHelper
|
||||
# ensure sender correctly receives msg
|
||||
self.assertMessageMatch(ms, command="NOTICE", tags={"label": "12345"})
|
||||
|
||||
@cases.mark_capabilities("echo-message", "labeled-response")
|
||||
@cases.mark_capabilities("echo-message", "batch", "labeled-response")
|
||||
def testLabeledNoticeResponsesToSelf(self):
|
||||
self.connectClient(
|
||||
"foo",
|
||||
capabilities=["echo-message", "labeled-response"],
|
||||
capabilities=["echo-message", "batch", "labeled-response"],
|
||||
skip_if_cap_nak=True,
|
||||
)
|
||||
self.getMessages(1)
|
||||
@ -265,17 +265,19 @@ class LabeledResponsesTestCase(cases.BaseServerTestCase, cases.OptionalityHelper
|
||||
).format(number_of_labels),
|
||||
)
|
||||
|
||||
@cases.mark_capabilities("echo-message", "labeled-response", "message-tags")
|
||||
@cases.mark_capabilities(
|
||||
"echo-message", "batch", "labeled-response", "message-tags"
|
||||
)
|
||||
def testLabeledTagMsgResponsesToClient(self):
|
||||
self.connectClient(
|
||||
"foo",
|
||||
capabilities=["echo-message", "labeled-response", "message-tags"],
|
||||
capabilities=["echo-message", "batch", "labeled-response", "message-tags"],
|
||||
skip_if_cap_nak=True,
|
||||
)
|
||||
self.getMessages(1)
|
||||
self.connectClient(
|
||||
"bar",
|
||||
capabilities=["echo-message", "labeled-response", "message-tags"],
|
||||
capabilities=["echo-message", "batch", "labeled-response", "message-tags"],
|
||||
skip_if_cap_nak=True,
|
||||
)
|
||||
self.getMessages(2)
|
||||
@ -312,17 +314,19 @@ class LabeledResponsesTestCase(cases.BaseServerTestCase, cases.OptionalityHelper
|
||||
},
|
||||
)
|
||||
|
||||
@cases.mark_capabilities("echo-message", "labeled-response", "message-tags")
|
||||
@cases.mark_capabilities(
|
||||
"echo-message", "batch", "labeled-response", "message-tags"
|
||||
)
|
||||
def testLabeledTagMsgResponsesToChannel(self):
|
||||
self.connectClient(
|
||||
"foo",
|
||||
capabilities=["echo-message", "labeled-response", "message-tags"],
|
||||
capabilities=["echo-message", "batch", "labeled-response", "message-tags"],
|
||||
skip_if_cap_nak=True,
|
||||
)
|
||||
self.getMessages(1)
|
||||
self.connectClient(
|
||||
"bar",
|
||||
capabilities=["echo-message", "labeled-response", "message-tags"],
|
||||
capabilities=["echo-message", "batch", "labeled-response", "message-tags"],
|
||||
skip_if_cap_nak=True,
|
||||
)
|
||||
self.getMessages(2)
|
||||
@ -360,11 +364,13 @@ class LabeledResponsesTestCase(cases.BaseServerTestCase, cases.OptionalityHelper
|
||||
ms, command="TAGMSG", tags={"label": "12345", **ANYDICT}
|
||||
)
|
||||
|
||||
@cases.mark_capabilities("echo-message", "labeled-response", "message-tags")
|
||||
@cases.mark_capabilities(
|
||||
"echo-message", "batch", "labeled-response", "message-tags"
|
||||
)
|
||||
def testLabeledTagMsgResponsesToSelf(self):
|
||||
self.connectClient(
|
||||
"foo",
|
||||
capabilities=["echo-message", "labeled-response", "message-tags"],
|
||||
capabilities=["echo-message", "batch", "labeled-response", "message-tags"],
|
||||
skip_if_cap_nak=True,
|
||||
)
|
||||
self.getMessages(1)
|
||||
|
Reference in New Issue
Block a user