Files
home-assistant-core/tests/components/html5/test_init.py
T
26281662b5 Enable config flow for html5 (#112806)
* html5: Enable config flow

* Add tests

* attempt check create_issue

* replace len with call_count

* fix config flow tests

* test user config

* more tests

* remove whitespace

* Update homeassistant/components/html5/issues.py

Co-authored-by: Steven B. <[email protected]>

* Update homeassistant/components/html5/issues.py

Co-authored-by: Steven B. <[email protected]>

* fix config

* Adjust issues log

* lint

* lint

* rename create issue

* fix typing

* update codeowners

* fix test

* fix tests

* Update issues.py

* Update tests/components/html5/test_config_flow.py

Co-authored-by: J. Nick Koston <[email protected]>

* Update tests/components/html5/test_config_flow.py

Co-authored-by: J. Nick Koston <[email protected]>

* Update tests/components/html5/test_config_flow.py

Co-authored-by: J. Nick Koston <[email protected]>

* update from review

* remove ternary

* fix

* fix missing service

* fix tests

* updates

* adress review comments

* fix indent

* fix

* fix format

* cleanup from review

* Restore config schema and use HA issue

* Restore config schema and use HA issue

---------

Co-authored-by: alexyao2015 <[email protected]>
Co-authored-by: Steven B. <[email protected]>
Co-authored-by: J. Nick Koston <[email protected]>
Co-authored-by: Joostlek <[email protected]>
2024-08-30 23:22:14 +02:00

45 lines
1.4 KiB
Python

"""Test the HTML5 setup."""
from homeassistant.core import HomeAssistant
import homeassistant.helpers.issue_registry as ir
from homeassistant.setup import async_setup_component
from tests.common import MockConfigEntry
NOTIFY_CONF = {
"notify": [
{
"platform": "html5",
"name": "html5",
"vapid_pub_key": "BIUtPN7Rq_8U7RBEqClZrfZ5dR9zPCfvxYPtLpWtRVZTJEc7lzv2dhzDU6Aw1m29Ao0-UA1Uq6XO9Df8KALBKqA",
"vapid_prv_key": "h6acSRds8_KR8hT9djD8WucTL06Gfe29XXyZ1KcUjN8",
"vapid_email": "[email protected]",
}
]
}
async def test_setup_entry(
hass: HomeAssistant,
issue_registry: ir.IssueRegistry,
) -> None:
"""Test setup of a good config entry."""
config_entry = MockConfigEntry(domain="html5", data={})
config_entry.add_to_hass(hass)
assert await async_setup_component(hass, "html5", {})
assert len(issue_registry.issues) == 0
async def test_setup_entry_issue(
hass: HomeAssistant,
issue_registry: ir.IssueRegistry,
) -> None:
"""Test setup of an imported config entry with deprecated YAML."""
config_entry = MockConfigEntry(domain="html5", data={})
config_entry.add_to_hass(hass)
assert await async_setup_component(hass, "notify", NOTIFY_CONF)
assert await async_setup_component(hass, "html5", NOTIFY_CONF)
assert len(issue_registry.issues) == 1