pydle/tests/test_ircv3.py

25 lines
610 B
Python
Raw Normal View History

import pytest
from pydle.features import ircv3
2019-12-23 00:21:52 +00:00
pytestmark = pytest.mark.unit
@pytest.mark.parametrize(
"payload, expected",
[
(
rb"@+example=raw+:=,escaped\:\s\\ :irc.example.com NOTICE #channel :Message",
{"+example": """raw+:=,escaped; \\"""}
),
(
2019-12-23 00:21:52 +00:00
rb"@+example=\foo\bar :irc.example.com NOTICE #channel :Message",
{"+example": "foobar"}
),
]
)
def test_tagged_message_escape_sequences(payload, expected):
message = ircv3.tags.TaggedMessage.parse(payload)
assert message.tags == expected