mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Fix missing Plex account mocks in tests (#37591)
This commit is contained in:
parent
16ccf0affd
commit
7128092139
@ -191,10 +191,6 @@ async def test_single_available_server(hass):
|
|||||||
"plexapi.server.PlexServer", return_value=mock_plex_server
|
"plexapi.server.PlexServer", return_value=mock_plex_server
|
||||||
), patch("plexauth.PlexAuth.initiate_auth"), patch(
|
), patch("plexauth.PlexAuth.initiate_auth"), patch(
|
||||||
"plexauth.PlexAuth.token", return_value=MOCK_TOKEN
|
"plexauth.PlexAuth.token", return_value=MOCK_TOKEN
|
||||||
), patch(
|
|
||||||
"homeassistant.components.plex.async_setup_entry", return_value=True
|
|
||||||
), patch(
|
|
||||||
"homeassistant.components.plex.async_setup", return_value=True
|
|
||||||
):
|
):
|
||||||
result = await hass.config_entries.flow.async_configure(
|
result = await hass.config_entries.flow.async_configure(
|
||||||
result["flow_id"], user_input={}
|
result["flow_id"], user_input={}
|
||||||
@ -236,10 +232,6 @@ async def test_multiple_servers_with_selection(hass):
|
|||||||
"plexauth.PlexAuth.initiate_auth"
|
"plexauth.PlexAuth.initiate_auth"
|
||||||
), patch(
|
), patch(
|
||||||
"plexauth.PlexAuth.token", return_value=MOCK_TOKEN
|
"plexauth.PlexAuth.token", return_value=MOCK_TOKEN
|
||||||
), patch(
|
|
||||||
"homeassistant.components.plex.async_setup_entry", return_value=True
|
|
||||||
), patch(
|
|
||||||
"homeassistant.components.plex.async_setup", return_value=True
|
|
||||||
):
|
):
|
||||||
result = await hass.config_entries.flow.async_configure(
|
result = await hass.config_entries.flow.async_configure(
|
||||||
result["flow_id"], user_input={}
|
result["flow_id"], user_input={}
|
||||||
@ -295,10 +287,6 @@ async def test_adding_last_unconfigured_server(hass):
|
|||||||
"plexauth.PlexAuth.initiate_auth"
|
"plexauth.PlexAuth.initiate_auth"
|
||||||
), patch(
|
), patch(
|
||||||
"plexauth.PlexAuth.token", return_value=MOCK_TOKEN
|
"plexauth.PlexAuth.token", return_value=MOCK_TOKEN
|
||||||
), patch(
|
|
||||||
"homeassistant.components.plex.async_setup_entry", return_value=True
|
|
||||||
), patch(
|
|
||||||
"homeassistant.components.plex.async_setup", return_value=True
|
|
||||||
):
|
):
|
||||||
result = await hass.config_entries.flow.async_configure(
|
result = await hass.config_entries.flow.async_configure(
|
||||||
result["flow_id"], user_input={}
|
result["flow_id"], user_input={}
|
||||||
@ -685,11 +673,7 @@ async def test_manual_config(hass):
|
|||||||
|
|
||||||
with patch("plexapi.server.PlexServer", return_value=mock_plex_server), patch(
|
with patch("plexapi.server.PlexServer", return_value=mock_plex_server), patch(
|
||||||
"homeassistant.components.plex.PlexWebsocket", autospec=True
|
"homeassistant.components.plex.PlexWebsocket", autospec=True
|
||||||
), patch(
|
), patch("plexapi.myplex.MyPlexAccount", return_value=MockPlexAccount()):
|
||||||
"homeassistant.components.plex.async_setup_entry", return_value=True
|
|
||||||
), patch(
|
|
||||||
"homeassistant.components.plex.async_setup", return_value=True
|
|
||||||
):
|
|
||||||
result = await hass.config_entries.flow.async_configure(
|
result = await hass.config_entries.flow.async_configure(
|
||||||
result["flow_id"], user_input=MANUAL_SERVER
|
result["flow_id"], user_input=MANUAL_SERVER
|
||||||
)
|
)
|
||||||
@ -723,11 +707,7 @@ async def test_manual_config_with_token(hass):
|
|||||||
|
|
||||||
with patch("plexapi.myplex.MyPlexAccount", return_value=MockPlexAccount()), patch(
|
with patch("plexapi.myplex.MyPlexAccount", return_value=MockPlexAccount()), patch(
|
||||||
"plexapi.server.PlexServer", return_value=mock_plex_server
|
"plexapi.server.PlexServer", return_value=mock_plex_server
|
||||||
), patch("homeassistant.components.plex.PlexWebsocket", autospec=True), patch(
|
), patch("homeassistant.components.plex.PlexWebsocket", autospec=True):
|
||||||
"homeassistant.components.plex.async_setup_entry", return_value=True
|
|
||||||
), patch(
|
|
||||||
"homeassistant.components.plex.async_setup", return_value=True
|
|
||||||
):
|
|
||||||
result = await hass.config_entries.flow.async_configure(
|
result = await hass.config_entries.flow.async_configure(
|
||||||
result["flow_id"], user_input={CONF_TOKEN: MOCK_TOKEN}
|
result["flow_id"], user_input={CONF_TOKEN: MOCK_TOKEN}
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user