Add Deprecated test classes, for ones that shouldn't be run by default these days

This commit is contained in:
Daniel Oaks 2016-11-30 01:19:19 +10:00
parent da25b59380
commit ca8b3cf625
4 changed files with 22 additions and 15 deletions

View File

@ -40,8 +40,12 @@ def main(args):
.format(', '.join(args.specification)))
exit(1)
else:
_IrcTestCase.testedSpecifications = frozenset(
Specifications)
specs = list(Specifications)
# remove deprecated specs
specs.remove(Specifications.RFCDeprecated)
specs.remove(Specifications.IRC302Deprecated)
_IrcTestCase.testedSpecifications = frozenset(specs)
print('Testing {} on specification(s): {}'.format(
controller_class.software_name,
', '.join(sorted(map(lambda x:x.value,

View File

@ -150,11 +150,12 @@ class JoinTestCase(cases.BaseServerTestCase):
self.connectClient('foo')
self.connectClient('bar')
self.sendLine(1, 'JOIN #chan')
self.getMessages(1)
self.sendLine(2, 'JOIN #chan')
self.getMessages(2)
# TODO: check foo is opped OR +t is unset
self.getMessages(1)
self.getMessages(2)
# clear waiting msgs about cli 2 joining the channel
self.getMessages(1)
self.sendLine(1, 'TOPIC #chan :T0P1C')
@ -359,7 +360,7 @@ class JoinTestCase(cases.BaseServerTestCase):
self.assertMessageEqual(m, command='KICK',
params=['#chan', 'baz', 'bye'])
@cases.SpecificationSelector.requiredBySpecification('RFC1459', 'RFC2812')
@cases.SpecificationSelector.requiredBySpecification('RFC-deprecated')
def testInviteNonExistingChannelTransmitted(self):
"""“There is no requirement that the channel the target user is being
invited to must exist or be a valid channel.
@ -386,7 +387,7 @@ class JoinTestCase(cases.BaseServerTestCase):
'#chan, “bar” should have received “INVITE #chan bar” but '
'got this instead: {msg}')
@cases.SpecificationSelector.requiredBySpecification('RFC1459', 'RFC2812')
@cases.SpecificationSelector.requiredBySpecification('RFC-deprecated')
def testInviteNonExistingChannelEchoed(self):
"""“There is no requirement that the channel the target user is being
invited to must exist or be a valid channel.

View File

@ -9,7 +9,7 @@ from irctest.irc_utils.message_parser import Message
class MetadataTestCase(cases.BaseServerTestCase):
valid_metadata_keys = {'valid_key1', 'valid_key2'}
invalid_metadata_keys = {'invalid_key1', 'invalid_key2'}
@cases.SpecificationSelector.requiredBySpecification('IRCv3.2')
@cases.SpecificationSelector.requiredBySpecification('IRCv3.2-deprecated')
def testInIsupport(self):
"""“If METADATA is supported, it MUST be specified in RPL_ISUPPORT
using the METADATA key.
@ -29,7 +29,7 @@ class MetadataTestCase(cases.BaseServerTestCase):
fail_msg='{item} missing from RPL_ISUPPORT')
self.getMessages(1)
@cases.SpecificationSelector.requiredBySpecification('IRCv3.2')
@cases.SpecificationSelector.requiredBySpecification('IRCv3.2-deprecated')
def testGetOneUnsetValid(self):
"""<http://ircv3.net/specs/core/metadata-3.2.html#metadata-get>
"""
@ -40,7 +40,7 @@ class MetadataTestCase(cases.BaseServerTestCase):
fail_msg='Did not reply with 766 (ERR_NOMATCHINGKEY) to a '
'request to an unset valid METADATA key.')
@cases.SpecificationSelector.requiredBySpecification('IRCv3.2')
@cases.SpecificationSelector.requiredBySpecification('IRCv3.2-deprecated')
def testGetTwoUnsetValid(self):
"""“Multiple keys may be given. The response will be either RPL_KEYVALUE,
ERR_KEYINVALID or ERR_NOMATCHINGKEY for every key in order.
@ -63,7 +63,7 @@ class MetadataTestCase(cases.BaseServerTestCase):
fail_msg='Response to “METADATA * GET valid_key1 valid_key2” '
'did not respond to valid_key2 as second response: {msg}')
@cases.SpecificationSelector.requiredBySpecification('IRCv3.2')
@cases.SpecificationSelector.requiredBySpecification('IRCv3.2-deprecated')
def testListNoSet(self):
"""“This subcommand MUST list all currently-set metadata keys along
with their values. The response will be zero or more RPL_KEYVALUE
@ -77,7 +77,7 @@ class MetadataTestCase(cases.BaseServerTestCase):
fail_msg='Response to “METADATA * LIST” was not '
'762 (RPL_METADATAEND) but: {msg}')
@cases.SpecificationSelector.requiredBySpecification('IRCv3.2')
@cases.SpecificationSelector.requiredBySpecification('IRCv3.2-deprecated')
def testListInvalidTarget(self):
"""“In case of invalid target RPL_METADATAEND MUST NOT be sent.”
-- <http://ircv3.net/specs/core/metadata-3.2.html#metadata-list>
@ -131,14 +131,14 @@ class MetadataTestCase(cases.BaseServerTestCase):
self.assertSetValue(target, key, value, displayable_value)
self.assertGetValue(target, key, value, displayable_value)
@cases.SpecificationSelector.requiredBySpecification('IRCv3.2')
@cases.SpecificationSelector.requiredBySpecification('IRCv3.2-deprecated')
def testSetGetValid(self):
"""<http://ircv3.net/specs/core/metadata-3.2.html>
"""
self.connectClient('foo')
self.assertSetGetValue('*', 'valid_key1', 'myvalue')
@cases.SpecificationSelector.requiredBySpecification('IRCv3.2')
@cases.SpecificationSelector.requiredBySpecification('IRCv3.2-deprecated')
def testSetGetZeroCharInValue(self):
"""“Values are unrestricted, except that they MUST be UTF-8.”
-- <http://ircv3.net/specs/core/metadata-3.2.html#metadata-restrictions>
@ -147,7 +147,7 @@ class MetadataTestCase(cases.BaseServerTestCase):
self.assertSetGetValue('*', 'valid_key1', 'zero->\0<-zero',
'zero->\\0<-zero')
@cases.SpecificationSelector.requiredBySpecification('IRCv3.2')
@cases.SpecificationSelector.requiredBySpecification('IRCv3.2-deprecated')
def testSetGetHeartInValue(self):
"""“Values are unrestricted, except that they MUST be UTF-8.”
-- <http://ircv3.net/specs/core/metadata-3.2.html#metadata-restrictions>
@ -157,7 +157,7 @@ class MetadataTestCase(cases.BaseServerTestCase):
self.assertSetGetValue('*', 'valid_key1', '->{}<-'.format(heart),
'zero->{}<-zero'.format(heart.encode()))
@cases.SpecificationSelector.requiredBySpecification('IRCv3.2')
@cases.SpecificationSelector.requiredBySpecification('IRCv3.2-deprecated')
def testSetInvalidUtf8(self):
"""“Values are unrestricted, except that they MUST be UTF-8.”
-- <http://ircv3.net/specs/core/metadata-3.2.html#metadata-restrictions>

View File

@ -4,8 +4,10 @@ import enum
class Specifications(enum.Enum):
RFC1459 = 'RFC1459'
RFC2812 = 'RFC2812'
RFCDeprecated = 'RFC-deprecated'
IRC301 = 'IRCv3.1'
IRC302 = 'IRCv3.2'
IRC302Deprecated = 'IRCv3.2-deprecated'
@classmethod
def of_name(cls, name):