Improve Renault reauth test (#132077)
parent
e1772d25f2
commit
0a977d070b
|
@ -9,7 +9,7 @@ import pytest
|
|||
from renault_api.gigya.exceptions import GigyaException, InvalidCredentialsException
|
||||
|
||||
from homeassistant.components.renault.const import DOMAIN
|
||||
from homeassistant.config_entries import ConfigEntry, ConfigEntryState
|
||||
from homeassistant.config_entries import SOURCE_REAUTH, ConfigEntry, ConfigEntryState
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers import device_registry as dr
|
||||
from homeassistant.setup import async_setup_component
|
||||
|
@ -62,6 +62,11 @@ async def test_setup_entry_bad_password(
|
|||
assert len(hass.config_entries.async_entries(DOMAIN)) == 1
|
||||
assert config_entry.state is ConfigEntryState.SETUP_ERROR
|
||||
|
||||
flows = hass.config_entries.flow.async_progress()
|
||||
assert len(flows) == 1
|
||||
assert flows[0]["context"]["source"] == SOURCE_REAUTH
|
||||
assert flows[0]["context"]["entry_id"] == config_entry.entry_id
|
||||
|
||||
|
||||
@pytest.mark.parametrize("side_effect", [aiohttp.ClientConnectionError, GigyaException])
|
||||
async def test_setup_entry_exception(
|
||||
|
|
Loading…
Reference in New Issue