From 829cb3886368f579908179024567251d719cae4c Mon Sep 17 00:00:00 2001 From: Shivaram Lingamneni Date: Wed, 22 Jul 2020 20:41:30 -0400 Subject: [PATCH] test 2-argument form of znc *playback --- irctest/server_tests/test_znc_playback.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/irctest/server_tests/test_znc_playback.py b/irctest/server_tests/test_znc_playback.py index 167503d..bd56228 100644 --- a/irctest/server_tests/test_znc_playback.py +++ b/irctest/server_tests/test_znc_playback.py @@ -75,6 +75,20 @@ class ZncPlaybackTestCase(cases.BaseServerTestCase): self.sendLine('viewer', 'QUIT') self.assertDisconnected('viewer') + # test 2-argument form + self.connectClient(bar, name='viewer', capabilities=['batch', 'labeled-response', 'message-tags', 'server-time', 'echo-message'], password=pw) + self.sendLine('viewer', 'PRIVMSG *playback :play %s' % (chname,)) + messages = [to_history_message(msg) for msg in self.getMessages('viewer') if msg.command == 'PRIVMSG'] + self.assertEqual(messages, echo_messages) + self.sendLine('viewer', 'PRIVMSG *playback :play *self') + messages = [to_history_message(msg) for msg in self.getMessages('viewer') if msg.command == 'PRIVMSG'] + self.assertEqual(messages, [dm]) + self.sendLine('viewer', 'PRIVMSG *playback :play *') + messages = [to_history_message(msg) for msg in self.getMessages('viewer') if msg.command == 'PRIVMSG'] + self.assertEqual(set(messages), set([dm] + echo_messages)) + self.sendLine('viewer', 'QUIT') + self.assertDisconnected('viewer') + # test limiting behavior config = self.controller.getConfig() config['history']['znc-maxmessages'] = 5