test ERR_INPUTTOOLONG

This commit is contained in:
Shivaram Lingamneni 2019-03-07 02:30:04 -05:00
parent 90f43d509d
commit f7d927cbc4
2 changed files with 13 additions and 0 deletions

View File

@ -116,6 +116,7 @@ ERR_NOTEXTTOSEND = "412"
ERR_NOTOPLEVEL = "413"
ERR_WILDTOPLEVEL = "414"
ERR_BADMASK = "415"
ERR_INPUTTOOLONG = "417"
ERR_UNKNOWNCOMMAND = "421"
ERR_NOMOTD = "422"
ERR_NOADMININFO = "423"

View File

@ -4,6 +4,7 @@ Section 3.2 of RFC 2812
"""
from irctest import cases
from irctest.numerics import ERR_INPUTTOOLONG
class PrivmsgTestCase(cases.BaseServerTestCase):
@cases.SpecificationSelector.requiredBySpecification('RFC1459', 'RFC2812')
@ -61,3 +62,14 @@ class NoticeTestCase(cases.BaseServerTestCase):
self.connectClient('foo')
self.sendLine(1, 'NOTICE #nonexistent :hello there')
self.assertEqual(self.getMessages(1), [])
class TagsTestCase(cases.BaseServerTestCase):
@cases.SpecificationSelector.requiredBySpecification('Oragono')
def testLineTooLong(self):
self.connectClient('bar')
self.joinChannel(1, '#xyz')
monsterMessage = '@+clientOnlyTagExample=' + 'a'*4096 + ' PRIVMSG #xyz hi!'
self.sendLine(1, monsterMessage)
replies = self.getMessages(1)
self.assertIn(ERR_INPUTTOOLONG, set(reply.command for reply in replies))