Mock setup_entry in oauth2 tests (#32102)
* Mock setup_entry in oauth2 tests * Fix scaffold constant
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
"""Test the NEW_NAME config flow."""
|
||||
from asynctest import patch
|
||||
|
||||
from homeassistant import config_entries, setup
|
||||
from homeassistant.components.NEW_DOMAIN.const import (
|
||||
DOMAIN,
|
||||
@@ -48,6 +50,10 @@ async def test_full_flow(hass, aiohttp_client, aioclient_mock):
|
||||
},
|
||||
)
|
||||
|
||||
result = await hass.config_entries.flow.async_configure(result["flow_id"])
|
||||
with patch(
|
||||
"homeassistant.components.NEW_DOMAIN.async_setup_entry", return_value=True
|
||||
) as mock_setup:
|
||||
await hass.config_entries.flow.async_configure(result["flow_id"])
|
||||
|
||||
assert len(hass.config_entries.async_entries(DOMAIN)) == 1
|
||||
assert len(mock_setup.mock_calls) == 1
|
||||
|
||||
Reference in New Issue
Block a user