@@ -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