-
-
Notifications
You must be signed in to change notification settings - Fork 403
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 #2312 from sopel-irc/graceful-userhost-in-names
coretasks: gracefully handle missing hostmask with userhost-in-names
- Loading branch information
Showing
2 changed files
with
29 additions
and
4 deletions.
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 |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
from __future__ import annotations | ||
|
||
from datetime import datetime, timezone | ||
import logging | ||
|
||
import pytest | ||
|
||
|
@@ -558,3 +559,18 @@ def test_join_time(mockbot): | |
assert mockbot.channels["#test"].join_time == datetime( | ||
2021, 1, 1, 12, 0, 0, 15000, tzinfo=timezone.utc | ||
) | ||
|
||
|
||
def test_handle_rpl_namreply_with_malformed_uhnames(mockbot, caplog): | ||
"""Make sure Sopel can cope with expected but missing hostmask in 353""" | ||
caplog.set_level(logging.DEBUG) | ||
mockbot.on_message( | ||
':somenet.behind.znc 005 Sopel ' | ||
'UHNAMES ' | ||
':are supported by this server') | ||
mockbot.on_message( | ||
':somenet.behind.znc 353 Sopel = #sopel ' | ||
':[email protected] incorrect') | ||
|
||
assert len(caplog.messages) == 1 | ||
assert 'RPL_NAMREPLY item without a hostmask' in caplog.messages[0] |