testUnsetTopicResponses: Assert reply to clearing topic is a TOPIC command.

This commit is contained in:
Valentin Lorentz 2021-07-11 17:23:00 +02:00
parent 4fb7ebcd2c
commit 59c7252da1

View File

@ -408,17 +408,25 @@ class JoinTestCase(cases.BaseServerTestCase):
# explicit TOPIC should receive RPL_NOTOPIC # explicit TOPIC should receive RPL_NOTOPIC
self.assertIn(RPL_NOTOPIC, [m.command for m in messages]) self.assertIn(RPL_NOTOPIC, [m.command for m in messages])
self.sendLine(1, "TOPIC #test :new topic")
self.getMessages(1) self.getMessages(1)
# client 2 should get the new TOPIC line
self.sendLine(1, "TOPIC #test :new topic")
# client 1 should get the new TOPIC line echoed
self.assertMessageMatch(
self.getMessage(1), command="TOPIC", params=["#test", "new topic"]
)
# client 2 should get the new TOPIC line too
self.assertMessageMatch( self.assertMessageMatch(
self.getMessage(2), command="TOPIC", params=["#test", "new topic"] self.getMessage(2), command="TOPIC", params=["#test", "new topic"]
) )
# unset the topic: # unset the topic:
self.sendLine(1, "TOPIC #test :") self.sendLine(1, "TOPIC #test :")
self.getMessages(1) # client 1 should get the new TOPIC line echoed, which has the empty arg
# client 2 should get the new TOPIC line, which is empty self.assertMessageMatch(
self.getMessage(1), command="TOPIC", params=["#test", ""]
)
# client 2 should get the new TOPIC line to
self.assertMessageMatch( self.assertMessageMatch(
self.getMessage(2), command="TOPIC", params=["#test", ""] self.getMessage(2), command="TOPIC", params=["#test", ""]
) )