Fix IRCv3 tests to not fail with Charybdis.

This commit is contained in:
2021-02-17 21:17:47 +01:00
parent 75dafa47fe
commit a74f893942
4 changed files with 31 additions and 7 deletions

View File

@ -22,7 +22,12 @@ class MessageTagsTestCase(cases.BaseServerTestCase, cases.OptionalityHelper):
self.assertEqual(msg.tags, {})
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.connectClient('bob', name='bob', capabilities=['message-tags', 'echo-message'])
self.joinChannel('bob', '#test')
@ -83,7 +88,12 @@ class MessageTagsTestCase(cases.BaseServerTestCase, cases.OptionalityHelper):
@cases.SpecificationSelector.requiredBySpecification('message-tags')
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.connectClient('bob', name='bob', capabilities=['message-tags'])
self.joinChannel('bob', '#test')

View File

@ -272,7 +272,10 @@ class MonitorTestCase(cases.BaseServerTestCase):
self.sendLine(2, 'NICK qux')
self.getMessages(2)
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
self.sendLine(2, 'NICK QUX')
@ -283,4 +286,7 @@ class MonitorTestCase(cases.BaseServerTestCase):
self.getMessages(2)
monoffline = self.getMessages(1)[0]
# 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')

View File

@ -14,7 +14,9 @@ class MultilineTestCase(cases.BaseServerTestCase, cases.OptionalityHelper):
@cases.SpecificationSelector.requiredBySpecification('multiline')
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.connectClient('bob', capabilities=(base_caps + [CAP_NAME]))
self.joinChannel(2, '#test')
@ -80,7 +82,9 @@ class MultilineTestCase(cases.BaseServerTestCase, cases.OptionalityHelper):
@cases.SpecificationSelector.requiredBySpecification('multiline')
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.connectClient('bob', capabilities=(base_caps + [CAP_NAME]))
self.joinChannel(2, '#test')

View File

@ -56,7 +56,11 @@ class RegressionsTestCase(cases.BaseServerTestCase):
@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(
'alice',
capabilities=['message-tags', 'batch', 'echo-message', 'server-time'],
skip_if_cap_nak=True
)
self.connectClient('bob')
self.getMessages(1)
self.getMessages(2)