mirror of
https://github.com/progval/irctest.git
synced 2025-04-05 06:49:47 +00:00
Use real metadata keys (#194)
This commit is contained in:
@ -261,8 +261,6 @@ class BaseServerController(_BaseController):
|
|||||||
password: Optional[str],
|
password: Optional[str],
|
||||||
ssl: bool,
|
ssl: bool,
|
||||||
run_services: bool,
|
run_services: bool,
|
||||||
valid_metadata_keys: Optional[Set[str]],
|
|
||||||
invalid_metadata_keys: Optional[Set[str]],
|
|
||||||
faketime: Optional[str],
|
faketime: Optional[str],
|
||||||
) -> None:
|
) -> None:
|
||||||
raise NotImplementedError()
|
raise NotImplementedError()
|
||||||
|
@ -529,8 +529,6 @@ class BaseServerTestCase(
|
|||||||
|
|
||||||
password: Optional[str] = None
|
password: Optional[str] = None
|
||||||
ssl = False
|
ssl = False
|
||||||
valid_metadata_keys: Set[str] = set()
|
|
||||||
invalid_metadata_keys: Set[str] = set()
|
|
||||||
server_support: Optional[Dict[str, Optional[str]]]
|
server_support: Optional[Dict[str, Optional[str]]]
|
||||||
run_services = False
|
run_services = False
|
||||||
|
|
||||||
@ -550,8 +548,6 @@ class BaseServerTestCase(
|
|||||||
self.hostname,
|
self.hostname,
|
||||||
self.port,
|
self.port,
|
||||||
password=self.password,
|
password=self.password,
|
||||||
valid_metadata_keys=self.valid_metadata_keys,
|
|
||||||
invalid_metadata_keys=self.invalid_metadata_keys,
|
|
||||||
ssl=self.ssl,
|
ssl=self.ssl,
|
||||||
run_services=self.run_services,
|
run_services=self.run_services,
|
||||||
faketime=self.faketime,
|
faketime=self.faketime,
|
||||||
|
@ -3,11 +3,7 @@ import shutil
|
|||||||
import subprocess
|
import subprocess
|
||||||
from typing import Optional, Set, Type
|
from typing import Optional, Set, Type
|
||||||
|
|
||||||
from irctest.basecontrollers import (
|
from irctest.basecontrollers import BaseServerController, DirectoryBasedController
|
||||||
BaseServerController,
|
|
||||||
DirectoryBasedController,
|
|
||||||
NotImplementedByController,
|
|
||||||
)
|
|
||||||
|
|
||||||
TEMPLATE_CONFIG = """
|
TEMPLATE_CONFIG = """
|
||||||
global {{
|
global {{
|
||||||
@ -111,15 +107,8 @@ class BahamutController(BaseServerController, DirectoryBasedController):
|
|||||||
password: Optional[str],
|
password: Optional[str],
|
||||||
ssl: bool,
|
ssl: bool,
|
||||||
run_services: bool,
|
run_services: bool,
|
||||||
valid_metadata_keys: Optional[Set[str]] = None,
|
|
||||||
invalid_metadata_keys: Optional[Set[str]] = None,
|
|
||||||
restricted_metadata_keys: Optional[Set[str]] = None,
|
|
||||||
faketime: Optional[str],
|
faketime: Optional[str],
|
||||||
) -> None:
|
) -> None:
|
||||||
if valid_metadata_keys or invalid_metadata_keys:
|
|
||||||
raise NotImplementedByController(
|
|
||||||
"Defining valid and invalid METADATA keys."
|
|
||||||
)
|
|
||||||
assert self.proc is None
|
assert self.proc is None
|
||||||
self.port = port
|
self.port = port
|
||||||
self.hostname = hostname
|
self.hostname = hostname
|
||||||
|
@ -1,12 +1,8 @@
|
|||||||
import shutil
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
from typing import Optional, Set
|
from typing import Optional
|
||||||
|
|
||||||
from irctest.basecontrollers import (
|
from irctest.basecontrollers import BaseServerController, DirectoryBasedController
|
||||||
BaseServerController,
|
|
||||||
DirectoryBasedController,
|
|
||||||
NotImplementedByController,
|
|
||||||
)
|
|
||||||
|
|
||||||
TEMPLATE_SSL_CONFIG = """
|
TEMPLATE_SSL_CONFIG = """
|
||||||
ssl_private_key = "{key_path}";
|
ssl_private_key = "{key_path}";
|
||||||
@ -40,14 +36,8 @@ class BaseHybridController(BaseServerController, DirectoryBasedController):
|
|||||||
password: Optional[str],
|
password: Optional[str],
|
||||||
ssl: bool,
|
ssl: bool,
|
||||||
run_services: bool,
|
run_services: bool,
|
||||||
valid_metadata_keys: Optional[Set[str]] = None,
|
|
||||||
invalid_metadata_keys: Optional[Set[str]] = None,
|
|
||||||
faketime: Optional[str],
|
faketime: Optional[str],
|
||||||
) -> None:
|
) -> None:
|
||||||
if valid_metadata_keys or invalid_metadata_keys:
|
|
||||||
raise NotImplementedByController(
|
|
||||||
"Defining valid and invalid METADATA keys."
|
|
||||||
)
|
|
||||||
assert self.proc is None
|
assert self.proc is None
|
||||||
self.port = port
|
self.port = port
|
||||||
self.hostname = hostname
|
self.hostname = hostname
|
||||||
|
@ -3,13 +3,9 @@ import json
|
|||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
from typing import Any, Dict, Optional, Set, Type, Union
|
from typing import Any, Dict, Optional, Type, Union
|
||||||
|
|
||||||
from irctest.basecontrollers import (
|
from irctest.basecontrollers import BaseServerController, DirectoryBasedController
|
||||||
BaseServerController,
|
|
||||||
DirectoryBasedController,
|
|
||||||
NotImplementedByController,
|
|
||||||
)
|
|
||||||
from irctest.cases import BaseServerTestCase
|
from irctest.cases import BaseServerTestCase
|
||||||
|
|
||||||
BASE_CONFIG = {
|
BASE_CONFIG = {
|
||||||
@ -153,17 +149,9 @@ class ErgoController(BaseServerController, DirectoryBasedController):
|
|||||||
password: Optional[str],
|
password: Optional[str],
|
||||||
ssl: bool,
|
ssl: bool,
|
||||||
run_services: bool,
|
run_services: bool,
|
||||||
valid_metadata_keys: Optional[Set[str]] = None,
|
|
||||||
invalid_metadata_keys: Optional[Set[str]] = None,
|
|
||||||
restricted_metadata_keys: Optional[Set[str]] = None,
|
|
||||||
faketime: Optional[str],
|
faketime: Optional[str],
|
||||||
config: Optional[Any] = None,
|
config: Optional[Any] = None,
|
||||||
) -> None:
|
) -> None:
|
||||||
if valid_metadata_keys or invalid_metadata_keys:
|
|
||||||
raise NotImplementedByController(
|
|
||||||
"Defining valid and invalid METADATA keys."
|
|
||||||
)
|
|
||||||
|
|
||||||
self.create_config()
|
self.create_config()
|
||||||
if config is None:
|
if config is None:
|
||||||
config = copy.deepcopy(BASE_CONFIG)
|
config = copy.deepcopy(BASE_CONFIG)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import os
|
import os
|
||||||
from typing import Optional, Set, Tuple, Type
|
from typing import Optional, Tuple, Type
|
||||||
|
|
||||||
from irctest.basecontrollers import BaseServerController
|
from irctest.basecontrollers import BaseServerController
|
||||||
|
|
||||||
@ -39,9 +39,6 @@ class ExternalServerController(BaseServerController):
|
|||||||
password: Optional[str],
|
password: Optional[str],
|
||||||
ssl: bool,
|
ssl: bool,
|
||||||
run_services: bool,
|
run_services: bool,
|
||||||
valid_metadata_keys: Optional[Set[str]] = None,
|
|
||||||
invalid_metadata_keys: Optional[Set[str]] = None,
|
|
||||||
restricted_metadata_keys: Optional[Set[str]] = None,
|
|
||||||
faketime: Optional[str],
|
faketime: Optional[str],
|
||||||
) -> None:
|
) -> None:
|
||||||
pass
|
pass
|
||||||
|
@ -1,13 +1,9 @@
|
|||||||
import functools
|
import functools
|
||||||
import shutil
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
from typing import Optional, Set, Type
|
from typing import Optional, Type
|
||||||
|
|
||||||
from irctest.basecontrollers import (
|
from irctest.basecontrollers import BaseServerController, DirectoryBasedController
|
||||||
BaseServerController,
|
|
||||||
DirectoryBasedController,
|
|
||||||
NotImplementedByController,
|
|
||||||
)
|
|
||||||
|
|
||||||
TEMPLATE_CONFIG = """
|
TEMPLATE_CONFIG = """
|
||||||
# Clients:
|
# Clients:
|
||||||
@ -124,15 +120,8 @@ class InspircdController(BaseServerController, DirectoryBasedController):
|
|||||||
password: Optional[str],
|
password: Optional[str],
|
||||||
ssl: bool,
|
ssl: bool,
|
||||||
run_services: bool,
|
run_services: bool,
|
||||||
valid_metadata_keys: Optional[Set[str]] = None,
|
|
||||||
invalid_metadata_keys: Optional[Set[str]] = None,
|
|
||||||
restricted_metadata_keys: Optional[Set[str]] = None,
|
|
||||||
faketime: Optional[str] = None,
|
faketime: Optional[str] = None,
|
||||||
) -> None:
|
) -> None:
|
||||||
if valid_metadata_keys or invalid_metadata_keys:
|
|
||||||
raise NotImplementedByController(
|
|
||||||
"Defining valid and invalid METADATA keys."
|
|
||||||
)
|
|
||||||
assert self.proc is None
|
assert self.proc is None
|
||||||
self.port = port
|
self.port = port
|
||||||
self.hostname = hostname
|
self.hostname = hostname
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import shutil
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
from typing import Optional, Set, Type
|
from typing import Optional, Type
|
||||||
|
|
||||||
from irctest.basecontrollers import (
|
from irctest.basecontrollers import (
|
||||||
BaseServerController,
|
BaseServerController,
|
||||||
@ -49,14 +49,8 @@ class Irc2Controller(BaseServerController, DirectoryBasedController):
|
|||||||
password: Optional[str],
|
password: Optional[str],
|
||||||
ssl: bool,
|
ssl: bool,
|
||||||
run_services: bool,
|
run_services: bool,
|
||||||
valid_metadata_keys: Optional[Set[str]] = None,
|
|
||||||
invalid_metadata_keys: Optional[Set[str]] = None,
|
|
||||||
faketime: Optional[str],
|
faketime: Optional[str],
|
||||||
) -> None:
|
) -> None:
|
||||||
if valid_metadata_keys or invalid_metadata_keys:
|
|
||||||
raise NotImplementedByController(
|
|
||||||
"Defining valid and invalid METADATA keys."
|
|
||||||
)
|
|
||||||
if ssl:
|
if ssl:
|
||||||
raise NotImplementedByController("TLS")
|
raise NotImplementedByController("TLS")
|
||||||
if run_services:
|
if run_services:
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import shutil
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
from typing import Optional, Set, Type
|
from typing import Optional, Type
|
||||||
|
|
||||||
from irctest.basecontrollers import (
|
from irctest.basecontrollers import (
|
||||||
BaseServerController,
|
BaseServerController,
|
||||||
@ -68,14 +68,8 @@ class Ircu2Controller(BaseServerController, DirectoryBasedController):
|
|||||||
password: Optional[str],
|
password: Optional[str],
|
||||||
ssl: bool,
|
ssl: bool,
|
||||||
run_services: bool,
|
run_services: bool,
|
||||||
valid_metadata_keys: Optional[Set[str]] = None,
|
|
||||||
invalid_metadata_keys: Optional[Set[str]] = None,
|
|
||||||
faketime: Optional[str],
|
faketime: Optional[str],
|
||||||
) -> None:
|
) -> None:
|
||||||
if valid_metadata_keys or invalid_metadata_keys:
|
|
||||||
raise NotImplementedByController(
|
|
||||||
"Defining valid and invalid METADATA keys."
|
|
||||||
)
|
|
||||||
if ssl:
|
if ssl:
|
||||||
raise NotImplementedByController("TLS")
|
raise NotImplementedByController("TLS")
|
||||||
if run_services:
|
if run_services:
|
||||||
|
@ -33,10 +33,10 @@ extensions:
|
|||||||
- mammon.ext.ircv3.sasl
|
- mammon.ext.ircv3.sasl
|
||||||
- mammon.ext.misc.nopost
|
- mammon.ext.misc.nopost
|
||||||
metadata:
|
metadata:
|
||||||
restricted_keys:
|
restricted_keys: []
|
||||||
{restricted_keys}
|
|
||||||
whitelist:
|
whitelist:
|
||||||
{authorized_keys}
|
- display-name
|
||||||
|
- avatar
|
||||||
monitor:
|
monitor:
|
||||||
limit: 20
|
limit: 20
|
||||||
motd:
|
motd:
|
||||||
@ -89,9 +89,6 @@ class MammonController(BaseServerController, DirectoryBasedController):
|
|||||||
password: Optional[str],
|
password: Optional[str],
|
||||||
ssl: bool,
|
ssl: bool,
|
||||||
run_services: bool,
|
run_services: bool,
|
||||||
valid_metadata_keys: Optional[Set[str]] = None,
|
|
||||||
invalid_metadata_keys: Optional[Set[str]] = None,
|
|
||||||
restricted_metadata_keys: Optional[Set[str]] = None,
|
|
||||||
faketime: Optional[str],
|
faketime: Optional[str],
|
||||||
) -> None:
|
) -> None:
|
||||||
if password is not None:
|
if password is not None:
|
||||||
@ -107,8 +104,6 @@ class MammonController(BaseServerController, DirectoryBasedController):
|
|||||||
directory=self.directory,
|
directory=self.directory,
|
||||||
hostname=hostname,
|
hostname=hostname,
|
||||||
port=port,
|
port=port,
|
||||||
authorized_keys=make_list(valid_metadata_keys or set()),
|
|
||||||
restricted_keys=make_list(restricted_metadata_keys or set()),
|
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
# with self.open_file('server.yml', 'r') as fd:
|
# with self.open_file('server.yml', 'r') as fd:
|
||||||
|
@ -2,11 +2,7 @@ import shutil
|
|||||||
import subprocess
|
import subprocess
|
||||||
from typing import Optional, Set, Type
|
from typing import Optional, Set, Type
|
||||||
|
|
||||||
from irctest.basecontrollers import (
|
from irctest.basecontrollers import BaseServerController, DirectoryBasedController
|
||||||
BaseServerController,
|
|
||||||
DirectoryBasedController,
|
|
||||||
NotImplementedByController,
|
|
||||||
)
|
|
||||||
|
|
||||||
TEMPLATE_CONFIG = """
|
TEMPLATE_CONFIG = """
|
||||||
[Global]
|
[Global]
|
||||||
@ -52,15 +48,8 @@ class NgircdController(BaseServerController, DirectoryBasedController):
|
|||||||
password: Optional[str],
|
password: Optional[str],
|
||||||
ssl: bool,
|
ssl: bool,
|
||||||
run_services: bool,
|
run_services: bool,
|
||||||
valid_metadata_keys: Optional[Set[str]] = None,
|
|
||||||
invalid_metadata_keys: Optional[Set[str]] = None,
|
|
||||||
restricted_metadata_keys: Optional[Set[str]] = None,
|
|
||||||
faketime: Optional[str],
|
faketime: Optional[str],
|
||||||
) -> None:
|
) -> None:
|
||||||
if valid_metadata_keys or invalid_metadata_keys:
|
|
||||||
raise NotImplementedByController(
|
|
||||||
"Defining valid and invalid METADATA keys."
|
|
||||||
)
|
|
||||||
assert self.proc is None
|
assert self.proc is None
|
||||||
self.port = port
|
self.port = port
|
||||||
self.hostname = hostname
|
self.hostname = hostname
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import shutil
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
from typing import Optional, Set, Type
|
from typing import Optional, Type
|
||||||
|
|
||||||
from irctest.basecontrollers import (
|
from irctest.basecontrollers import (
|
||||||
BaseServerController,
|
BaseServerController,
|
||||||
@ -67,14 +67,8 @@ class SnircdController(BaseServerController, DirectoryBasedController):
|
|||||||
password: Optional[str],
|
password: Optional[str],
|
||||||
ssl: bool,
|
ssl: bool,
|
||||||
run_services: bool,
|
run_services: bool,
|
||||||
valid_metadata_keys: Optional[Set[str]] = None,
|
|
||||||
invalid_metadata_keys: Optional[Set[str]] = None,
|
|
||||||
faketime: Optional[str],
|
faketime: Optional[str],
|
||||||
) -> None:
|
) -> None:
|
||||||
if valid_metadata_keys or invalid_metadata_keys:
|
|
||||||
raise NotImplementedByController(
|
|
||||||
"Defining valid and invalid METADATA keys."
|
|
||||||
)
|
|
||||||
if ssl:
|
if ssl:
|
||||||
raise NotImplementedByController("TLS")
|
raise NotImplementedByController("TLS")
|
||||||
if run_services:
|
if run_services:
|
||||||
|
@ -5,13 +5,9 @@ from pathlib import Path
|
|||||||
import shutil
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
import textwrap
|
import textwrap
|
||||||
from typing import Callable, ContextManager, Iterator, Optional, Set, Type
|
from typing import Callable, ContextManager, Iterator, Optional, Type
|
||||||
|
|
||||||
from irctest.basecontrollers import (
|
from irctest.basecontrollers import BaseServerController, DirectoryBasedController
|
||||||
BaseServerController,
|
|
||||||
DirectoryBasedController,
|
|
||||||
NotImplementedByController,
|
|
||||||
)
|
|
||||||
|
|
||||||
TEMPLATE_CONFIG = """
|
TEMPLATE_CONFIG = """
|
||||||
include "modules.default.conf";
|
include "modules.default.conf";
|
||||||
@ -203,15 +199,8 @@ class UnrealircdController(BaseServerController, DirectoryBasedController):
|
|||||||
password: Optional[str],
|
password: Optional[str],
|
||||||
ssl: bool,
|
ssl: bool,
|
||||||
run_services: bool,
|
run_services: bool,
|
||||||
valid_metadata_keys: Optional[Set[str]] = None,
|
|
||||||
invalid_metadata_keys: Optional[Set[str]] = None,
|
|
||||||
restricted_metadata_keys: Optional[Set[str]] = None,
|
|
||||||
faketime: Optional[str],
|
faketime: Optional[str],
|
||||||
) -> None:
|
) -> None:
|
||||||
if valid_metadata_keys or invalid_metadata_keys:
|
|
||||||
raise NotImplementedByController(
|
|
||||||
"Defining valid and invalid METADATA keys."
|
|
||||||
)
|
|
||||||
assert self.proc is None
|
assert self.proc is None
|
||||||
self.port = port
|
self.port = port
|
||||||
self.hostname = hostname
|
self.hostname = hostname
|
||||||
|
@ -6,8 +6,8 @@ from irctest import cases
|
|||||||
|
|
||||||
|
|
||||||
class MetadataTestCase(cases.BaseServerTestCase):
|
class MetadataTestCase(cases.BaseServerTestCase):
|
||||||
valid_metadata_keys = {"valid_key1", "valid_key2"}
|
valid_metadata_keys = {"display-name", "avatar"}
|
||||||
invalid_metadata_keys = {"invalid_key1", "invalid_key2"}
|
invalid_metadata_keys = {"indisplay-name", "inavatar"}
|
||||||
|
|
||||||
@cases.mark_specifications("IRCv3", deprecated=True)
|
@cases.mark_specifications("IRCv3", deprecated=True)
|
||||||
def testInIsupport(self):
|
def testInIsupport(self):
|
||||||
@ -36,7 +36,7 @@ class MetadataTestCase(cases.BaseServerTestCase):
|
|||||||
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>"""
|
||||||
self.connectClient("foo")
|
self.connectClient("foo")
|
||||||
self.sendLine(1, "METADATA * GET valid_key1")
|
self.sendLine(1, "METADATA * GET display-name")
|
||||||
m = self.getMessage(1)
|
m = self.getMessage(1)
|
||||||
self.assertMessageMatch(
|
self.assertMessageMatch(
|
||||||
m,
|
m,
|
||||||
@ -52,7 +52,7 @@ class MetadataTestCase(cases.BaseServerTestCase):
|
|||||||
-- <http://ircv3.net/specs/core/metadata-3.2.html#metadata-get>
|
-- <http://ircv3.net/specs/core/metadata-3.2.html#metadata-get>
|
||||||
"""
|
"""
|
||||||
self.connectClient("foo")
|
self.connectClient("foo")
|
||||||
self.sendLine(1, "METADATA * GET valid_key1 valid_key2")
|
self.sendLine(1, "METADATA * GET display-name avatar")
|
||||||
m = self.getMessage(1)
|
m = self.getMessage(1)
|
||||||
self.assertMessageMatch(
|
self.assertMessageMatch(
|
||||||
m,
|
m,
|
||||||
@ -62,10 +62,10 @@ class MetadataTestCase(cases.BaseServerTestCase):
|
|||||||
)
|
)
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
m.params[1],
|
m.params[1],
|
||||||
"valid_key1",
|
"display-name",
|
||||||
m,
|
m,
|
||||||
fail_msg="Response to “METADATA * GET valid_key1 valid_key2” "
|
fail_msg="Response to “METADATA * GET display-name avatar” "
|
||||||
"did not respond to valid_key1 first: {msg}",
|
"did not respond to display-name first: {msg}",
|
||||||
)
|
)
|
||||||
m = self.getMessage(1)
|
m = self.getMessage(1)
|
||||||
self.assertMessageMatch(
|
self.assertMessageMatch(
|
||||||
@ -76,10 +76,10 @@ class MetadataTestCase(cases.BaseServerTestCase):
|
|||||||
)
|
)
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
m.params[1],
|
m.params[1],
|
||||||
"valid_key2",
|
"avatar",
|
||||||
m,
|
m,
|
||||||
fail_msg="Response to “METADATA * GET valid_key1 valid_key2” "
|
fail_msg="Response to “METADATA * GET display-name avatar” "
|
||||||
"did not respond to valid_key2 as second response: {msg}",
|
"did not respond to avatar as second response: {msg}",
|
||||||
)
|
)
|
||||||
|
|
||||||
@cases.mark_specifications("IRCv3", deprecated=True)
|
@cases.mark_specifications("IRCv3", deprecated=True)
|
||||||
@ -135,7 +135,7 @@ class MetadataTestCase(cases.BaseServerTestCase):
|
|||||||
)
|
)
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
m.params[1],
|
m.params[1],
|
||||||
"valid_key1",
|
"display-name",
|
||||||
m,
|
m,
|
||||||
fail_msg="Second param of 761 after setting “{expects}” to "
|
fail_msg="Second param of 761 after setting “{expects}” to "
|
||||||
"“{}” is not “{expects}”: {msg}.",
|
"“{}” is not “{expects}”: {msg}.",
|
||||||
@ -190,7 +190,7 @@ class MetadataTestCase(cases.BaseServerTestCase):
|
|||||||
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("*", "display-name", "myvalue")
|
||||||
|
|
||||||
@cases.mark_specifications("IRCv3", deprecated=True)
|
@cases.mark_specifications("IRCv3", deprecated=True)
|
||||||
def testSetGetZeroCharInValue(self):
|
def testSetGetZeroCharInValue(self):
|
||||||
@ -198,7 +198,7 @@ class MetadataTestCase(cases.BaseServerTestCase):
|
|||||||
-- <http://ircv3.net/specs/core/metadata-3.2.html#metadata-restrictions>
|
-- <http://ircv3.net/specs/core/metadata-3.2.html#metadata-restrictions>
|
||||||
"""
|
"""
|
||||||
self.connectClient("foo")
|
self.connectClient("foo")
|
||||||
self.assertSetGetValue("*", "valid_key1", "zero->\0<-zero", "zero->\\0<-zero")
|
self.assertSetGetValue("*", "display-name", "zero->\0<-zero", "zero->\\0<-zero")
|
||||||
|
|
||||||
@cases.mark_specifications("IRCv3", deprecated=True)
|
@cases.mark_specifications("IRCv3", deprecated=True)
|
||||||
def testSetGetHeartInValue(self):
|
def testSetGetHeartInValue(self):
|
||||||
@ -209,7 +209,7 @@ class MetadataTestCase(cases.BaseServerTestCase):
|
|||||||
self.connectClient("foo")
|
self.connectClient("foo")
|
||||||
self.assertSetGetValue(
|
self.assertSetGetValue(
|
||||||
"*",
|
"*",
|
||||||
"valid_key1",
|
"display-name",
|
||||||
"->{}<-".format(heart),
|
"->{}<-".format(heart),
|
||||||
"zero->{}<-zero".format(heart.encode()),
|
"zero->{}<-zero".format(heart.encode()),
|
||||||
)
|
)
|
||||||
@ -223,7 +223,7 @@ class MetadataTestCase(cases.BaseServerTestCase):
|
|||||||
# Sending directly because it is not valid UTF-8 so Python would
|
# Sending directly because it is not valid UTF-8 so Python would
|
||||||
# not like it
|
# not like it
|
||||||
self.clients[1].conn.sendall(
|
self.clients[1].conn.sendall(
|
||||||
b"METADATA * SET valid_key1 " b":invalid UTF-8 ->\xc3<-\r\n"
|
b"METADATA * SET display-name " b":invalid UTF-8 ->\xc3<-\r\n"
|
||||||
)
|
)
|
||||||
commands = {m.command for m in self.getMessages(1)}
|
commands = {m.command for m in self.getMessages(1)}
|
||||||
self.assertNotIn(
|
self.assertNotIn(
|
||||||
@ -233,7 +233,7 @@ class MetadataTestCase(cases.BaseServerTestCase):
|
|||||||
"UTF-8 was answered with 761 (RPL_KEYVALUE)",
|
"UTF-8 was answered with 761 (RPL_KEYVALUE)",
|
||||||
)
|
)
|
||||||
self.clients[1].conn.sendall(
|
self.clients[1].conn.sendall(
|
||||||
b"METADATA * SET valid_key1 " b":invalid UTF-8: \xc3\r\n"
|
b"METADATA * SET display-name " b":invalid UTF-8: \xc3\r\n"
|
||||||
)
|
)
|
||||||
commands = {m.command for m in self.getMessages(1)}
|
commands = {m.command for m in self.getMessages(1)}
|
||||||
self.assertNotIn(
|
self.assertNotIn(
|
||||||
|
Reference in New Issue
Block a user