mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 04:07:08 +00:00
Mock setup in spotify tests (#55515)
This commit is contained in:
parent
02b7356596
commit
befcafbc49
@ -93,7 +93,9 @@ async def test_full_flow(
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
with patch("homeassistant.components.spotify.config_flow.Spotify") as spotify_mock:
|
with patch(
|
||||||
|
"homeassistant.components.spotify.async_setup_entry", return_value=True
|
||||||
|
), patch("homeassistant.components.spotify.config_flow.Spotify") as spotify_mock:
|
||||||
spotify_mock.return_value.current_user.return_value = {
|
spotify_mock.return_value.current_user.return_value = {
|
||||||
"id": "fake_id",
|
"id": "fake_id",
|
||||||
"display_name": "frenck",
|
"display_name": "frenck",
|
||||||
@ -210,7 +212,9 @@ async def test_reauthentication(
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
with patch("homeassistant.components.spotify.config_flow.Spotify") as spotify_mock:
|
with patch(
|
||||||
|
"homeassistant.components.spotify.async_setup_entry", return_value=True
|
||||||
|
), patch("homeassistant.components.spotify.config_flow.Spotify") as spotify_mock:
|
||||||
spotify_mock.return_value.current_user.return_value = {"id": "frenck"}
|
spotify_mock.return_value.current_user.return_value = {"id": "frenck"}
|
||||||
result = await hass.config_entries.flow.async_configure(result["flow_id"])
|
result = await hass.config_entries.flow.async_configure(result["flow_id"])
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user