From 04bc522fa5f64a08f9ec10ae18c1337c5dc08e82 Mon Sep 17 00:00:00 2001 From: tronikos Date: Thu, 26 Jan 2023 13:17:23 -0800 Subject: [PATCH] Google Assistant SDK: Test unload when enable_conversation_agent (#86707) Test unload when enable_conversation_agent --- tests/components/google_assistant_sdk/test_init.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/components/google_assistant_sdk/test_init.py b/tests/components/google_assistant_sdk/test_init.py index e01af4cbc57..89368291d51 100644 --- a/tests/components/google_assistant_sdk/test_init.py +++ b/tests/components/google_assistant_sdk/test_init.py @@ -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()