Update Plex tests to mock websockets (#37147)
* Update Plex tests to mock websockets * Avoid unnecessary class mock
This commit is contained in:
1 parent
e48bcd2070
commit
ec13eecc59
4 files changed
+50
-41
No files matched your search
@@ -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