mirror of
https://github.com/progval/irctest.git
synced 2025-04-06 07:19:54 +00:00
Add support for clients refusing negotiation and fix typos.
This commit is contained in:
@ -68,6 +68,8 @@ class ClientNegociationHelper:
|
||||
self.protocol_version = 301
|
||||
elif m.params == ['LS', '302']:
|
||||
self.protocol_version = 302
|
||||
elif m.params == ['END']:
|
||||
self.protocol_version = None
|
||||
else:
|
||||
raise AssertionError('Unknown CAP params: {}'
|
||||
.format(m.params))
|
||||
@ -86,7 +88,11 @@ class ClientNegociationHelper:
|
||||
else:
|
||||
return True
|
||||
|
||||
def negociateCapabilities(self, cap_ls):
|
||||
def negotiateCapabilities(self, cap_ls):
|
||||
self.readCapLs()
|
||||
if not self.protocol_version:
|
||||
# No negotiation.
|
||||
return
|
||||
self.sendLine('CAP * LS :')
|
||||
while True:
|
||||
m = self.getMessage(filter_pred=self.userNickPredicate)
|
||||
|
@ -6,6 +6,5 @@ class CapTestCase(cases.BaseClientTestCase, cases.ClientNegociationHelper):
|
||||
self.readCapLs()
|
||||
|
||||
def testEmptyCapLs(self):
|
||||
self.readCapLs()
|
||||
m = self.negociateCapabilities([])
|
||||
m = self.negotiateCapabilities([])
|
||||
self.assertEqual(m, Message([], None, 'CAP', ['END']))
|
||||
|
Reference in New Issue
Block a user