client: add set_self_deaf server notification

This commit is contained in:
Username
2026-02-24 13:02:09 +01:00
parent 3bbe8a96f3
commit a6bdc02484
2 changed files with 36 additions and 0 deletions

View File

@@ -1,5 +1,7 @@
"""Tests for MumbleClient dispatcher and callback wiring."""
from unittest.mock import MagicMock
from tuimble.client import MumbleClient
@@ -39,3 +41,29 @@ def test_dispatch_skips_none_callback():
client = MumbleClient(host="localhost")
# Should not raise
client._dispatch(None)
def test_set_self_deaf_calls_pymumble():
client = MumbleClient(host="localhost")
client._connected = True
myself = MagicMock()
users = MagicMock()
users.myself = myself
mumble = MagicMock()
mumble.users = users
client._mumble = mumble
client.set_self_deaf(True)
myself.deafen.assert_called_once()
myself.undeafen.assert_not_called()
myself.reset_mock()
client.set_self_deaf(False)
myself.undeafen.assert_called_once()
myself.deafen.assert_not_called()
def test_set_self_deaf_noop_when_disconnected():
client = MumbleClient(host="localhost")
# Should not raise when not connected
client.set_self_deaf(True)