Use config_entries.SOURCE_* constants (#49631)
This commit is contained in:
@@ -5,7 +5,7 @@ from unittest.mock import patch
|
||||
import pytest
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant import data_entry_flow
|
||||
from homeassistant import config_entries, data_entry_flow
|
||||
from homeassistant.util.decorator import Registry
|
||||
|
||||
from tests.common import async_capture_events
|
||||
@@ -182,7 +182,9 @@ async def test_discovery_init_flow(manager):
|
||||
|
||||
data = {"id": "hello", "token": "secret"}
|
||||
|
||||
await manager.async_init("test", context={"source": "discovery"}, data=data)
|
||||
await manager.async_init(
|
||||
"test", context={"source": config_entries.SOURCE_DISCOVERY}, data=data
|
||||
)
|
||||
assert len(manager.async_progress()) == 0
|
||||
assert len(manager.mock_created_entries) == 1
|
||||
|
||||
@@ -191,7 +193,7 @@ async def test_discovery_init_flow(manager):
|
||||
assert entry["handler"] == "test"
|
||||
assert entry["title"] == "hello"
|
||||
assert entry["data"] == data
|
||||
assert entry["source"] == "discovery"
|
||||
assert entry["source"] == config_entries.SOURCE_DISCOVERY
|
||||
|
||||
|
||||
async def test_finish_callback_change_result_type(hass):
|
||||
|
||||
Reference in New Issue
Block a user