1
0
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:
jjlawren
2020-06-27 04:03:51 -04:00
committed by GitHub
parent e48bcd2070
commit ec13eecc59
4 changed files with 50 additions and 41 deletions

View File

@@ -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()