Update template/test_light.py to use pytest (#56300)
This commit is contained in:
parent
94f06f86cf
commit
70eb519f76
2 changed files with 658 additions and 954 deletions
|
@ -1,4 +1,6 @@
|
|||
"""template conftest."""
|
||||
import json
|
||||
|
||||
import pytest
|
||||
|
||||
from homeassistant.setup import async_setup_component
|
||||
|
@ -13,8 +15,18 @@ def calls(hass):
|
|||
|
||||
|
||||
@pytest.fixture
|
||||
async def start_ha(hass, count, domain, config, caplog):
|
||||
def config_addon():
|
||||
"""Add entra configuration items."""
|
||||
return None
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
async def start_ha(hass, count, domain, config_addon, config, caplog):
|
||||
"""Do setup of integration."""
|
||||
if config_addon:
|
||||
for key, value in config_addon.items():
|
||||
config = config.replace(key, value)
|
||||
config = json.loads(config)
|
||||
with assert_setup_component(count, domain):
|
||||
assert await async_setup_component(
|
||||
hass,
|
||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue