mirror of
https://github.com/progval/irctest.git
synced 2025-04-05 06:49:47 +00:00
direct message tests (#184)
* Test privmsg to non-existent user * Test privmsg to user * fix synchronization issue * apply black Co-authored-by: ma-anwar <ma.rizvi.anwar@gmail.com>
This commit is contained in:
committed by
GitHub
parent
6181dd07ad
commit
b7e8a7a5f5
@ -32,6 +32,26 @@ class PrivmsgTestCase(cases.BaseServerTestCase):
|
||||
# ERR_NOSUCHNICK, ERR_NOSUCHCHANNEL, or ERR_CANNOTSENDTOCHAN
|
||||
self.assertIn(msg.command, ("401", "403", "404"))
|
||||
|
||||
@cases.mark_specifications("RFC1459", "RFC2812")
|
||||
def testPrivmsgToUser(self):
|
||||
"""<https://tools.ietf.org/html/rfc2812#section-3.3.1>"""
|
||||
self.connectClient("foo")
|
||||
self.connectClient("bar")
|
||||
self.sendLine(1, "PRIVMSG bar :hey there!")
|
||||
self.getMessages(1)
|
||||
pms = [msg for msg in self.getMessages(2) if msg.command == "PRIVMSG"]
|
||||
self.assertEqual(len(pms), 1)
|
||||
self.assertMessageMatch(pms[0], command="PRIVMSG", params=["bar", "hey there!"])
|
||||
|
||||
@cases.mark_specifications("RFC1459", "RFC2812")
|
||||
def testPrivmsgNonexistentUser(self):
|
||||
"""https://tools.ietf.org/html/rfc2812#section-3.3.1"""
|
||||
self.connectClient("foo")
|
||||
self.sendLine(1, "PRIVMSG bar :hey there!")
|
||||
msg = self.getMessage(1)
|
||||
# ERR_NOSUCHNICK
|
||||
self.assertIn(msg.command, ("401"))
|
||||
|
||||
|
||||
class NoticeTestCase(cases.BaseServerTestCase):
|
||||
@cases.mark_specifications("RFC1459", "RFC2812")
|
||||
|
Reference in New Issue
Block a user