Skip to content

Commit

Permalink
added discovery test
Browse files Browse the repository at this point in the history
  • Loading branch information
petretiandrea committed Mar 4, 2024
1 parent dfc45e4 commit a728020
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/test_config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@
from homeassistant.data_entry_flow import FlowResultType
from plugp100.discovery.discovered_device import DiscoveredDevice

from custom_components.tapo.const import STEP_DISCOVERY_REQUIRE_AUTH
from .conftest import IP_ADDRESS
from .conftest import MAC_ADDRESS


async def test_discovery_auth(
hass: HomeAssistant, mock_discovery: DiscoveredDevice
) -> None:
"""Test authenticated discovery."""
"""Test step required authentication on discovery."""
result = await hass.config_entries.flow.async_init(
DOMAIN,
context={
Expand All @@ -35,7 +36,7 @@ async def test_discovery_auth(
)
await hass.async_block_till_done()
assert result["type"] == "form"
assert result["step_id"] == "discovery_auth_confirm"
assert result["step_id"] == STEP_DISCOVERY_REQUIRE_AUTH

auth_result = await hass.config_entries.flow.async_configure(
result["flow_id"],
Expand All @@ -52,4 +53,4 @@ async def test_discovery_auth(
assert auth_result["data"][CONF_HOST] == mock_discovery.ip
assert auth_result["data"][CONF_TRACK_DEVICE] is False
assert auth_result["data"][CONF_SCAN_INTERVAL] == 30
assert auth_result["context"][CONF_DISCOVERED_DEVICE_INFO] == mock_discovery
assert auth_result["context"][CONF_DISCOVERED_DEVICE_INFO] == mock_discovery

0 comments on commit a728020

Please sign in to comment.