Skip to content

Commit

Permalink
test incorrect channel keys (progval#169)
Browse files Browse the repository at this point in the history
  • Loading branch information
slingamn committed May 29, 2022
1 parent 683f7c0 commit 058fab8
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions irctest/server_tests/chmodes/key.py
Expand Up @@ -27,10 +27,16 @@ def testKeyNormal(self):

self.connectClient("qux")
self.getMessages(2)
# JOIN with a missing key MUST receive ERR_BADCHANNELKEY:
self.sendLine(2, "JOIN #chan")
reply = self.getMessages(2)
self.assertNotIn("JOIN", {msg.command for msg in reply})
self.assertIn(ERR_BADCHANNELKEY, {msg.command for msg in reply})
reply_cmds = {msg.command for msg in self.getMessages(2)}
self.assertNotIn("JOIN", reply_cmds)
self.assertIn(ERR_BADCHANNELKEY, reply_cmds)
# similarly for JOIN with an incorrect key:
self.sendLine(2, "JOIN #chan bees")
reply_cmds = {msg.command for msg in self.getMessages(2)}
self.assertNotIn("JOIN", reply_cmds)
self.assertIn(ERR_BADCHANNELKEY, reply_cmds)

self.sendLine(2, "JOIN #chan beer")
reply = self.getMessages(2)
Expand Down

0 comments on commit 058fab8

Please sign in to comment.