From 10dbd8415676b7c201bb1018fe954b756285ff37 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Mon, 21 Dec 2015 17:31:10 +0100 Subject: [PATCH] Allow ERR_NOSUCHCHANNEL as a response for PART from an empty/inexistant channel. --- .../server_tests/test_channel_operations.py | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/irctest/server_tests/test_channel_operations.py b/irctest/server_tests/test_channel_operations.py index c85650e..053ebc7 100644 --- a/irctest/server_tests/test_channel_operations.py +++ b/irctest/server_tests/test_channel_operations.py @@ -69,19 +69,23 @@ class JoinTestCase(cases.BaseServerTestCase): -- and - ERR_NOSUCHCHANNEL should only be used for invalid - channel names: - “403 ERR_NOSUCHCHANNEL - " :No such channel" + According to RFCs, ERR_NOSUCHCHANNEL should only be used for invalid + channel names: + “403 ERR_NOSUCHCHANNEL + " :No such channel" - - Used to indicate the given channel name is invalid.” - -- - and + - Used to indicate the given channel name is invalid.” + -- + and + + However, many implementations use 479 instead, so let's allow it. + + """ self.connectClient('foo') self.sendLine(1, 'PART #chan') m = self.getMessage(1) - self.assertMessageEqual(m, command='442') # ERR_NOTONCHANNEL + self.assertIn(m.command, {'442', '403'}) # ERR_NOTONCHANNEL, ERR_NOSUCHCHANNEL def testJoinTwice(self): self.connectClient('foo')