Fix Plex when using local tokenless authentication (#37096)
This commit is contained in:
parent
f42eb0d5ca
commit
fd1a8dd96c
7 changed files with 157 additions and 84 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue