empty batch test

This commit is contained in:
Shivaram Lingamneni 2020-02-20 23:44:53 -05:00
parent 1b372e996a
commit b35258f6ab

View File

@ -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')