client: add set_self_deaf server notification
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user