mirror of
https://github.com/progval/irctest.git
synced 2025-04-05 23:09:48 +00:00
Fix IRCv3 tests to not fail with Charybdis.
This commit is contained in:
@ -22,7 +22,12 @@ class MessageTagsTestCase(cases.BaseServerTestCase, cases.OptionalityHelper):
|
|||||||
self.assertEqual(msg.tags, {})
|
self.assertEqual(msg.tags, {})
|
||||||
return msg
|
return msg
|
||||||
|
|
||||||
self.connectClient('alice', name='alice', capabilities=['message-tags'])
|
self.connectClient(
|
||||||
|
'alice',
|
||||||
|
name='alice',
|
||||||
|
capabilities=['message-tags'],
|
||||||
|
skip_if_cap_nak=True
|
||||||
|
)
|
||||||
self.joinChannel('alice', '#test')
|
self.joinChannel('alice', '#test')
|
||||||
self.connectClient('bob', name='bob', capabilities=['message-tags', 'echo-message'])
|
self.connectClient('bob', name='bob', capabilities=['message-tags', 'echo-message'])
|
||||||
self.joinChannel('bob', '#test')
|
self.joinChannel('bob', '#test')
|
||||||
@ -83,7 +88,12 @@ class MessageTagsTestCase(cases.BaseServerTestCase, cases.OptionalityHelper):
|
|||||||
|
|
||||||
@cases.SpecificationSelector.requiredBySpecification('message-tags')
|
@cases.SpecificationSelector.requiredBySpecification('message-tags')
|
||||||
def testLengthLimits(self):
|
def testLengthLimits(self):
|
||||||
self.connectClient('alice', name='alice', capabilities=['message-tags', 'echo-message'])
|
self.connectClient(
|
||||||
|
'alice',
|
||||||
|
name='alice',
|
||||||
|
capabilities=['message-tags', 'echo-message'],
|
||||||
|
skip_if_cap_nak=True
|
||||||
|
)
|
||||||
self.joinChannel('alice', '#test')
|
self.joinChannel('alice', '#test')
|
||||||
self.connectClient('bob', name='bob', capabilities=['message-tags'])
|
self.connectClient('bob', name='bob', capabilities=['message-tags'])
|
||||||
self.joinChannel('bob', '#test')
|
self.joinChannel('bob', '#test')
|
||||||
|
@ -272,7 +272,10 @@ class MonitorTestCase(cases.BaseServerTestCase):
|
|||||||
self.sendLine(2, 'NICK qux')
|
self.sendLine(2, 'NICK qux')
|
||||||
self.getMessages(2)
|
self.getMessages(2)
|
||||||
mononline = self.getMessages(1)[0]
|
mononline = self.getMessages(1)[0]
|
||||||
self.assertMessageEqual(mononline, command=RPL_MONONLINE, params=['bar', 'qux'])
|
self.assertEqual(mononline.command, RPL_MONONLINE)
|
||||||
|
self.assertEqual(len(mononline.params), 2, mononline.params)
|
||||||
|
self.assertIn(mononline.params[0], ('bar', '*'))
|
||||||
|
self.assertEqual(mononline.params[1].split('!')[0], 'qux')
|
||||||
|
|
||||||
# no numerics for a case change
|
# no numerics for a case change
|
||||||
self.sendLine(2, 'NICK QUX')
|
self.sendLine(2, 'NICK QUX')
|
||||||
@ -283,4 +286,7 @@ class MonitorTestCase(cases.BaseServerTestCase):
|
|||||||
self.getMessages(2)
|
self.getMessages(2)
|
||||||
monoffline = self.getMessages(1)[0]
|
monoffline = self.getMessages(1)[0]
|
||||||
# should get RPL_MONOFFLINE with the current unfolded nick
|
# should get RPL_MONOFFLINE with the current unfolded nick
|
||||||
self.assertMessageEqual(monoffline, command=RPL_MONOFFLINE, params=['bar', 'QUX'])
|
self.assertEqual(monoffline.command, RPL_MONOFFLINE)
|
||||||
|
self.assertEqual(len(monoffline.params), 2, monoffline.params)
|
||||||
|
self.assertIn(monoffline.params[0], ('bar', '*'))
|
||||||
|
self.assertEqual(monoffline.params[1].split('!')[0], 'QUX')
|
||||||
|
@ -14,7 +14,9 @@ class MultilineTestCase(cases.BaseServerTestCase, cases.OptionalityHelper):
|
|||||||
|
|
||||||
@cases.SpecificationSelector.requiredBySpecification('multiline')
|
@cases.SpecificationSelector.requiredBySpecification('multiline')
|
||||||
def testBasic(self):
|
def testBasic(self):
|
||||||
self.connectClient('alice', capabilities=(base_caps + [CAP_NAME]))
|
self.connectClient(
|
||||||
|
'alice', capabilities=(base_caps + [CAP_NAME]), skip_if_cap_nak=True
|
||||||
|
)
|
||||||
self.joinChannel(1, '#test')
|
self.joinChannel(1, '#test')
|
||||||
self.connectClient('bob', capabilities=(base_caps + [CAP_NAME]))
|
self.connectClient('bob', capabilities=(base_caps + [CAP_NAME]))
|
||||||
self.joinChannel(2, '#test')
|
self.joinChannel(2, '#test')
|
||||||
@ -80,7 +82,9 @@ class MultilineTestCase(cases.BaseServerTestCase, cases.OptionalityHelper):
|
|||||||
|
|
||||||
@cases.SpecificationSelector.requiredBySpecification('multiline')
|
@cases.SpecificationSelector.requiredBySpecification('multiline')
|
||||||
def testBlankLines(self):
|
def testBlankLines(self):
|
||||||
self.connectClient('alice', capabilities=(base_caps + [CAP_NAME]))
|
self.connectClient(
|
||||||
|
'alice', capabilities=(base_caps + [CAP_NAME]), skip_if_cap_nak=True
|
||||||
|
)
|
||||||
self.joinChannel(1, '#test')
|
self.joinChannel(1, '#test')
|
||||||
self.connectClient('bob', capabilities=(base_caps + [CAP_NAME]))
|
self.connectClient('bob', capabilities=(base_caps + [CAP_NAME]))
|
||||||
self.joinChannel(2, '#test')
|
self.joinChannel(2, '#test')
|
||||||
|
@ -56,7 +56,11 @@ class RegressionsTestCase(cases.BaseServerTestCase):
|
|||||||
@cases.SpecificationSelector.requiredBySpecification('IRCv3.2')
|
@cases.SpecificationSelector.requiredBySpecification('IRCv3.2')
|
||||||
def testTagCap(self):
|
def testTagCap(self):
|
||||||
# regression test for oragono #754
|
# regression test for oragono #754
|
||||||
self.connectClient('alice', capabilities=['message-tags', 'batch', 'echo-message', 'server-time'])
|
self.connectClient(
|
||||||
|
'alice',
|
||||||
|
capabilities=['message-tags', 'batch', 'echo-message', 'server-time'],
|
||||||
|
skip_if_cap_nak=True
|
||||||
|
)
|
||||||
self.connectClient('bob')
|
self.connectClient('bob')
|
||||||
self.getMessages(1)
|
self.getMessages(1)
|
||||||
self.getMessages(2)
|
self.getMessages(2)
|
||||||
|
Reference in New Issue
Block a user