Mock setup in spotify tests (#55515)

pull/53339/head
Joakim Sørensen 2021-09-01 11:27:21 +02:00 committed by GitHub
parent 02b7356596
commit befcafbc49
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -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"])