From 5e622a34d38be329aec98b3b983a239fe3e1b4b7 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Fri, 5 Mar 2021 20:29:44 +0100 Subject: [PATCH] test_buffering: add support for ERR_INPUTTOOLONG --- irctest/server_tests/test_buffering.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/irctest/server_tests/test_buffering.py b/irctest/server_tests/test_buffering.py index 713c432..fcbab42 100644 --- a/irctest/server_tests/test_buffering.py +++ b/irctest/server_tests/test_buffering.py @@ -5,6 +5,7 @@ import socket from irctest import cases from irctest.irc_utils import message_parser +from irctest.numerics import ERR_INPUTTOOLONG from irctest.patma import ANYSTR @@ -55,7 +56,16 @@ def _testNoTags(sender_function, colon): ] for payload in payloads: sender_function(self, line + payload + "\r\n") - self.getMessages(1) + messages = self.getMessages(1) + if messages and ERR_INPUTTOOLONG in (m.command for m in messages): + # https://defs.ircdocs.horse/defs/numerics.html#err-inputtoolong-417 + self.assertGreater( + len(line + payload + "\r\n"), + 512 - overhead, + "Got ERR_INPUTTOOLONG for a messag that should fit " + "withing 512 characters.", + ) + continue received_line = self._getLine(2) print("received", repr(received_line))