Skip to content

Commit

Permalink
test that WHO ignores +i for bare nicknames (progval#171)
Browse files Browse the repository at this point in the history
  • Loading branch information
slingamn committed Aug 26, 2022
1 parent 6290825 commit dbdadec
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions irctest/server_tests/who.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,3 +503,34 @@ def testWhoxNoAccount(self):
command=RPL_ENDOFWHO,
params=["otherNick", InsensitiveStr("coolNick"), ANYSTR],
)


class WhoInvisibleTestCase(cases.BaseServerTestCase):
@cases.mark_specifications("Modern")
def testWhoInvisible(self):
if self.controller.software_name == "Bahamut":
raise runner.OptionalExtensionNotSupported("WHO mask")

self.connectClient("evan", name="evan")
self.sendLine("evan", "MODE evan +i")
self.getMessages("evan")

self.connectClient("shivaram", name="shivaram")
self.getMessages("shivaram")
self.sendLine("shivaram", "WHO eva*")
reply_cmds = {msg.command for msg in self.getMessages("shivaram")}
self.assertEqual(reply_cmds, {RPL_ENDOFWHO})

# invisibility should not be respected for plain nicknames, only for masks:
self.sendLine("shivaram", "WHO evan")
replies = self.getMessages("shivaram")
reply_cmds = {msg.command for msg in replies}
self.assertEqual(reply_cmds, {RPL_WHOREPLY, RPL_ENDOFWHO})

# invisibility should not be respected if the users share a channel
self.joinChannel("evan", "#test")
self.joinChannel("shivaram", "#test")
self.sendLine("shivaram", "WHO eva*")
replies = self.getMessages("shivaram")
reply_cmds = {msg.command for msg in replies}
self.assertEqual(reply_cmds, {RPL_WHOREPLY, RPL_ENDOFWHO})

0 comments on commit dbdadec

Please sign in to comment.