Skip to content

Commit 737a385

Browse files
committed
Add testNoMultiPrefix
1 parent e69f96c commit 737a385

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

irctest/server_tests/multi_prefix.py

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,50 @@ def testMultiPrefix(self):
4949
msg=msg
5050
),
5151
)
52+
53+
@cases.xfailIfSoftware(
54+
["irc2", "Bahamut"], "irc2 and Bahamut send a trailing space"
55+
)
56+
def testNoMultiPrefix(self):
57+
"""When not requested, only the highest prefix should be sent"""
58+
self.connectClient("foo")
59+
self.joinChannel(1, "#chan")
60+
self.sendLine(1, "MODE #chan +v foo")
61+
self.getMessages(1)
62+
63+
# TODO(dan): Make sure +v is voice
64+
65+
self.sendLine(1, "NAMES #chan")
66+
reply = self.getMessage(1)
67+
self.assertMessageMatch(
68+
reply,
69+
command="353",
70+
params=["foo", ANYSTR, "#chan", "@foo"],
71+
fail_msg="Expected NAMES response (353) with @foo, got: {msg}",
72+
)
73+
self.getMessages(1)
74+
75+
self.sendLine(1, "WHO #chan")
76+
msg = self.getMessage(1)
77+
self.assertEqual(
78+
msg.command, "352", msg, fail_msg="Expected WHO response (352), got: {msg}"
79+
)
80+
self.assertGreaterEqual(
81+
len(msg.params),
82+
8,
83+
"Expected WHO response (352) with 8 params, got: {msg}".format(msg=msg),
84+
)
85+
self.assertIn(
86+
"@",
87+
msg.params[6],
88+
'Expected WHO response (352) with "@" in param 7, got: {msg}'.format(
89+
msg=msg
90+
),
91+
)
92+
self.assertNotIn(
93+
"+",
94+
msg.params[6],
95+
'Expected WHO response (352) with no "+" in param 7, got: {msg}'.format(
96+
msg=msg
97+
),
98+
)

0 commit comments

Comments
 (0)