From b35258f6ab87f042c33463f7eab9fd326235d957 Mon Sep 17 00:00:00 2001 From: Shivaram Lingamneni Date: Thu, 20 Feb 2020 23:44:53 -0500 Subject: [PATCH] empty batch test --- irctest/server_tests/test_chathistory.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/irctest/server_tests/test_chathistory.py b/irctest/server_tests/test_chathistory.py index 7cf5ca5..9f4dd3d 100644 --- a/irctest/server_tests/test_chathistory.py +++ b/irctest/server_tests/test_chathistory.py @@ -35,6 +35,18 @@ def validate_chathistory_batch(msgs): class ChathistoryTestCase(cases.BaseServerTestCase): + @cases.SpecificationSelector.requiredBySpecification('Oragono') + def testEmptyBatch(self): + bar = random_name('bar') + self.controller.registerUser(self, bar, bar) + self.connectClient(bar, name=bar, capabilities=['batch', 'labeled-response', 'message-tags', 'server-time'], password=bar) + self.getMessages(bar) + + # no chathistory results SHOULD result in an empty batch: + self.sendLine(bar, 'CHATHISTORY LATEST * * 10') + msgs = self.getMessages(bar) + self.assertEqual([msg.command for msg in msgs], ['BATCH', 'BATCH']) + @cases.SpecificationSelector.requiredBySpecification('Oragono') def testMessagesToSelf(self): bar = random_name('bar')