mirror of
https://github.com/progval/irctest.git
synced 2025-04-05 14:59:49 +00:00
add blank line test
This commit is contained in:
@ -73,3 +73,42 @@ class MultilineTestCase(cases.BaseServerTestCase, cases.OptionalityHelper):
|
||||
self.assertEqual(msg.tags.get('time'), time)
|
||||
self.assertNotIn(CONCAT_TAG, msg.tags)
|
||||
self.assertEqual(relayed_fmsgids, [msgid] + [None]*(len(fallback_relay)-1))
|
||||
|
||||
|
||||
@cases.SpecificationSelector.requiredBySpecification('Oragono')
|
||||
def testBlankLines(self):
|
||||
self.connectClient('alice', capabilities=(base_caps + [CAP_NAME]))
|
||||
self.joinChannel(1, '#test')
|
||||
self.connectClient('bob', capabilities=(base_caps + [CAP_NAME]))
|
||||
self.joinChannel(2, '#test')
|
||||
self.connectClient('charlie', capabilities=base_caps)
|
||||
self.joinChannel(3, '#test')
|
||||
|
||||
self.getMessages(1)
|
||||
self.getMessages(2)
|
||||
self.getMessages(3)
|
||||
|
||||
self.sendLine(1, '@label=xyz;+client-only-tag BATCH +123 %s #test' % (BATCH_TYPE,))
|
||||
self.sendLine(1, '@batch=123 PRIVMSG #test :')
|
||||
self.sendLine(1, '@batch=123 PRIVMSG #test :#how is ')
|
||||
self.sendLine(1, '@batch=123;%s PRIVMSG #test :everyone?' % (CONCAT_TAG,))
|
||||
self.sendLine(1, 'BATCH -123')
|
||||
self.getMessages(1)
|
||||
|
||||
relay = self.getMessages(2)
|
||||
batch_start = relay[0]
|
||||
privmsgs = relay[1:-1]
|
||||
self.assertEqual(len(privmsgs), 3)
|
||||
self.assertMessageEqual(privmsgs[0], command='PRIVMSG', params=['#test', ''])
|
||||
self.assertMessageEqual(privmsgs[1], command='PRIVMSG', params=['#test', '#how is '])
|
||||
self.assertMessageEqual(privmsgs[2], command='PRIVMSG', params=['#test', 'everyone?'])
|
||||
self.assertIn('+client-only-tag', batch_start.tags)
|
||||
msgid = batch_start.tags['msgid']
|
||||
|
||||
fallback_relay = self.getMessages(3)
|
||||
self.assertEqual(len(fallback_relay), 2)
|
||||
self.assertMessageEqual(fallback_relay[0], command='PRIVMSG', params=['#test', '#how is '])
|
||||
self.assertMessageEqual(fallback_relay[1], command='PRIVMSG', params=['#test', 'everyone?'])
|
||||
self.assertIn('+client-only-tag', fallback_relay[0].tags)
|
||||
self.assertIn('+client-only-tag', fallback_relay[1].tags)
|
||||
self.assertEqual(fallback_relay[0].tags['msgid'], msgid)
|
||||
|
Reference in New Issue
Block a user