Google Assistant SDK: Test unload when enable_conversation_agent (#86707)
Test unload when enable_conversation_agent
This commit is contained in:
parent
caa1ba7e13
commit
04bc522fa5
1 changed files with 12 additions and 1 deletions
|
@ -27,8 +27,13 @@ async def fetch_api_url(hass_client, url):
|
||||||
return response.status, contents
|
return response.status, contents
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.parametrize(
|
||||||
|
"enable_conversation_agent", [False, True], ids=["", "enable_conversation_agent"]
|
||||||
|
)
|
||||||
async def test_setup_success(
|
async def test_setup_success(
|
||||||
hass: HomeAssistant, setup_integration: ComponentSetup
|
hass: HomeAssistant,
|
||||||
|
setup_integration: ComponentSetup,
|
||||||
|
enable_conversation_agent: bool,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Test successful setup and unload."""
|
"""Test successful setup and unload."""
|
||||||
await setup_integration()
|
await setup_integration()
|
||||||
|
@ -37,6 +42,12 @@ async def test_setup_success(
|
||||||
assert len(entries) == 1
|
assert len(entries) == 1
|
||||||
assert entries[0].state is ConfigEntryState.LOADED
|
assert entries[0].state is ConfigEntryState.LOADED
|
||||||
|
|
||||||
|
if enable_conversation_agent:
|
||||||
|
hass.config_entries.async_update_entry(
|
||||||
|
entries[0], options={"enable_conversation_agent": True}
|
||||||
|
)
|
||||||
|
await hass.async_block_till_done()
|
||||||
|
|
||||||
await hass.config_entries.async_unload(entries[0].entry_id)
|
await hass.config_entries.async_unload(entries[0].entry_id)
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue