File: test_ircv3.py

package info (click to toggle)
pydle 0.9.4-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 456 kB
  • sloc: python: 3,037; makefile: 3
file content (24 lines) | stat: -rw-r--r-- 610 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import pytest

from pydle.features import ircv3

pytestmark = pytest.mark.unit


@pytest.mark.parametrize(
    "payload, expected",
    [
        (
                rb"@+example=raw+:=,escaped\:\s\\ :irc.example.com NOTICE #channel :Message",
                {"+example": """raw+:=,escaped; \\"""}
        ),
        (
                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