mirror of
https://github.com/progval/irctest.git
synced 2025-04-06 07:19:54 +00:00
Remove useless 'OptionalityHelper'.
This commit is contained in:
@ -732,24 +732,10 @@ class BaseServerTestCase(
|
|||||||
raise ChannelJoinException(msg.command, msg.params)
|
raise ChannelJoinException(msg.command, msg.params)
|
||||||
|
|
||||||
|
|
||||||
_TSelf = TypeVar("_TSelf", bound="OptionalityHelper")
|
_TSelf = TypeVar("_TSelf", bound="_IrcTestCase")
|
||||||
_TReturn = TypeVar("_TReturn")
|
_TReturn = TypeVar("_TReturn")
|
||||||
|
|
||||||
|
|
||||||
class OptionalityHelper(Generic[TController]):
|
|
||||||
controller: TController
|
|
||||||
|
|
||||||
def checkSaslSupport(self) -> None:
|
|
||||||
if self.controller.supported_sasl_mechanisms:
|
|
||||||
return
|
|
||||||
raise runner.NotImplementedByController("SASL")
|
|
||||||
|
|
||||||
def checkMechanismSupport(self, mechanism: str) -> None:
|
|
||||||
if mechanism in self.controller.supported_sasl_mechanisms:
|
|
||||||
return
|
|
||||||
raise runner.OptionalSaslMechanismNotSupported(mechanism)
|
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def skipUnlessHasMechanism(
|
def skipUnlessHasMechanism(
|
||||||
mech: str,
|
mech: str,
|
||||||
) -> Callable[[Callable[..., _TReturn]], Callable[..., _TReturn]]:
|
) -> Callable[[Callable[..., _TReturn]], Callable[..., _TReturn]]:
|
||||||
@ -760,18 +746,20 @@ class OptionalityHelper(Generic[TController]):
|
|||||||
def decorator(f: Callable[..., _TReturn]) -> Callable[..., _TReturn]:
|
def decorator(f: Callable[..., _TReturn]) -> Callable[..., _TReturn]:
|
||||||
@functools.wraps(f)
|
@functools.wraps(f)
|
||||||
def newf(self: _TSelf, *args: Any, **kwargs: Any) -> _TReturn:
|
def newf(self: _TSelf, *args: Any, **kwargs: Any) -> _TReturn:
|
||||||
self.checkMechanismSupport(mech)
|
if mech not in self.controller.supported_sasl_mechanisms:
|
||||||
|
raise runner.OptionalSaslMechanismNotSupported(mech)
|
||||||
return f(self, *args, **kwargs)
|
return f(self, *args, **kwargs)
|
||||||
|
|
||||||
return newf
|
return newf
|
||||||
|
|
||||||
return decorator
|
return decorator
|
||||||
|
|
||||||
@staticmethod
|
|
||||||
def skipUnlessHasSasl(f: Callable[..., _TReturn]) -> Callable[..., _TReturn]:
|
def skipUnlessHasSasl(f: Callable[..., _TReturn]) -> Callable[..., _TReturn]:
|
||||||
@functools.wraps(f)
|
@functools.wraps(f)
|
||||||
def newf(self: _TSelf, *args: Any, **kwargs: Any) -> _TReturn:
|
def newf(self: _TSelf, *args: Any, **kwargs: Any) -> _TReturn:
|
||||||
self.checkSaslSupport()
|
if not self.controller.supported_sasl_mechanisms:
|
||||||
|
raise runner.NotImplementedByController("SASL")
|
||||||
return f(self, *args, **kwargs)
|
return f(self, *args, **kwargs)
|
||||||
|
|
||||||
return newf
|
return newf
|
||||||
|
@ -39,8 +39,8 @@ class IdentityHash:
|
|||||||
return self._data
|
return self._data
|
||||||
|
|
||||||
|
|
||||||
class SaslTestCase(cases.BaseClientTestCase, cases.OptionalityHelper):
|
class SaslTestCase(cases.BaseClientTestCase):
|
||||||
@cases.OptionalityHelper.skipUnlessHasMechanism("PLAIN")
|
@cases.skipUnlessHasMechanism("PLAIN")
|
||||||
def testPlain(self):
|
def testPlain(self):
|
||||||
"""Test PLAIN authentication with correct username/password."""
|
"""Test PLAIN authentication with correct username/password."""
|
||||||
auth = authentication.Authentication(
|
auth = authentication.Authentication(
|
||||||
@ -60,7 +60,7 @@ class SaslTestCase(cases.BaseClientTestCase, cases.OptionalityHelper):
|
|||||||
m = self.negotiateCapabilities(["sasl"], False)
|
m = self.negotiateCapabilities(["sasl"], False)
|
||||||
self.assertEqual(m, Message({}, None, "CAP", ["END"]))
|
self.assertEqual(m, Message({}, None, "CAP", ["END"]))
|
||||||
|
|
||||||
@cases.OptionalityHelper.skipUnlessHasMechanism("PLAIN")
|
@cases.skipUnlessHasMechanism("PLAIN")
|
||||||
def testPlainNotAvailable(self):
|
def testPlainNotAvailable(self):
|
||||||
"""`sasl=EXTERNAL` is advertized, whereas the client is configured
|
"""`sasl=EXTERNAL` is advertized, whereas the client is configured
|
||||||
to use PLAIN.
|
to use PLAIN.
|
||||||
@ -90,7 +90,7 @@ class SaslTestCase(cases.BaseClientTestCase, cases.OptionalityHelper):
|
|||||||
self.assertMessageMatch(m, command="CAP")
|
self.assertMessageMatch(m, command="CAP")
|
||||||
|
|
||||||
@pytest.mark.parametrize("pattern", ["barbaz", "éèà"])
|
@pytest.mark.parametrize("pattern", ["barbaz", "éèà"])
|
||||||
@cases.OptionalityHelper.skipUnlessHasMechanism("PLAIN")
|
@cases.skipUnlessHasMechanism("PLAIN")
|
||||||
def testPlainLarge(self, pattern):
|
def testPlainLarge(self, pattern):
|
||||||
"""Test the client splits large AUTHENTICATE messages whose payload
|
"""Test the client splits large AUTHENTICATE messages whose payload
|
||||||
is not a multiple of 400.
|
is not a multiple of 400.
|
||||||
@ -119,7 +119,7 @@ class SaslTestCase(cases.BaseClientTestCase, cases.OptionalityHelper):
|
|||||||
m = self.negotiateCapabilities(["sasl"], False)
|
m = self.negotiateCapabilities(["sasl"], False)
|
||||||
self.assertEqual(m, Message({}, None, "CAP", ["END"]))
|
self.assertEqual(m, Message({}, None, "CAP", ["END"]))
|
||||||
|
|
||||||
@cases.OptionalityHelper.skipUnlessHasMechanism("PLAIN")
|
@cases.skipUnlessHasMechanism("PLAIN")
|
||||||
@pytest.mark.parametrize("pattern", ["quux", "éè"])
|
@pytest.mark.parametrize("pattern", ["quux", "éè"])
|
||||||
def testPlainLargeMultiple(self, pattern):
|
def testPlainLargeMultiple(self, pattern):
|
||||||
"""Test the client splits large AUTHENTICATE messages whose payload
|
"""Test the client splits large AUTHENTICATE messages whose payload
|
||||||
@ -150,7 +150,7 @@ class SaslTestCase(cases.BaseClientTestCase, cases.OptionalityHelper):
|
|||||||
self.assertEqual(m, Message({}, None, "CAP", ["END"]))
|
self.assertEqual(m, Message({}, None, "CAP", ["END"]))
|
||||||
|
|
||||||
@pytest.mark.skipif(ecdsa is None, reason="python3-ecdsa is not available")
|
@pytest.mark.skipif(ecdsa is None, reason="python3-ecdsa is not available")
|
||||||
@cases.OptionalityHelper.skipUnlessHasMechanism("ECDSA-NIST256P-CHALLENGE")
|
@cases.skipUnlessHasMechanism("ECDSA-NIST256P-CHALLENGE")
|
||||||
def testEcdsa(self):
|
def testEcdsa(self):
|
||||||
"""Test ECDSA authentication."""
|
"""Test ECDSA authentication."""
|
||||||
auth = authentication.Authentication(
|
auth = authentication.Authentication(
|
||||||
@ -184,7 +184,7 @@ class SaslTestCase(cases.BaseClientTestCase, cases.OptionalityHelper):
|
|||||||
m = self.negotiateCapabilities(["sasl"], False)
|
m = self.negotiateCapabilities(["sasl"], False)
|
||||||
self.assertEqual(m, Message({}, None, "CAP", ["END"]))
|
self.assertEqual(m, Message({}, None, "CAP", ["END"]))
|
||||||
|
|
||||||
@cases.OptionalityHelper.skipUnlessHasMechanism("SCRAM-SHA-256")
|
@cases.skipUnlessHasMechanism("SCRAM-SHA-256")
|
||||||
def testScram(self):
|
def testScram(self):
|
||||||
"""Test SCRAM-SHA-256 authentication."""
|
"""Test SCRAM-SHA-256 authentication."""
|
||||||
auth = authentication.Authentication(
|
auth = authentication.Authentication(
|
||||||
@ -226,7 +226,7 @@ class SaslTestCase(cases.BaseClientTestCase, cases.OptionalityHelper):
|
|||||||
self.assertEqual(m.command, "AUTHENTICATE", m)
|
self.assertEqual(m.command, "AUTHENTICATE", m)
|
||||||
self.assertEqual(m.params, ["+"], m)
|
self.assertEqual(m.params, ["+"], m)
|
||||||
|
|
||||||
@cases.OptionalityHelper.skipUnlessHasMechanism("SCRAM-SHA-256")
|
@cases.skipUnlessHasMechanism("SCRAM-SHA-256")
|
||||||
def testScramBadPassword(self):
|
def testScramBadPassword(self):
|
||||||
"""Test SCRAM-SHA-256 authentication with a bad password."""
|
"""Test SCRAM-SHA-256 authentication with a bad password."""
|
||||||
auth = authentication.Authentication(
|
auth = authentication.Authentication(
|
||||||
@ -261,8 +261,8 @@ class SaslTestCase(cases.BaseClientTestCase, cases.OptionalityHelper):
|
|||||||
authenticator.response(msg)
|
authenticator.response(msg)
|
||||||
|
|
||||||
|
|
||||||
class Irc302SaslTestCase(cases.BaseClientTestCase, cases.OptionalityHelper):
|
class Irc302SaslTestCase(cases.BaseClientTestCase):
|
||||||
@cases.OptionalityHelper.skipUnlessHasMechanism("PLAIN")
|
@cases.skipUnlessHasMechanism("PLAIN")
|
||||||
def testPlainNotAvailable(self):
|
def testPlainNotAvailable(self):
|
||||||
"""Test the client does not try to authenticate using a mechanism the
|
"""Test the client does not try to authenticate using a mechanism the
|
||||||
server does not advertise.
|
server does not advertise.
|
||||||
|
@ -140,7 +140,7 @@ class TlsTestCase(cases.BaseClientTestCase):
|
|||||||
self.getMessage()
|
self.getMessage()
|
||||||
|
|
||||||
|
|
||||||
class StsTestCase(cases.BaseClientTestCase, cases.OptionalityHelper):
|
class StsTestCase(cases.BaseClientTestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super().setUp()
|
super().setUp()
|
||||||
self.insecure_server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
self.insecure_server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||||
|
@ -6,7 +6,7 @@ from irctest import cases
|
|||||||
|
|
||||||
|
|
||||||
@cases.mark_services
|
@cases.mark_services
|
||||||
class AccountTagTestCase(cases.BaseServerTestCase, cases.OptionalityHelper):
|
class AccountTagTestCase(cases.BaseServerTestCase):
|
||||||
def connectRegisteredClient(self, nick):
|
def connectRegisteredClient(self, nick):
|
||||||
self.addClient()
|
self.addClient()
|
||||||
self.sendLine(2, "CAP LS 302")
|
self.sendLine(2, "CAP LS 302")
|
||||||
@ -40,7 +40,7 @@ class AccountTagTestCase(cases.BaseServerTestCase, cases.OptionalityHelper):
|
|||||||
self.skipToWelcome(2)
|
self.skipToWelcome(2)
|
||||||
|
|
||||||
@cases.mark_capabilities("account-tag")
|
@cases.mark_capabilities("account-tag")
|
||||||
@cases.OptionalityHelper.skipUnlessHasMechanism("PLAIN")
|
@cases.skipUnlessHasMechanism("PLAIN")
|
||||||
def testPrivmsg(self):
|
def testPrivmsg(self):
|
||||||
self.connectClient("foo", capabilities=["account-tag"], skip_if_cap_nak=True)
|
self.connectClient("foo", capabilities=["account-tag"], skip_if_cap_nak=True)
|
||||||
self.getMessages(1)
|
self.getMessages(1)
|
||||||
@ -54,7 +54,7 @@ class AccountTagTestCase(cases.BaseServerTestCase, cases.OptionalityHelper):
|
|||||||
)
|
)
|
||||||
|
|
||||||
@cases.mark_capabilities("account-tag")
|
@cases.mark_capabilities("account-tag")
|
||||||
@cases.OptionalityHelper.skipUnlessHasMechanism("PLAIN")
|
@cases.skipUnlessHasMechanism("PLAIN")
|
||||||
def testInvite(self):
|
def testInvite(self):
|
||||||
self.connectClient("foo", capabilities=["account-tag"], skip_if_cap_nak=True)
|
self.connectClient("foo", capabilities=["account-tag"], skip_if_cap_nak=True)
|
||||||
self.getMessages(1)
|
self.getMessages(1)
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
from irctest import cases
|
from irctest import cases
|
||||||
|
|
||||||
|
|
||||||
class AwayNotifyTestCase(cases.BaseServerTestCase, cases.OptionalityHelper):
|
class AwayNotifyTestCase(cases.BaseServerTestCase):
|
||||||
@cases.mark_capabilities("away-notify")
|
@cases.mark_capabilities("away-notify")
|
||||||
def testAwayNotify(self):
|
def testAwayNotify(self):
|
||||||
"""Basic away-notify test."""
|
"""Basic away-notify test."""
|
||||||
|
@ -8,7 +8,7 @@ from irctest.patma import ANYSTR
|
|||||||
from irctest.runner import CapabilityNotSupported, ImplementationChoice
|
from irctest.runner import CapabilityNotSupported, ImplementationChoice
|
||||||
|
|
||||||
|
|
||||||
class CapTestCase(cases.BaseServerTestCase, cases.OptionalityHelper):
|
class CapTestCase(cases.BaseServerTestCase):
|
||||||
@cases.mark_specifications("IRCv3")
|
@cases.mark_specifications("IRCv3")
|
||||||
def testNoReq(self):
|
def testNoReq(self):
|
||||||
"""Test the server handles gracefully clients which do not send
|
"""Test the server handles gracefully clients which do not send
|
||||||
|
@ -6,7 +6,7 @@ from irctest import cases
|
|||||||
|
|
||||||
|
|
||||||
@cases.mark_services
|
@cases.mark_services
|
||||||
class MetadataTestCase(cases.BaseServerTestCase, cases.OptionalityHelper):
|
class MetadataTestCase(cases.BaseServerTestCase):
|
||||||
def connectRegisteredClient(self, nick):
|
def connectRegisteredClient(self, nick):
|
||||||
self.addClient()
|
self.addClient()
|
||||||
self.sendLine(2, "CAP LS 302")
|
self.sendLine(2, "CAP LS 302")
|
||||||
@ -50,7 +50,7 @@ class MetadataTestCase(cases.BaseServerTestCase, cases.OptionalityHelper):
|
|||||||
)
|
)
|
||||||
|
|
||||||
@cases.mark_capabilities("extended-join")
|
@cases.mark_capabilities("extended-join")
|
||||||
@cases.OptionalityHelper.skipUnlessHasMechanism("PLAIN")
|
@cases.skipUnlessHasMechanism("PLAIN")
|
||||||
def testLoggedIn(self):
|
def testLoggedIn(self):
|
||||||
self.connectClient("foo", capabilities=["extended-join"], skip_if_cap_nak=True)
|
self.connectClient("foo", capabilities=["extended-join"], skip_if_cap_nak=True)
|
||||||
self.joinChannel(1, "#chan")
|
self.joinChannel(1, "#chan")
|
||||||
|
@ -14,7 +14,7 @@ from irctest.numerics import ERR_UNKNOWNCOMMAND
|
|||||||
from irctest.patma import ANYDICT, ANYOPTSTR, NotStrRe, RemainingKeys, StrRe
|
from irctest.patma import ANYDICT, ANYOPTSTR, NotStrRe, RemainingKeys, StrRe
|
||||||
|
|
||||||
|
|
||||||
class LabeledResponsesTestCase(cases.BaseServerTestCase, cases.OptionalityHelper):
|
class LabeledResponsesTestCase(cases.BaseServerTestCase):
|
||||||
@cases.mark_capabilities("echo-message", "batch", "labeled-response")
|
@cases.mark_capabilities("echo-message", "batch", "labeled-response")
|
||||||
def testLabeledPrivmsgResponsesToMultipleClients(self):
|
def testLabeledPrivmsgResponsesToMultipleClients(self):
|
||||||
self.connectClient(
|
self.connectClient(
|
||||||
|
@ -10,7 +10,7 @@ from irctest.numerics import ERR_INPUTTOOLONG
|
|||||||
from irctest.patma import ANYDICT, ANYSTR, StrRe
|
from irctest.patma import ANYDICT, ANYSTR, StrRe
|
||||||
|
|
||||||
|
|
||||||
class MessageTagsTestCase(cases.BaseServerTestCase, cases.OptionalityHelper):
|
class MessageTagsTestCase(cases.BaseServerTestCase):
|
||||||
@pytest.mark.arbitrary_client_tags
|
@pytest.mark.arbitrary_client_tags
|
||||||
@cases.mark_capabilities("message-tags")
|
@cases.mark_capabilities("message-tags")
|
||||||
def testBasic(self):
|
def testBasic(self):
|
||||||
|
@ -12,7 +12,7 @@ CONCAT_TAG = "draft/multiline-concat"
|
|||||||
base_caps = ["message-tags", "batch", "echo-message", "server-time", "labeled-response"]
|
base_caps = ["message-tags", "batch", "echo-message", "server-time", "labeled-response"]
|
||||||
|
|
||||||
|
|
||||||
class MultilineTestCase(cases.BaseServerTestCase, cases.OptionalityHelper):
|
class MultilineTestCase(cases.BaseServerTestCase):
|
||||||
@cases.mark_capabilities("draft/multiline")
|
@cases.mark_capabilities("draft/multiline")
|
||||||
def testBasic(self):
|
def testBasic(self):
|
||||||
self.connectClient(
|
self.connectClient(
|
||||||
|
@ -12,9 +12,9 @@ class RegistrationTestCase(cases.BaseServerTestCase):
|
|||||||
|
|
||||||
|
|
||||||
@cases.mark_services
|
@cases.mark_services
|
||||||
class SaslTestCase(cases.BaseServerTestCase, cases.OptionalityHelper):
|
class SaslTestCase(cases.BaseServerTestCase):
|
||||||
@cases.mark_specifications("IRCv3")
|
@cases.mark_specifications("IRCv3")
|
||||||
@cases.OptionalityHelper.skipUnlessHasMechanism("PLAIN")
|
@cases.skipUnlessHasMechanism("PLAIN")
|
||||||
def testPlain(self):
|
def testPlain(self):
|
||||||
"""PLAIN authentication with correct username/password."""
|
"""PLAIN authentication with correct username/password."""
|
||||||
self.controller.registerUser(self, "foo", "sesame")
|
self.controller.registerUser(self, "foo", "sesame")
|
||||||
@ -54,7 +54,7 @@ class SaslTestCase(cases.BaseServerTestCase, cases.OptionalityHelper):
|
|||||||
)
|
)
|
||||||
|
|
||||||
@cases.mark_specifications("IRCv3")
|
@cases.mark_specifications("IRCv3")
|
||||||
@cases.OptionalityHelper.skipUnlessHasMechanism("PLAIN")
|
@cases.skipUnlessHasMechanism("PLAIN")
|
||||||
def testPlainNonAscii(self):
|
def testPlainNonAscii(self):
|
||||||
password = "é" * 100
|
password = "é" * 100
|
||||||
authstring = base64.b64encode(
|
authstring = base64.b64encode(
|
||||||
@ -82,7 +82,7 @@ class SaslTestCase(cases.BaseServerTestCase, cases.OptionalityHelper):
|
|||||||
)
|
)
|
||||||
|
|
||||||
@cases.mark_specifications("IRCv3")
|
@cases.mark_specifications("IRCv3")
|
||||||
@cases.OptionalityHelper.skipUnlessHasMechanism("PLAIN")
|
@cases.skipUnlessHasMechanism("PLAIN")
|
||||||
def testPlainNoAuthzid(self):
|
def testPlainNoAuthzid(self):
|
||||||
"""“message = [authzid] UTF8NUL authcid UTF8NUL passwd
|
"""“message = [authzid] UTF8NUL authcid UTF8NUL passwd
|
||||||
|
|
||||||
@ -170,7 +170,7 @@ class SaslTestCase(cases.BaseServerTestCase, cases.OptionalityHelper):
|
|||||||
)
|
)
|
||||||
|
|
||||||
@cases.mark_specifications("IRCv3")
|
@cases.mark_specifications("IRCv3")
|
||||||
@cases.OptionalityHelper.skipUnlessHasMechanism("PLAIN")
|
@cases.skipUnlessHasMechanism("PLAIN")
|
||||||
def testPlainLarge(self):
|
def testPlainLarge(self):
|
||||||
"""Test the client splits large AUTHENTICATE messages whose payload
|
"""Test the client splits large AUTHENTICATE messages whose payload
|
||||||
is not a multiple of 400.
|
is not a multiple of 400.
|
||||||
@ -232,7 +232,7 @@ class SaslTestCase(cases.BaseServerTestCase, cases.OptionalityHelper):
|
|||||||
# message's length too big for it to be valid.
|
# message's length too big for it to be valid.
|
||||||
|
|
||||||
@cases.mark_specifications("IRCv3")
|
@cases.mark_specifications("IRCv3")
|
||||||
@cases.OptionalityHelper.skipUnlessHasMechanism("PLAIN")
|
@cases.skipUnlessHasMechanism("PLAIN")
|
||||||
def testPlainLargeEquals400(self):
|
def testPlainLargeEquals400(self):
|
||||||
"""Test the client splits large AUTHENTICATE messages whose payload
|
"""Test the client splits large AUTHENTICATE messages whose payload
|
||||||
is not a multiple of 400.
|
is not a multiple of 400.
|
||||||
@ -277,7 +277,7 @@ class SaslTestCase(cases.BaseServerTestCase, cases.OptionalityHelper):
|
|||||||
# message's length too big for it to be valid.
|
# message's length too big for it to be valid.
|
||||||
|
|
||||||
@cases.mark_specifications("IRCv3")
|
@cases.mark_specifications("IRCv3")
|
||||||
@cases.OptionalityHelper.skipUnlessHasMechanism("SCRAM-SHA-256")
|
@cases.skipUnlessHasMechanism("SCRAM-SHA-256")
|
||||||
def testScramSha256Success(self):
|
def testScramSha256Success(self):
|
||||||
self.controller.registerUser(self, "Scramtest", "sesame")
|
self.controller.registerUser(self, "Scramtest", "sesame")
|
||||||
|
|
||||||
@ -333,7 +333,7 @@ class SaslTestCase(cases.BaseServerTestCase, cases.OptionalityHelper):
|
|||||||
self.confirmSuccessfulAuth()
|
self.confirmSuccessfulAuth()
|
||||||
|
|
||||||
@cases.mark_specifications("IRCv3")
|
@cases.mark_specifications("IRCv3")
|
||||||
@cases.OptionalityHelper.skipUnlessHasMechanism("SCRAM-SHA-256")
|
@cases.skipUnlessHasMechanism("SCRAM-SHA-256")
|
||||||
def testScramSha256Failure(self):
|
def testScramSha256Failure(self):
|
||||||
self.controller.registerUser(self, "Scramtest", "sesame")
|
self.controller.registerUser(self, "Scramtest", "sesame")
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ from irctest import cases
|
|||||||
from irctest.patma import ANYSTR
|
from irctest.patma import ANYSTR
|
||||||
|
|
||||||
|
|
||||||
class Utf8TestCase(cases.BaseServerTestCase, cases.OptionalityHelper):
|
class Utf8TestCase(cases.BaseServerTestCase):
|
||||||
@cases.mark_specifications("Ergo")
|
@cases.mark_specifications("Ergo")
|
||||||
def testUtf8Validation(self):
|
def testUtf8Validation(self):
|
||||||
self.connectClient(
|
self.connectClient(
|
||||||
|
@ -84,7 +84,7 @@ class BaseWhoTestCase:
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class WhoTestCase(BaseWhoTestCase, cases.BaseServerTestCase, cases.OptionalityHelper):
|
class WhoTestCase(BaseWhoTestCase, cases.BaseServerTestCase):
|
||||||
@cases.mark_specifications("Modern")
|
@cases.mark_specifications("Modern")
|
||||||
def testWhoStar(self):
|
def testWhoStar(self):
|
||||||
self._init()
|
self._init()
|
||||||
@ -422,9 +422,7 @@ class WhoTestCase(BaseWhoTestCase, cases.BaseServerTestCase, cases.OptionalityHe
|
|||||||
|
|
||||||
|
|
||||||
@cases.mark_services
|
@cases.mark_services
|
||||||
class WhoServicesTestCase(
|
class WhoServicesTestCase(BaseWhoTestCase, cases.BaseServerTestCase):
|
||||||
BaseWhoTestCase, cases.BaseServerTestCase, cases.OptionalityHelper
|
|
||||||
):
|
|
||||||
@cases.mark_specifications("IRCv3")
|
@cases.mark_specifications("IRCv3")
|
||||||
@cases.mark_isupport("WHOX")
|
@cases.mark_isupport("WHOX")
|
||||||
def testWhoxAccount(self):
|
def testWhoxAccount(self):
|
||||||
|
@ -164,7 +164,7 @@ class _WhoisTestMixin(cases.BaseServerTestCase):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class WhoisTestCase(_WhoisTestMixin, cases.BaseServerTestCase, cases.OptionalityHelper):
|
class WhoisTestCase(_WhoisTestMixin, cases.BaseServerTestCase):
|
||||||
@pytest.mark.parametrize(
|
@pytest.mark.parametrize(
|
||||||
"server",
|
"server",
|
||||||
["", "My.Little.Server", "coolNick"],
|
["", "My.Little.Server", "coolNick"],
|
||||||
@ -210,11 +210,9 @@ class WhoisTestCase(_WhoisTestMixin, cases.BaseServerTestCase, cases.Optionality
|
|||||||
|
|
||||||
|
|
||||||
@cases.mark_services
|
@cases.mark_services
|
||||||
class ServicesWhoisTestCase(
|
class ServicesWhoisTestCase(_WhoisTestMixin, cases.BaseServerTestCase):
|
||||||
_WhoisTestMixin, cases.BaseServerTestCase, cases.OptionalityHelper
|
|
||||||
):
|
|
||||||
@pytest.mark.parametrize("oper", [False, True], ids=["normal", "oper"])
|
@pytest.mark.parametrize("oper", [False, True], ids=["normal", "oper"])
|
||||||
@cases.OptionalityHelper.skipUnlessHasMechanism("PLAIN")
|
@cases.skipUnlessHasMechanism("PLAIN")
|
||||||
@cases.mark_specifications("Modern")
|
@cases.mark_specifications("Modern")
|
||||||
def testWhoisNumerics(self, oper):
|
def testWhoisNumerics(self, oper):
|
||||||
"""Tests all numerics are in the exhaustive list defined in the Modern spec,
|
"""Tests all numerics are in the exhaustive list defined in the Modern spec,
|
||||||
@ -297,7 +295,7 @@ class ServicesWhoisTestCase(
|
|||||||
"RPL_WHOISCHANNELS should be sent for a non-invisible nick",
|
"RPL_WHOISCHANNELS should be sent for a non-invisible nick",
|
||||||
)
|
)
|
||||||
|
|
||||||
@cases.OptionalityHelper.skipUnlessHasMechanism("PLAIN")
|
@cases.skipUnlessHasMechanism("PLAIN")
|
||||||
@cases.mark_specifications("ircdocs")
|
@cases.mark_specifications("ircdocs")
|
||||||
def testWhoisAccount(self):
|
def testWhoisAccount(self):
|
||||||
"""Test numeric 330, RPL_WHOISACCOUNT.
|
"""Test numeric 330, RPL_WHOISACCOUNT.
|
||||||
|
Reference in New Issue
Block a user