mirror of https://github.com/progval/irctest.git
Add Deprecated test classes, for ones that shouldn't be run by default these days
This commit is contained in:
parent
da25b59380
commit
ca8b3cf625
|
@ -40,8 +40,12 @@ def main(args):
|
||||||
.format(', '.join(args.specification)))
|
.format(', '.join(args.specification)))
|
||||||
exit(1)
|
exit(1)
|
||||||
else:
|
else:
|
||||||
_IrcTestCase.testedSpecifications = frozenset(
|
specs = list(Specifications)
|
||||||
Specifications)
|
# remove deprecated specs
|
||||||
|
specs.remove(Specifications.RFCDeprecated)
|
||||||
|
specs.remove(Specifications.IRC302Deprecated)
|
||||||
|
|
||||||
|
_IrcTestCase.testedSpecifications = frozenset(specs)
|
||||||
print('Testing {} on specification(s): {}'.format(
|
print('Testing {} on specification(s): {}'.format(
|
||||||
controller_class.software_name,
|
controller_class.software_name,
|
||||||
', '.join(sorted(map(lambda x:x.value,
|
', '.join(sorted(map(lambda x:x.value,
|
||||||
|
|
|
@ -150,11 +150,12 @@ class JoinTestCase(cases.BaseServerTestCase):
|
||||||
self.connectClient('foo')
|
self.connectClient('foo')
|
||||||
self.connectClient('bar')
|
self.connectClient('bar')
|
||||||
self.sendLine(1, 'JOIN #chan')
|
self.sendLine(1, 'JOIN #chan')
|
||||||
|
self.getMessages(1)
|
||||||
self.sendLine(2, 'JOIN #chan')
|
self.sendLine(2, 'JOIN #chan')
|
||||||
|
self.getMessages(2)
|
||||||
# TODO: check foo is opped OR +t is unset
|
# TODO: check foo is opped OR +t is unset
|
||||||
|
|
||||||
self.getMessages(1)
|
# clear waiting msgs about cli 2 joining the channel
|
||||||
self.getMessages(2)
|
|
||||||
self.getMessages(1)
|
self.getMessages(1)
|
||||||
|
|
||||||
self.sendLine(1, 'TOPIC #chan :T0P1C')
|
self.sendLine(1, 'TOPIC #chan :T0P1C')
|
||||||
|
@ -359,7 +360,7 @@ class JoinTestCase(cases.BaseServerTestCase):
|
||||||
self.assertMessageEqual(m, command='KICK',
|
self.assertMessageEqual(m, command='KICK',
|
||||||
params=['#chan', 'baz', 'bye'])
|
params=['#chan', 'baz', 'bye'])
|
||||||
|
|
||||||
@cases.SpecificationSelector.requiredBySpecification('RFC1459', 'RFC2812')
|
@cases.SpecificationSelector.requiredBySpecification('RFC-deprecated')
|
||||||
def testInviteNonExistingChannelTransmitted(self):
|
def testInviteNonExistingChannelTransmitted(self):
|
||||||
"""“There is no requirement that the channel the target user is being
|
"""“There is no requirement that the channel the target user is being
|
||||||
invited to must exist or be a valid channel.”
|
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 '
|
'#chan, “bar” should have received “INVITE #chan bar” but '
|
||||||
'got this instead: {msg}')
|
'got this instead: {msg}')
|
||||||
|
|
||||||
@cases.SpecificationSelector.requiredBySpecification('RFC1459', 'RFC2812')
|
@cases.SpecificationSelector.requiredBySpecification('RFC-deprecated')
|
||||||
def testInviteNonExistingChannelEchoed(self):
|
def testInviteNonExistingChannelEchoed(self):
|
||||||
"""“There is no requirement that the channel the target user is being
|
"""“There is no requirement that the channel the target user is being
|
||||||
invited to must exist or be a valid channel.”
|
invited to must exist or be a valid channel.”
|
||||||
|
|
|
@ -9,7 +9,7 @@ from irctest.irc_utils.message_parser import Message
|
||||||
class MetadataTestCase(cases.BaseServerTestCase):
|
class MetadataTestCase(cases.BaseServerTestCase):
|
||||||
valid_metadata_keys = {'valid_key1', 'valid_key2'}
|
valid_metadata_keys = {'valid_key1', 'valid_key2'}
|
||||||
invalid_metadata_keys = {'invalid_key1', 'invalid_key2'}
|
invalid_metadata_keys = {'invalid_key1', 'invalid_key2'}
|
||||||
@cases.SpecificationSelector.requiredBySpecification('IRCv3.2')
|
@cases.SpecificationSelector.requiredBySpecification('IRCv3.2-deprecated')
|
||||||
def testInIsupport(self):
|
def testInIsupport(self):
|
||||||
"""“If METADATA is supported, it MUST be specified in RPL_ISUPPORT
|
"""“If METADATA is supported, it MUST be specified in RPL_ISUPPORT
|
||||||
using the METADATA key.”
|
using the METADATA key.”
|
||||||
|
@ -29,7 +29,7 @@ class MetadataTestCase(cases.BaseServerTestCase):
|
||||||
fail_msg='{item} missing from RPL_ISUPPORT')
|
fail_msg='{item} missing from RPL_ISUPPORT')
|
||||||
self.getMessages(1)
|
self.getMessages(1)
|
||||||
|
|
||||||
@cases.SpecificationSelector.requiredBySpecification('IRCv3.2')
|
@cases.SpecificationSelector.requiredBySpecification('IRCv3.2-deprecated')
|
||||||
def testGetOneUnsetValid(self):
|
def testGetOneUnsetValid(self):
|
||||||
"""<http://ircv3.net/specs/core/metadata-3.2.html#metadata-get>
|
"""<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 '
|
fail_msg='Did not reply with 766 (ERR_NOMATCHINGKEY) to a '
|
||||||
'request to an unset valid METADATA key.')
|
'request to an unset valid METADATA key.')
|
||||||
|
|
||||||
@cases.SpecificationSelector.requiredBySpecification('IRCv3.2')
|
@cases.SpecificationSelector.requiredBySpecification('IRCv3.2-deprecated')
|
||||||
def testGetTwoUnsetValid(self):
|
def testGetTwoUnsetValid(self):
|
||||||
"""“Multiple keys may be given. The response will be either RPL_KEYVALUE,
|
"""“Multiple keys may be given. The response will be either RPL_KEYVALUE,
|
||||||
ERR_KEYINVALID or ERR_NOMATCHINGKEY for every key in order.”
|
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” '
|
fail_msg='Response to “METADATA * GET valid_key1 valid_key2” '
|
||||||
'did not respond to valid_key2 as second response: {msg}')
|
'did not respond to valid_key2 as second response: {msg}')
|
||||||
|
|
||||||
@cases.SpecificationSelector.requiredBySpecification('IRCv3.2')
|
@cases.SpecificationSelector.requiredBySpecification('IRCv3.2-deprecated')
|
||||||
def testListNoSet(self):
|
def testListNoSet(self):
|
||||||
"""“This subcommand MUST list all currently-set metadata keys along
|
"""“This subcommand MUST list all currently-set metadata keys along
|
||||||
with their values. The response will be zero or more RPL_KEYVALUE
|
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 '
|
fail_msg='Response to “METADATA * LIST” was not '
|
||||||
'762 (RPL_METADATAEND) but: {msg}')
|
'762 (RPL_METADATAEND) but: {msg}')
|
||||||
|
|
||||||
@cases.SpecificationSelector.requiredBySpecification('IRCv3.2')
|
@cases.SpecificationSelector.requiredBySpecification('IRCv3.2-deprecated')
|
||||||
def testListInvalidTarget(self):
|
def testListInvalidTarget(self):
|
||||||
"""“In case of invalid target RPL_METADATAEND MUST NOT be sent.”
|
"""“In case of invalid target RPL_METADATAEND MUST NOT be sent.”
|
||||||
-- <http://ircv3.net/specs/core/metadata-3.2.html#metadata-list>
|
-- <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.assertSetValue(target, key, value, displayable_value)
|
||||||
self.assertGetValue(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):
|
def testSetGetValid(self):
|
||||||
"""<http://ircv3.net/specs/core/metadata-3.2.html>
|
"""<http://ircv3.net/specs/core/metadata-3.2.html>
|
||||||
"""
|
"""
|
||||||
self.connectClient('foo')
|
self.connectClient('foo')
|
||||||
self.assertSetGetValue('*', 'valid_key1', 'myvalue')
|
self.assertSetGetValue('*', 'valid_key1', 'myvalue')
|
||||||
|
|
||||||
@cases.SpecificationSelector.requiredBySpecification('IRCv3.2')
|
@cases.SpecificationSelector.requiredBySpecification('IRCv3.2-deprecated')
|
||||||
def testSetGetZeroCharInValue(self):
|
def testSetGetZeroCharInValue(self):
|
||||||
"""“Values are unrestricted, except that they MUST be UTF-8.”
|
"""“Values are unrestricted, except that they MUST be UTF-8.”
|
||||||
-- <http://ircv3.net/specs/core/metadata-3.2.html#metadata-restrictions>
|
-- <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',
|
self.assertSetGetValue('*', 'valid_key1', 'zero->\0<-zero',
|
||||||
'zero->\\0<-zero')
|
'zero->\\0<-zero')
|
||||||
|
|
||||||
@cases.SpecificationSelector.requiredBySpecification('IRCv3.2')
|
@cases.SpecificationSelector.requiredBySpecification('IRCv3.2-deprecated')
|
||||||
def testSetGetHeartInValue(self):
|
def testSetGetHeartInValue(self):
|
||||||
"""“Values are unrestricted, except that they MUST be UTF-8.”
|
"""“Values are unrestricted, except that they MUST be UTF-8.”
|
||||||
-- <http://ircv3.net/specs/core/metadata-3.2.html#metadata-restrictions>
|
-- <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),
|
self.assertSetGetValue('*', 'valid_key1', '->{}<-'.format(heart),
|
||||||
'zero->{}<-zero'.format(heart.encode()))
|
'zero->{}<-zero'.format(heart.encode()))
|
||||||
|
|
||||||
@cases.SpecificationSelector.requiredBySpecification('IRCv3.2')
|
@cases.SpecificationSelector.requiredBySpecification('IRCv3.2-deprecated')
|
||||||
def testSetInvalidUtf8(self):
|
def testSetInvalidUtf8(self):
|
||||||
"""“Values are unrestricted, except that they MUST be UTF-8.”
|
"""“Values are unrestricted, except that they MUST be UTF-8.”
|
||||||
-- <http://ircv3.net/specs/core/metadata-3.2.html#metadata-restrictions>
|
-- <http://ircv3.net/specs/core/metadata-3.2.html#metadata-restrictions>
|
||||||
|
|
|
@ -4,8 +4,10 @@ import enum
|
||||||
class Specifications(enum.Enum):
|
class Specifications(enum.Enum):
|
||||||
RFC1459 = 'RFC1459'
|
RFC1459 = 'RFC1459'
|
||||||
RFC2812 = 'RFC2812'
|
RFC2812 = 'RFC2812'
|
||||||
|
RFCDeprecated = 'RFC-deprecated'
|
||||||
IRC301 = 'IRCv3.1'
|
IRC301 = 'IRCv3.1'
|
||||||
IRC302 = 'IRCv3.2'
|
IRC302 = 'IRCv3.2'
|
||||||
|
IRC302Deprecated = 'IRCv3.2-deprecated'
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def of_name(cls, name):
|
def of_name(cls, name):
|
||||||
|
|
Loading…
Reference in New Issue