Fix Plex when using local tokenless authentication (#37096)

This commit is contained in:
jjlawren authored and GitHub committed 2020-06-25 17:10:40 -07:00
1 parent f42eb0d5ca
commit fd1a8dd96c
7 files changed
+157 -84

No files matched your search

+2 -6
View File
@@ -28,8 +28,8 @@ async def test_sonos_playback(hass):
mock_plex_server = MockPlexServer(config_entry=entry)
with patch("plexapi.server.PlexServer", return_value=mock_plex_server), patch(
"homeassistant.components.plex.PlexWebsocket.listen"
):
"plexapi.myplex.MyPlexAccount", return_value=MockPlexAccount()
), patch("homeassistant.components.plex.PlexWebsocket.listen"):
entry.add_to_hass(hass)
assert await hass.config_entries.async_setup(entry.entry_id)
await hass.async_block_till_done()
@@ -37,10 +37,6 @@ async def test_sonos_playback(hass):
server_id = mock_plex_server.machineIdentifier
loaded_server = hass.data[DOMAIN][SERVERS][server_id]
with patch("plexapi.myplex.MyPlexAccount", return_value=MockPlexAccount()):
# Access and cache PlexAccount
assert loaded_server.account
# Test Sonos integration lookup failure
with patch.object(
hass.components.sonos, "get_coordinator_id", side_effect=HomeAssistantError