Mock setup in spotify tests (#55515)
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 = {
|
||||
"id": "fake_id",
|
||||
"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"}
|
||||
result = await hass.config_entries.flow.async_configure(result["flow_id"])
|
||||
|
||||
|
|
Loading…
Reference in New Issue