mirror of
https://github.com/progval/irctest.git
synced 2025-04-05 14:59:49 +00:00
upgrade resume test to 0.5
This commit is contained in:
@ -22,7 +22,7 @@ class ResumeTestCase(cases.BaseServerTestCase):
|
|||||||
self.connectClient('bar', capabilities=['batch', 'draft/labeled-response', 'server-time'])
|
self.connectClient('bar', capabilities=['batch', 'draft/labeled-response', 'server-time'])
|
||||||
ms = self.getMessages(1)
|
ms = self.getMessages(1)
|
||||||
|
|
||||||
welcome = self.connectClient('baz', capabilities=['batch', 'draft/labeled-response', 'server-time', 'draft/resume-0.4'])
|
welcome = self.connectClient('baz', capabilities=['batch', 'draft/labeled-response', 'server-time', 'draft/resume-0.5'])
|
||||||
resume_messages = [m for m in welcome if m.command == 'RESUME']
|
resume_messages = [m for m in welcome if m.command == 'RESUME']
|
||||||
self.assertEqual(len(resume_messages), 1)
|
self.assertEqual(len(resume_messages), 1)
|
||||||
self.assertEqual(resume_messages[0].params[0], 'TOKEN')
|
self.assertEqual(resume_messages[0].params[0], 'TOKEN')
|
||||||
@ -46,7 +46,7 @@ class ResumeTestCase(cases.BaseServerTestCase):
|
|||||||
bad_token = 'a' * len(token)
|
bad_token = 'a' * len(token)
|
||||||
self.addClient()
|
self.addClient()
|
||||||
self.sendLine(3, 'CAP LS')
|
self.sendLine(3, 'CAP LS')
|
||||||
self.sendLine(3, 'CAP REQ :batch draft/labeled-response server-time draft/resume-0.4')
|
self.sendLine(3, 'CAP REQ :batch draft/labeled-response server-time draft/resume-0.5')
|
||||||
self.sendLine(3, 'NICK tempnick')
|
self.sendLine(3, 'NICK tempnick')
|
||||||
self.sendLine(3, 'USER tempuser 0 * tempuser')
|
self.sendLine(3, 'USER tempuser 0 * tempuser')
|
||||||
self.sendLine(3, ' '.join(('RESUME', bad_token, ANCIENT_TIMESTAMP)))
|
self.sendLine(3, ' '.join(('RESUME', bad_token, ANCIENT_TIMESTAMP)))
|
||||||
@ -62,7 +62,7 @@ class ResumeTestCase(cases.BaseServerTestCase):
|
|||||||
|
|
||||||
self.addClient()
|
self.addClient()
|
||||||
self.sendLine(4, 'CAP LS')
|
self.sendLine(4, 'CAP LS')
|
||||||
self.sendLine(4, 'CAP REQ :batch draft/labeled-response server-time draft/resume-0.4')
|
self.sendLine(4, 'CAP REQ :batch draft/labeled-response server-time draft/resume-0.5')
|
||||||
self.sendLine(4, 'NICK tempnick_')
|
self.sendLine(4, 'NICK tempnick_')
|
||||||
self.sendLine(4, 'USER tempuser 0 * tempuser')
|
self.sendLine(4, 'USER tempuser 0 * tempuser')
|
||||||
# resume with a timestamp in the distant past
|
# resume with a timestamp in the distant past
|
||||||
@ -108,10 +108,10 @@ class ResumeTestCase(cases.BaseServerTestCase):
|
|||||||
# test chain-resuming (resuming the resumed connection, using the new token)
|
# test chain-resuming (resuming the resumed connection, using the new token)
|
||||||
self.addClient()
|
self.addClient()
|
||||||
self.sendLine(5, 'CAP LS')
|
self.sendLine(5, 'CAP LS')
|
||||||
self.sendLine(5, 'CAP REQ :batch draft/labeled-response server-time draft/resume-0.4')
|
self.sendLine(5, 'CAP REQ :batch draft/labeled-response server-time draft/resume-0.5')
|
||||||
self.sendLine(5, 'NICK tempnick_')
|
self.sendLine(5, 'NICK tempnick_')
|
||||||
self.sendLine(5, 'USER tempuser 0 * tempuser')
|
self.sendLine(5, 'USER tempuser 0 * tempuser')
|
||||||
self.sendLine(5, 'RESUME ' + new_token)
|
self.sendLine(5, 'RESUME ' + new_token + ' ' + ANCIENT_TIMESTAMP)
|
||||||
ms = self.getMessages(5)
|
ms = self.getMessages(5)
|
||||||
|
|
||||||
resume_messages = [m for m in ms if m.command == 'RESUME']
|
resume_messages = [m for m in ms if m.command == 'RESUME']
|
||||||
@ -130,7 +130,7 @@ class ResumeTestCase(cases.BaseServerTestCase):
|
|||||||
ms = self.getMessages(1)
|
ms = self.getMessages(1)
|
||||||
self.joinChannel(1, '#xyz')
|
self.joinChannel(1, '#xyz')
|
||||||
|
|
||||||
welcome = self.connectClient('baz', capabilities=['batch', 'draft/labeled-response', 'server-time', 'draft/resume-0.4'])
|
welcome = self.connectClient('baz', capabilities=['batch', 'draft/labeled-response', 'server-time', 'draft/resume-0.5'])
|
||||||
resume_messages = [m for m in welcome if m.command == 'RESUME']
|
resume_messages = [m for m in welcome if m.command == 'RESUME']
|
||||||
self.assertEqual(len(resume_messages), 1)
|
self.assertEqual(len(resume_messages), 1)
|
||||||
self.assertEqual(resume_messages[0].params[0], 'TOKEN')
|
self.assertEqual(resume_messages[0].params[0], 'TOKEN')
|
||||||
@ -153,7 +153,7 @@ class ResumeTestCase(cases.BaseServerTestCase):
|
|||||||
self.assertMessageEqual(self.getMessage(1), command=RPL_AWAY, params=['bar', 'baz', 'software upgrade'])
|
self.assertMessageEqual(self.getMessage(1), command=RPL_AWAY, params=['bar', 'baz', 'software upgrade'])
|
||||||
|
|
||||||
self.addClient(3)
|
self.addClient(3)
|
||||||
self.sendLine(3, 'CAP REQ :batch account-tag message-tags draft/resume-0.4')
|
self.sendLine(3, 'CAP REQ :batch account-tag message-tags draft/resume-0.5')
|
||||||
self.sendLine(3, ' '.join(('RESUME', token, ANCIENT_TIMESTAMP)))
|
self.sendLine(3, ' '.join(('RESUME', token, ANCIENT_TIMESTAMP)))
|
||||||
ms = self.getMessages(3)
|
ms = self.getMessages(3)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user