Use config_entries.SOURCE_* constants (#49631)

This commit is contained in:
Ville Skyttä
2021-04-25 12:27:40 +03:00
committed by GitHub
parent 34a588d1ba
commit 153d6e891e
103 changed files with 723 additions and 488 deletions

View File

@@ -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):