Skip to content

Commit

Permalink
add test coverage for RPL_TOPIC
Browse files Browse the repository at this point in the history
  • Loading branch information
slingamn committed Feb 8, 2021
1 parent b58fe44 commit de49571
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion irctest/server_tests/test_channel_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from irctest import client_mock
from irctest import runner
from irctest.irc_utils import ambiguities
from irctest.numerics import RPL_NOTOPIC, RPL_NAMREPLY, RPL_INVITING
from irctest.numerics import RPL_TOPIC, RPL_TOPICTIME, RPL_NOTOPIC, RPL_NAMREPLY, RPL_INVITING
from irctest.numerics import ERR_NOSUCHCHANNEL, ERR_NOTONCHANNEL, ERR_CHANOPRIVSNEEDED, ERR_NOSUCHNICK, ERR_INVITEONLYCHAN, ERR_CANNOTSENDTOCHAN, ERR_BADCHANNELKEY, ERR_INVALIDMODEPARAM, ERR_UNKNOWNERROR

MODERN_CAPS = ['server-time', 'message-tags', 'batch', 'labeled-response', 'echo-message', 'account-tag']
Expand Down Expand Up @@ -841,6 +841,14 @@ def testTopicPrivileges(self):
self.assertIn(ERR_CHANOPRIVSNEEDED, replies)
self.assertNotIn('TOPIC', replies)

# test that RPL_TOPIC and RPL_TOPICTIME are sent on join
self.connectClient('buzz', name='buzz')
self.sendLine('buzz', 'JOIN #chan')
replies = self.getMessages('buzz')
rpl_topic = [msg for msg in replies if msg.command == RPL_TOPIC][0]
self.assertMessageEqual(rpl_topic, command=RPL_TOPIC, params=['buzz', '#chan', 'new topic'])
self.assertEqual(len([msg for msg in replies if msg.command == RPL_TOPICTIME]), 1)


class ModeratedMode(cases.BaseServerTestCase):

Expand Down

0 comments on commit de49571

Please sign in to comment.