Add type hints to integration tests (j-m) (#87704)

This commit is contained in:
epenet 2023-02-08 19:06:59 +01:00 committed by GitHub
parent 630028106a
commit f75ac17554
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
103 changed files with 605 additions and 417 deletions

View file

@ -7,6 +7,7 @@ from pyjuicenet import TokenError
from homeassistant import config_entries
from homeassistant.components.juicenet.const import DOMAIN
from homeassistant.const import CONF_ACCESS_TOKEN
from homeassistant.core import HomeAssistant
def _mock_juicenet_return_value(get_devices=None):
@ -15,7 +16,7 @@ def _mock_juicenet_return_value(get_devices=None):
return juicenet_mock
async def test_form(hass):
async def test_form(hass: HomeAssistant) -> None:
"""Test we get the form."""
result = await hass.config_entries.flow.async_init(
@ -44,7 +45,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}
@ -62,7 +63,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}
@ -80,7 +81,7 @@ async def test_form_cannot_connect(hass):
assert result2["errors"] == {"base": "cannot_connect"}
async def test_form_catch_unknown_errors(hass):
async def test_form_catch_unknown_errors(hass: HomeAssistant) -> None:
"""Test we handle cannot connect error."""
result = await hass.config_entries.flow.async_init(
DOMAIN, context={"source": config_entries.SOURCE_USER}
@ -98,7 +99,7 @@ async def test_form_catch_unknown_errors(hass):
assert result2["errors"] == {"base": "unknown"}
async def test_import(hass):
async def test_import(hass: HomeAssistant) -> None:
"""Test that import works as expected."""
with patch(