test(init): tests/test_init.py lands — domain async_setup units + YAML seed parsing/normalization, flow-init seeding records, hostless drop, duplicate guards (UI host + virtual unique_id) and single-visit interactive routing; scoped stub hygiene mirrors scoped_stubs (t30 G6/U1)

This commit is contained in:
James Mackay committed 2026-10-09 07:34:57 +01:00
1 parent 297f8a21a7
commit 80ddff313a
2 files changed
+247

No files matched your search

+7
View File
@@ -113,6 +113,12 @@ def install() -> None:
"""Register the stub modules (idempotent)."""
if "homeassistant.components.media_player" in sys.modules:
return
# honor per-file flow stub versions already in place (e.g. the
# config-flow/pairing/protocol files) — the hub's base would strip the
# base plumbing the flow tests already installed (t30 leak).
ce = sys.modules.get("homeassistant.config_entries")
if ce is not None and hasattr(ce, "OptionsFlowWithReload"):
return
vol = types.ModuleType("voluptuous")
vol.Required = lambda key, default=None: key
@@ -191,6 +197,7 @@ def install() -> None:
return {"type": "create_entry", "title": title, "data": data}
config_entries.OptionsFlow = _OptionsFlowStub
config_entries.SOURCE_IMPORT = "import"
config_entries.OptionsFlowWithReload = _OptionsFlowWithReload
sys.modules["homeassistant.config_entries"] = config_entries