Google Assistant SDK: Test unload when enable_conversation_agent (#86707)

Test unload when enable_conversation_agent
pull/86758/head
tronikos 2023-01-26 13:17:23 -08:00 committed by GitHub
parent caa1ba7e13
commit 04bc522fa5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 1 deletions

View File

@ -27,8 +27,13 @@ async def fetch_api_url(hass_client, url):
return response.status, contents
@pytest.mark.parametrize(
"enable_conversation_agent", [False, True], ids=["", "enable_conversation_agent"]
)
async def test_setup_success(
hass: HomeAssistant, setup_integration: ComponentSetup
hass: HomeAssistant,
setup_integration: ComponentSetup,
enable_conversation_agent: bool,
) -> None:
"""Test successful setup and unload."""
await setup_integration()
@ -37,6 +42,12 @@ async def test_setup_success(
assert len(entries) == 1
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.async_block_till_done()