From bceb1322c00b0710333f34bfeaeb5ec57b3cdff5 Mon Sep 17 00:00:00 2001 From: Shivaram Lingamneni Date: Sun, 9 Jun 2024 18:59:13 -0400 Subject: [PATCH] tweak special-casing --- irctest/server_tests/chmodes/operator.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/irctest/server_tests/chmodes/operator.py b/irctest/server_tests/chmodes/operator.py index 9533e201..960d1543 100644 --- a/irctest/server_tests/chmodes/operator.py +++ b/irctest/server_tests/chmodes/operator.py @@ -31,6 +31,7 @@ def setupNicks(self): self.getMessages("unrelated") @cases.mark_specifications("Modern") + @cases.xfailIfSoftware(["irc2"], "broken in irc2") def testChannelOperatorModeSenderPrivsNeeded(self): """Test that +o from a channel member without the necessary privileges fails as expected.""" @@ -60,10 +61,14 @@ def testChannelOperatorModeTargetDoesNotExist(self): self.sendLine("chanop", "MODE #chan +o nobody") messages = self.getMessages("chanop") # ERR_NOSUCHNICK is typical, Bahamut additionally sends ERR_USERNOTINCHANNEL - self.assertGreaterEqual(len(messages), 1) - self.assertLessEqual(len(messages), 2) - for message in messages: - self.assertIn(message.command, [ERR_NOSUCHNICK, ERR_USERNOTINCHANNEL]) + if self.controller.software_name != "Bahamut": + self.assertEqual(len(messages), 1) + self.assertMessageMatch(messages[0], command=ERR_NOSUCHNICK) + else: + self.assertLessEqual(len(messages), 2) + commands = {message.command for message in messages} + self.assertLessEqual({ERR_NOSUCHNICK}, commands) + self.assertLessEqual(commands, {ERR_NOSUCHNICK, ERR_USERNOTINCHANNEL}) @cases.mark_specifications("Modern") def testChannelOperatorModeChannelDoesNotExist(self):