test(ariadne): cover comms protocol helpers
This commit is contained in:
parent
8f349e88b2
commit
f9910c4281
13
tests/unit/services/test_comms_protocol.py
Normal file
13
tests/unit/services/test_comms_protocol.py
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from ariadne.services import comms_protocol as protocol
|
||||||
|
|
||||||
|
|
||||||
|
def test_canon_user_preserves_and_normalizes_matrix_ids() -> None:
|
||||||
|
assert protocol._canon_user("@alice:matrix.example", "matrix.example") == "@alice:matrix.example"
|
||||||
|
assert protocol._canon_user("alice:matrix.example", "matrix.example") == "@alice:matrix.example"
|
||||||
|
assert protocol._canon_user("alice", "matrix.example") == "@alice:matrix.example"
|
||||||
|
|
||||||
|
|
||||||
|
def test_display_rename_required_for_missing_names() -> None:
|
||||||
|
assert protocol._needs_rename_display(None) is True
|
||||||
Loading…
x
Reference in New Issue
Block a user