From 59c7252da1d5c4ef40dcf5ce5f3ef2dfbaf9eb52 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Sun, 11 Jul 2021 17:23:00 +0200 Subject: [PATCH] testUnsetTopicResponses: Assert reply to clearing topic is a TOPIC command. --- irctest/server_tests/test_channel_operations.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/irctest/server_tests/test_channel_operations.py b/irctest/server_tests/test_channel_operations.py index ab53acd..380c40b 100644 --- a/irctest/server_tests/test_channel_operations.py +++ b/irctest/server_tests/test_channel_operations.py @@ -408,17 +408,25 @@ class JoinTestCase(cases.BaseServerTestCase): # explicit TOPIC should receive RPL_NOTOPIC self.assertIn(RPL_NOTOPIC, [m.command for m in messages]) - self.sendLine(1, "TOPIC #test :new topic") 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.getMessage(2), command="TOPIC", params=["#test", "new topic"] ) # unset the topic: self.sendLine(1, "TOPIC #test :") - self.getMessages(1) - # client 2 should get the new TOPIC line, which is empty + # client 1 should get the new TOPIC line echoed, which has the empty arg + self.assertMessageMatch( + self.getMessage(1), command="TOPIC", params=["#test", ""] + ) + # client 2 should get the new TOPIC line to self.assertMessageMatch( self.getMessage(2), command="TOPIC", params=["#test", ""] )