From befcafbc49aeed56a3928b210f80d8b8160df81f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20S=C3=B8rensen?= Date: Wed, 1 Sep 2021 11:27:21 +0200 Subject: [PATCH] Mock setup in spotify tests (#55515) --- tests/components/spotify/test_config_flow.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/components/spotify/test_config_flow.py b/tests/components/spotify/test_config_flow.py index cd0be3f7cc8..fbc5bde9e58 100644 --- a/tests/components/spotify/test_config_flow.py +++ b/tests/components/spotify/test_config_flow.py @@ -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"])