mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 12:59:34 +00:00
Update Plex tests to mock websockets (#37147)
* Update Plex tests to mock websockets * Avoid unnecessary class mock
This commit is contained in:
@@ -1,9 +1,7 @@
|
||||
"""Helper methods for Plex tests."""
|
||||
from homeassistant.components.plex.const import DOMAIN, WEBSOCKETS
|
||||
|
||||
|
||||
def trigger_plex_update(hass, plex_server):
|
||||
def trigger_plex_update(mock_websocket):
|
||||
"""Call the websocket callback method."""
|
||||
server_id = plex_server.machineIdentifier
|
||||
websocket = hass.data[DOMAIN][WEBSOCKETS][server_id]
|
||||
websocket.callback()
|
||||
callback = mock_websocket.call_args[0][1]
|
||||
callback()
|
||||
|
||||
Reference in New Issue
Block a user