From 281dca7367c57723f7bfcaf95fbab5b31ab65ec2 Mon Sep 17 00:00:00 2001 From: Val Lorentz Date: Sat, 16 Sep 2023 22:35:20 +0200 Subject: [PATCH] Add questionable test that TOPIC is not echoed/transmitted when not changed --- irctest/server_tests/topic.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/irctest/server_tests/topic.py b/irctest/server_tests/topic.py index 9489571..dd690aa 100644 --- a/irctest/server_tests/topic.py +++ b/irctest/server_tests/topic.py @@ -46,6 +46,30 @@ class TopicTestCase(cases.BaseServerTestCase): m = self.getMessage(2) self.assertMessageMatch(m, command="TOPIC", params=["#chan", "T0P1C"]) + @cases.mark_specifications("Modern") + def testTopicUnchanged(self): + """"If the topic of a channel is changed or cleared, every client in that + channel (including the author of the topic change) will receive a TOPIC command" + -- https://modern.ircdocs.horse/#topic-message + """ + self.connectClient("foo") + self.joinChannel(1, "#chan") + + self.connectClient("bar") + self.joinChannel(2, "#chan") + + # clear waiting msgs about cli 2 joining the channel + self.getMessages(1) + self.getMessages(2) + + self.sendLine(1, "TOPIC #chan :T0P1C") + self.getMessages(1) + self.getMessages(2) + + self.sendLine(1, "TOPIC #chan :T0P1C") + self.assertEqual(self.getMessages(2), [], "Unchanged topic was transmitted") + self.assertEqual(self.getMessages(1), [], "Unchanged topic was echoed") + @cases.mark_specifications("RFC1459", "RFC2812") def testTopicMode(self): """“Once a user has joined a channel, he receives information about