mirror of
https://github.com/progval/irctest.git
synced 2025-04-06 23:39:46 +00:00
fix nonexistent user PRIVMSG test (#212)
* fix nonexistent user PRIVMSG test * fix single-element tupling issue * test the ERR_NOSUCHNICK params * use patma
This commit is contained in:
committed by
GitHub
parent
d190a91960
commit
61fb287280
@ -4,6 +4,7 @@ The PRIVMSG and NOTICE commands.
|
|||||||
|
|
||||||
from irctest import cases
|
from irctest import cases
|
||||||
from irctest.numerics import ERR_INPUTTOOLONG
|
from irctest.numerics import ERR_INPUTTOOLONG
|
||||||
|
from irctest.patma import ANYSTR
|
||||||
|
|
||||||
|
|
||||||
class PrivmsgTestCase(cases.BaseServerTestCase):
|
class PrivmsgTestCase(cases.BaseServerTestCase):
|
||||||
@ -45,12 +46,12 @@ class PrivmsgTestCase(cases.BaseServerTestCase):
|
|||||||
|
|
||||||
@cases.mark_specifications("RFC1459", "RFC2812")
|
@cases.mark_specifications("RFC1459", "RFC2812")
|
||||||
def testPrivmsgNonexistentUser(self):
|
def testPrivmsgNonexistentUser(self):
|
||||||
"""https://tools.ietf.org/html/rfc2812#section-3.3.1"""
|
"""<https://tools.ietf.org/html/rfc2812#section-3.3.1>"""
|
||||||
self.connectClient("foo")
|
self.connectClient("foo")
|
||||||
self.sendLine(1, "PRIVMSG bar :hey there!")
|
self.sendLine(1, "PRIVMSG bar :hey there!")
|
||||||
msg = self.getMessage(1)
|
msg = self.getMessage(1)
|
||||||
# ERR_NOSUCHNICK
|
# ERR_NOSUCHNICK: 401 <sender> <recipient> :No such nick
|
||||||
self.assertIn(msg.command, ("401"))
|
self.assertMessageMatch(msg, command="401", params=["foo", "bar", ANYSTR])
|
||||||
|
|
||||||
|
|
||||||
class NoticeTestCase(cases.BaseServerTestCase):
|
class NoticeTestCase(cases.BaseServerTestCase):
|
||||||
|
Reference in New Issue
Block a user