Fix Plex when using local tokenless authentication (#37096)

This commit is contained in:
jjlawren 2020-06-25 20:10:40 -04:00 committed by GitHub
parent f42eb0d5ca
commit fd1a8dd96c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 157 additions and 84 deletions

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