mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 12:59:34 +00:00
Google Assistant diagnostics and synchronization (#73574)
* Add config flow import for local google assistant * Add diagnostic with sync response * Add button for device sync
This commit is contained in:
@@ -2,11 +2,47 @@
|
||||
from http import HTTPStatus
|
||||
|
||||
from homeassistant.components import google_assistant as ga
|
||||
from homeassistant.core import Context
|
||||
from homeassistant.core import Context, HomeAssistant
|
||||
from homeassistant.setup import async_setup_component
|
||||
|
||||
from .test_http import DUMMY_CONFIG
|
||||
|
||||
from tests.common import MockConfigEntry
|
||||
|
||||
|
||||
async def test_import(hass: HomeAssistant):
|
||||
"""Test import."""
|
||||
|
||||
await async_setup_component(
|
||||
hass,
|
||||
ga.DOMAIN,
|
||||
{"google_assistant": DUMMY_CONFIG},
|
||||
)
|
||||
|
||||
entries = hass.config_entries.async_entries("google_assistant")
|
||||
assert len(entries) == 1
|
||||
assert entries[0].data[ga.const.CONF_PROJECT_ID] == "1234"
|
||||
|
||||
|
||||
async def test_import_changed(hass: HomeAssistant):
|
||||
"""Test import with changed project id."""
|
||||
|
||||
old_entry = MockConfigEntry(
|
||||
domain=ga.DOMAIN, data={ga.const.CONF_PROJECT_ID: "4321"}, source="import"
|
||||
)
|
||||
old_entry.add_to_hass(hass)
|
||||
|
||||
await async_setup_component(
|
||||
hass,
|
||||
ga.DOMAIN,
|
||||
{"google_assistant": DUMMY_CONFIG},
|
||||
)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
entries = hass.config_entries.async_entries("google_assistant")
|
||||
assert len(entries) == 1
|
||||
assert entries[0].data[ga.const.CONF_PROJECT_ID] == "1234"
|
||||
|
||||
|
||||
async def test_request_sync_service(aioclient_mock, hass):
|
||||
"""Test that it posts to the request_sync url."""
|
||||
|
||||
Reference in New Issue
Block a user