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