Extend typing on scaffold templates (#48232)
This commit is contained in:
parent
3bc6497cbd
commit
d2d78d6205
13 changed files with 85 additions and 44 deletions
|
@ -4,9 +4,10 @@ from unittest.mock import patch
|
|||
from homeassistant import config_entries, setup
|
||||
from homeassistant.components.NEW_DOMAIN.config_flow import CannotConnect, InvalidAuth
|
||||
from homeassistant.components.NEW_DOMAIN.const import DOMAIN
|
||||
from homeassistant.core import HomeAssistant
|
||||
|
||||
|
||||
async def test_form(hass):
|
||||
async def test_form(hass: HomeAssistant) -> None:
|
||||
"""Test we get the form."""
|
||||
await setup.async_setup_component(hass, "persistent_notification", {})
|
||||
result = await hass.config_entries.flow.async_init(
|
||||
|
@ -45,7 +46,7 @@ async def test_form(hass):
|
|||
assert len(mock_setup_entry.mock_calls) == 1
|
||||
|
||||
|
||||
async def test_form_invalid_auth(hass):
|
||||
async def test_form_invalid_auth(hass: HomeAssistant) -> None:
|
||||
"""Test we handle invalid auth."""
|
||||
result = await hass.config_entries.flow.async_init(
|
||||
DOMAIN, context={"source": config_entries.SOURCE_USER}
|
||||
|
@ -68,7 +69,7 @@ async def test_form_invalid_auth(hass):
|
|||
assert result2["errors"] == {"base": "invalid_auth"}
|
||||
|
||||
|
||||
async def test_form_cannot_connect(hass):
|
||||
async def test_form_cannot_connect(hass: HomeAssistant) -> None:
|
||||
"""Test we handle cannot connect error."""
|
||||
result = await hass.config_entries.flow.async_init(
|
||||
DOMAIN, context={"source": config_entries.SOURCE_USER}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue