fix: some minor fixes
Signed-off-by: Rafal Zielinski <sq4ind@gmail.com>
This commit is contained in:
@@ -13,6 +13,7 @@ from custom_components.adguard_control_hub.config_flow import (
|
||||
from custom_components.adguard_control_hub.const import CONF_SSL, CONF_VERIFY_SSL, DOMAIN
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_form(hass: HomeAssistant) -> None:
|
||||
"""Test we get the form."""
|
||||
result = await hass.config_entries.flow.async_init(
|
||||
@@ -22,6 +23,7 @@ async def test_form(hass: HomeAssistant) -> None:
|
||||
assert result["errors"] is None
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_form_valid_connection(hass: HomeAssistant, mock_adguard_api) -> None:
|
||||
"""Test we get the form with valid connection."""
|
||||
with patch(
|
||||
@@ -58,6 +60,7 @@ async def test_form_valid_connection(hass: HomeAssistant, mock_adguard_api) -> N
|
||||
}
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_form_cannot_connect(hass: HomeAssistant) -> None:
|
||||
"""Test we handle cannot connect error."""
|
||||
with patch(
|
||||
@@ -80,6 +83,7 @@ async def test_form_cannot_connect(hass: HomeAssistant) -> None:
|
||||
assert result2["errors"] == {"base": "cannot_connect"}
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_form_invalid_auth(hass: HomeAssistant) -> None:
|
||||
"""Test we handle invalid auth error."""
|
||||
with patch(
|
||||
|
||||
Reference in New Issue
Block a user