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
|
@ -367,8 +367,8 @@ async def test_option_flow(hass):
|
|||
)
|
||||
|
||||
with patch("plexapi.server.PlexServer", return_value=mock_plex_server), patch(
|
||||
"homeassistant.components.plex.PlexWebsocket.listen"
|
||||
) as mock_listen:
|
||||
"plexapi.myplex.MyPlexAccount", return_value=MockPlexAccount()
|
||||
), patch("homeassistant.components.plex.PlexWebsocket.listen") as mock_listen:
|
||||
entry.add_to_hass(hass)
|
||||
assert await hass.config_entries.async_setup(entry.entry_id)
|
||||
await hass.async_block_till_done()
|
||||
|
@ -417,8 +417,8 @@ async def test_missing_option_flow(hass):
|
|||
)
|
||||
|
||||
with patch("plexapi.server.PlexServer", return_value=mock_plex_server), patch(
|
||||
"homeassistant.components.plex.PlexWebsocket.listen"
|
||||
) as mock_listen:
|
||||
"plexapi.myplex.MyPlexAccount", return_value=MockPlexAccount()
|
||||
), patch("homeassistant.components.plex.PlexWebsocket.listen") as mock_listen:
|
||||
entry.add_to_hass(hass)
|
||||
assert await hass.config_entries.async_setup(entry.entry_id)
|
||||
await hass.async_block_till_done()
|
||||
|
@ -471,8 +471,8 @@ async def test_option_flow_new_users_available(hass, caplog):
|
|||
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()
|
||||
|
@ -741,6 +741,8 @@ async def test_setup_with_limited_credentials(hass):
|
|||
), patch.object(
|
||||
mock_plex_server, "systemAccounts", side_effect=plexapi.exceptions.Unauthorized
|
||||
) as mock_accounts, patch(
|
||||
"plexapi.myplex.MyPlexAccount", return_value=MockPlexAccount()
|
||||
), patch(
|
||||
"homeassistant.components.plex.PlexWebsocket.listen"
|
||||
) as mock_listen:
|
||||
entry.add_to_hass(hass)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue