-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #130 from theunkn0wn1/fix/123
Handle IRCv3 tag escape sequences
- Loading branch information
Showing
3 changed files
with
53 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters