mirror of
https://github.com/progval/irctest.git
synced 2025-04-04 22:39:50 +00:00
add a regression test for oragono #754
This commit is contained in:
@ -48,3 +48,32 @@ class RegressionsTestCase(cases.BaseServerTestCase):
|
||||
self.sendLine(1, 'NICK Alice')
|
||||
ms = self.getMessages(2)
|
||||
self.assertEqual(ms, [])
|
||||
|
||||
@cases.SpecificationSelector.requiredBySpecification('IRCv3.2')
|
||||
def testTagCap(self):
|
||||
# regression test for oragono #754
|
||||
self.connectClient('alice', capabilities=['message-tags', 'batch', 'echo-message', 'server-time'])
|
||||
self.connectClient('bob')
|
||||
self.getMessages(1)
|
||||
self.getMessages(2)
|
||||
|
||||
self.sendLine(1, '@+draft/reply=ct95w3xemz8qj9du2h74wp8pee PRIVMSG bob :hey yourself')
|
||||
ms = self.getMessages(1)
|
||||
self.assertEqual(len(ms), 1)
|
||||
self.assertMessageEqual(ms[0], command='PRIVMSG', params=['bob', 'hey yourself'])
|
||||
self.assertEqual(ms[0].tags.get('+draft/reply'), 'ct95w3xemz8qj9du2h74wp8pee')
|
||||
|
||||
ms = self.getMessages(2)
|
||||
self.assertEqual(len(ms), 1)
|
||||
self.assertMessageEqual(ms[0], command='PRIVMSG', params=['bob', 'hey yourself'])
|
||||
self.assertEqual(ms[0].tags, {})
|
||||
|
||||
self.sendLine(2, 'CAP REQ :message-tags server-time')
|
||||
self.getMessages(2)
|
||||
self.sendLine(1, '@+draft/reply=tbxqauh9nykrtpa3n6icd9whan PRIVMSG bob :hey again')
|
||||
self.getMessages(1)
|
||||
ms = self.getMessages(2)
|
||||
# now bob has the tags cap, so he should receive the tags
|
||||
self.assertEqual(len(ms), 1)
|
||||
self.assertMessageEqual(ms[0], command='PRIVMSG', params=['bob', 'hey again'])
|
||||
self.assertEqual(ms[0].tags.get('+draft/reply'), 'tbxqauh9nykrtpa3n6icd9whan')
|
||||
|
Reference in New Issue
Block a user