diff --git a/script/scaffold/templates/config_flow/tests/test_config_flow.py b/script/scaffold/templates/config_flow/tests/test_config_flow.py index 7cd09ad1f42f1ae451c4cb077eb296876d7c0d77..a69bea2abd844ea84c897d8c34b2b70512e4e09a 100644 --- a/script/scaffold/templates/config_flow/tests/test_config_flow.py +++ b/script/scaffold/templates/config_flow/tests/test_config_flow.py @@ -32,6 +32,7 @@ async def test_form(hass): "password": "test-password", }, ) + await hass.async_block_till_done() assert result2["type"] == "create_entry" assert result2["title"] == "Name of the device" @@ -40,7 +41,6 @@ async def test_form(hass): "username": "test-username", "password": "test-password", } - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 diff --git a/tests/components/alarmdecoder/test_config_flow.py b/tests/components/alarmdecoder/test_config_flow.py index 4af8b783b07fdd03f5bc9023e7e7897c44de42a7..b858671fb54423a193055b2349ab41af9c253aa8 100644 --- a/tests/components/alarmdecoder/test_config_flow.py +++ b/tests/components/alarmdecoder/test_config_flow.py @@ -89,8 +89,8 @@ async def test_setups(hass: HomeAssistant, protocol, connection, title): **connection, CONF_PROTOCOL: protocol, } + await hass.async_block_till_done() - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 diff --git a/tests/components/august/test_config_flow.py b/tests/components/august/test_config_flow.py index 1c23976a6f9769277e60615bcfcc46f424a9c2d9..0f9a8ebbd2fa3ffc5cd444bcd634480c72150df2 100644 --- a/tests/components/august/test_config_flow.py +++ b/tests/components/august/test_config_flow.py @@ -46,6 +46,7 @@ async def test_form(hass): CONF_PASSWORD: "test-password", }, ) + await hass.async_block_till_done() assert result2["type"] == "create_entry" assert result2["title"] == "my@email.tld" @@ -57,7 +58,6 @@ async def test_form(hass): CONF_TIMEOUT: 10, CONF_ACCESS_TOKEN_CACHE_FILE: ".my@email.tld.august.conf", } - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 @@ -205,6 +205,7 @@ async def test_form_needs_validate(hass): result["flow_id"], {VERIFICATION_CODE_KEY: "correct"}, ) + await hass.async_block_till_done() assert len(mock_send_verification_code.mock_calls) == 0 assert len(mock_validate_verification_code.mock_calls) == 1 @@ -218,7 +219,6 @@ async def test_form_needs_validate(hass): CONF_TIMEOUT: 10, CONF_ACCESS_TOKEN_CACHE_FILE: ".my@email.tld.august.conf", } - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 @@ -261,9 +261,9 @@ async def test_form_reauth(hass): CONF_PASSWORD: "new-test-password", }, ) + await hass.async_block_till_done() assert result2["type"] == "abort" assert result2["reason"] == "reauth_successful" - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 diff --git a/tests/components/blink/test_config_flow.py b/tests/components/blink/test_config_flow.py index 72a4a5272edc9d5afac61b40cbaa9c1d1fcb5a3f..36e3fbd95ea791d2f8ca015b95418b81cd450e97 100644 --- a/tests/components/blink/test_config_flow.py +++ b/tests/components/blink/test_config_flow.py @@ -31,6 +31,7 @@ async def test_form(hass): result["flow_id"], {"username": "blink@example.com", "password": "example"}, ) + await hass.async_block_till_done() assert result2["type"] == "create_entry" assert result2["title"] == "blink" @@ -45,7 +46,6 @@ async def test_form(hass): "client_id": None, "region_id": None, } - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 @@ -88,11 +88,11 @@ async def test_form_2fa(hass): result3 = await hass.config_entries.flow.async_configure( result2["flow_id"], {"pin": "1234"} ) + await hass.async_block_till_done() assert result3["type"] == "create_entry" assert result3["title"] == "blink" assert result3["result"].unique_id == "blink@example.com" - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 diff --git a/tests/components/bond/test_config_flow.py b/tests/components/bond/test_config_flow.py index cd98dd8090afa777e40e924b4c39e00933da0c17..b87891a18962f01e2eb26527f7a605e0be610efb 100644 --- a/tests/components/bond/test_config_flow.py +++ b/tests/components/bond/test_config_flow.py @@ -29,6 +29,7 @@ async def test_user_form(hass: core.HomeAssistant): result["flow_id"], {CONF_HOST: "some host", CONF_ACCESS_TOKEN: "test-token"}, ) + await hass.async_block_till_done() assert result2["type"] == "create_entry" assert result2["title"] == "test-bond-id" @@ -36,7 +37,6 @@ async def test_user_form(hass: core.HomeAssistant): CONF_HOST: "some host", CONF_ACCESS_TOKEN: "test-token", } - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 @@ -165,6 +165,7 @@ async def test_zeroconf_form(hass: core.HomeAssistant): result["flow_id"], {CONF_ACCESS_TOKEN: "test-token"}, ) + await hass.async_block_till_done() assert result2["type"] == "create_entry" assert result2["title"] == "test-bond-id" @@ -172,7 +173,6 @@ async def test_zeroconf_form(hass: core.HomeAssistant): CONF_HOST: "test-host", CONF_ACCESS_TOKEN: "test-token", } - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 diff --git a/tests/components/control4/test_config_flow.py b/tests/components/control4/test_config_flow.py index f87c5af34845c461e18ac10f8e07720a5ca0edb0..8c68039920d07b00cc5b1c7fd9c97ab9ea1fd31e 100644 --- a/tests/components/control4/test_config_flow.py +++ b/tests/components/control4/test_config_flow.py @@ -75,6 +75,7 @@ async def test_form(hass): CONF_PASSWORD: "test-password", }, ) + await hass.async_block_till_done() assert result2["type"] == "create_entry" assert result2["title"] == "control4_model_00AA00AA00AA" @@ -84,7 +85,6 @@ async def test_form(hass): CONF_PASSWORD: "test-password", "controller_unique_id": "control4_model_00AA00AA00AA", } - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 diff --git a/tests/components/coolmaster/test_config_flow.py b/tests/components/coolmaster/test_config_flow.py index b758a37db1d16aa6b51104a4335968eedc8aa278..27e44949585df7bf5470213a192ebfe4474e8579 100644 --- a/tests/components/coolmaster/test_config_flow.py +++ b/tests/components/coolmaster/test_config_flow.py @@ -32,6 +32,7 @@ async def test_form(hass): result2 = await hass.config_entries.flow.async_configure( result["flow_id"], _flow_data() ) + await hass.async_block_till_done() assert result2["type"] == "create_entry" assert result2["title"] == "1.1.1.1" @@ -40,7 +41,6 @@ async def test_form(hass): "port": 10102, "supported_modes": AVAILABLE_MODES, } - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 diff --git a/tests/components/devolo_home_control/test_config_flow.py b/tests/components/devolo_home_control/test_config_flow.py index 89e87c78c64303ab255336d9ee368ebf725def25..25d42a266dc61bc6c496910f4062d2573e278fc3 100644 --- a/tests/components/devolo_home_control/test_config_flow.py +++ b/tests/components/devolo_home_control/test_config_flow.py @@ -33,6 +33,7 @@ async def test_form(hass): result["flow_id"], {"username": "test-username", "password": "test-password"}, ) + await hass.async_block_till_done() assert result2["type"] == "create_entry" assert result2["title"] == "devolo Home Control" @@ -43,7 +44,6 @@ async def test_form(hass): "mydevolo_url": "https://www.mydevolo.com", } - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 @@ -118,6 +118,7 @@ async def test_form_advanced_options(hass): "mydevolo_url": "https://test_mydevolo_url.test", }, ) + await hass.async_block_till_done() assert result2["type"] == "create_entry" assert result2["title"] == "devolo Home Control" @@ -128,6 +129,5 @@ async def test_form_advanced_options(hass): "mydevolo_url": "https://test_mydevolo_url.test", } - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 diff --git a/tests/components/dexcom/test_config_flow.py b/tests/components/dexcom/test_config_flow.py index 6f6d8abe8f9309c710d54a70bc4d2d938d43040d..c79e7ca0075e58fc260eacafa2989919f042dd91 100644 --- a/tests/components/dexcom/test_config_flow.py +++ b/tests/components/dexcom/test_config_flow.py @@ -32,11 +32,11 @@ async def test_form(hass): result["flow_id"], CONFIG, ) + await hass.async_block_till_done() assert result2["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY assert result2["title"] == CONFIG[CONF_USERNAME] assert result2["data"] == CONFIG - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 diff --git a/tests/components/doorbird/test_config_flow.py b/tests/components/doorbird/test_config_flow.py index f8a01899bd5abea7d8dbedbb21f3097c188cc516..c52388b886c814c832ded19985aefd8181db0429 100644 --- a/tests/components/doorbird/test_config_flow.py +++ b/tests/components/doorbird/test_config_flow.py @@ -62,6 +62,7 @@ async def test_user_form(hass): result["flow_id"], VALID_CONFIG, ) + await hass.async_block_till_done() assert result2["type"] == "create_entry" assert result2["title"] == "1.2.3.4" @@ -71,7 +72,6 @@ async def test_user_form(hass): "password": "password", "username": "friend", } - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 @@ -108,6 +108,7 @@ async def test_form_import(hass): context={"source": config_entries.SOURCE_IMPORT}, data=import_config, ) + await hass.async_block_till_done() assert result["type"] == "create_entry" assert result["title"] == "1.2.3.4" @@ -124,7 +125,6 @@ async def test_form_import(hass): # It is not possible to import options at this time # so they end up in the config entry data and are # used a fallback when they are not in options - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 @@ -176,6 +176,7 @@ async def test_form_import_with_zeroconf_already_discovered(hass): context={"source": config_entries.SOURCE_IMPORT}, data=import_config, ) + await hass.async_block_till_done() assert result["type"] == "create_entry" assert result["title"] == "1.2.3.4" @@ -192,7 +193,6 @@ async def test_form_import_with_zeroconf_already_discovered(hass): # It is not possible to import options at this time # so they end up in the config entry data and are # used a fallback when they are not in options - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 @@ -274,6 +274,7 @@ async def test_form_zeroconf_correct_oui(hass): result2 = await hass.config_entries.flow.async_configure( result["flow_id"], VALID_CONFIG ) + await hass.async_block_till_done() assert result2["type"] == "create_entry" assert result2["title"] == "1.2.3.4" @@ -283,7 +284,6 @@ async def test_form_zeroconf_correct_oui(hass): "password": "password", "username": "friend", } - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 diff --git a/tests/components/elkm1/test_config_flow.py b/tests/components/elkm1/test_config_flow.py index 0a959cf1b97f86de9626d7b489389bc7cf93ad6a..ba58d8cb68cab4ee235b27e790109f9aba85046d 100644 --- a/tests/components/elkm1/test_config_flow.py +++ b/tests/components/elkm1/test_config_flow.py @@ -45,6 +45,7 @@ async def test_form_user_with_secure_elk(hass): "prefix": "", }, ) + await hass.async_block_till_done() assert result2["type"] == "create_entry" assert result2["title"] == "ElkM1" @@ -56,7 +57,6 @@ async def test_form_user_with_secure_elk(hass): "temperature_unit": "°F", "username": "test-username", } - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 @@ -90,6 +90,7 @@ async def test_form_user_with_non_secure_elk(hass): "prefix": "guest_house", }, ) + await hass.async_block_till_done() assert result2["type"] == "create_entry" assert result2["title"] == "guest_house" @@ -101,7 +102,6 @@ async def test_form_user_with_non_secure_elk(hass): "password": "", "temperature_unit": "°F", } - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 @@ -135,6 +135,7 @@ async def test_form_user_with_serial_elk(hass): "prefix": "", }, ) + await hass.async_block_till_done() assert result2["type"] == "create_entry" assert result2["title"] == "ElkM1" @@ -146,7 +147,6 @@ async def test_form_user_with_serial_elk(hass): "password": "", "temperature_unit": "°C", } - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 @@ -253,6 +253,7 @@ async def test_form_import(hass): }, }, ) + await hass.async_block_till_done() assert result["type"] == "create_entry" assert result["title"] == "ohana" @@ -274,6 +275,5 @@ async def test_form_import(hass): "username": "friend", "zone": {"enabled": True, "exclude": [[15, 15], [28, 208]], "include": []}, } - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 diff --git a/tests/components/flick_electric/test_config_flow.py b/tests/components/flick_electric/test_config_flow.py index c8fe62987646a05db5a7e96bbb4be6d7caf5faee..f18daed875f034cfba1141ed0f32be8e54292a03 100644 --- a/tests/components/flick_electric/test_config_flow.py +++ b/tests/components/flick_electric/test_config_flow.py @@ -43,11 +43,11 @@ async def test_form(hass): result["flow_id"], CONF, ) + await hass.async_block_till_done() assert result2["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY assert result2["title"] == "Flick Electric: test-username" assert result2["data"] == CONF - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 diff --git a/tests/components/flume/test_config_flow.py b/tests/components/flume/test_config_flow.py index bf95700c2de9c1089dcc38959ff349136cacd96f..0afea0a97429032e4fee98a4501f8936782b3887 100644 --- a/tests/components/flume/test_config_flow.py +++ b/tests/components/flume/test_config_flow.py @@ -51,6 +51,7 @@ async def test_form(hass): CONF_CLIENT_SECRET: "client_secret", }, ) + await hass.async_block_till_done() assert result2["type"] == "create_entry" assert result2["title"] == "test-username" @@ -60,7 +61,6 @@ async def test_form(hass): CONF_CLIENT_ID: "client_id", CONF_CLIENT_SECRET: "client_secret", } - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 @@ -92,6 +92,7 @@ async def test_form_import(hass): CONF_CLIENT_SECRET: "client_secret", }, ) + await hass.async_block_till_done() assert result["type"] == "create_entry" assert result["title"] == "test-username" @@ -101,7 +102,6 @@ async def test_form_import(hass): CONF_CLIENT_ID: "client_id", CONF_CLIENT_SECRET: "client_secret", } - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 diff --git a/tests/components/griddy/test_config_flow.py b/tests/components/griddy/test_config_flow.py index 309864dbc11f50e1c7acdd1922b402dc762c9163..0b2656dcf095aead4277780798ab727f80b006e6 100644 --- a/tests/components/griddy/test_config_flow.py +++ b/tests/components/griddy/test_config_flow.py @@ -29,11 +29,11 @@ async def test_form(hass): result["flow_id"], {"loadzone": "LZ_HOUSTON"}, ) + await hass.async_block_till_done() assert result2["type"] == "create_entry" assert result2["title"] == "Load Zone LZ_HOUSTON" assert result2["data"] == {"loadzone": "LZ_HOUSTON"} - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 diff --git a/tests/components/harmony/test_config_flow.py b/tests/components/harmony/test_config_flow.py index d6bd4022d9ead79d4f9675a2aa4fd9eff28403f3..994188eb62a0b8b39eb5223c0a2ae71586c5e576 100644 --- a/tests/components/harmony/test_config_flow.py +++ b/tests/components/harmony/test_config_flow.py @@ -56,11 +56,11 @@ async def test_user_form(hass): result["flow_id"], {"host": "1.2.3.4", "name": "friend"}, ) + await hass.async_block_till_done() assert result2["type"] == "create_entry" assert result2["title"] == "friend" assert result2["data"] == {"host": "1.2.3.4", "name": "friend"} - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 @@ -90,6 +90,7 @@ async def test_form_import(hass): "unique_id": "555234534543", }, ) + await hass.async_block_till_done() assert result["result"].unique_id == "555234534543" assert result["type"] == "create_entry" @@ -103,7 +104,6 @@ async def test_form_import(hass): # It is not possible to import options at this time # so they end up in the config entry data and are # used a fallback when they are not in options - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 @@ -147,11 +147,11 @@ async def test_form_ssdp(hass): result["flow_id"], {}, ) + await hass.async_block_till_done() assert result2["type"] == "create_entry" assert result2["title"] == "Harmony Hub" assert result2["data"] == {"host": "192.168.1.12", "name": "Harmony Hub"} - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 diff --git a/tests/components/hlk_sw16/test_config_flow.py b/tests/components/hlk_sw16/test_config_flow.py index 7b7468047be8bc6e9de68616bc789e68774258e5..ea637c805cdd04feabbc80079c8aa9e8bee23f0a 100644 --- a/tests/components/hlk_sw16/test_config_flow.py +++ b/tests/components/hlk_sw16/test_config_flow.py @@ -77,6 +77,7 @@ async def test_form(hass): result["flow_id"], conf, ) + await hass.async_block_till_done() assert result2["type"] == "create_entry" assert result2["title"] == "127.0.0.1:8080" @@ -84,7 +85,6 @@ async def test_form(hass): "host": "127.0.0.1", "port": 8080, } - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 @@ -139,6 +139,7 @@ async def test_import(hass): result["flow_id"], conf, ) + await hass.async_block_till_done() assert result2["type"] == "create_entry" assert result2["title"] == "127.0.0.1:8080" @@ -146,7 +147,6 @@ async def test_import(hass): "host": "127.0.0.1", "port": 8080, } - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 diff --git a/tests/components/homekit/test_config_flow.py b/tests/components/homekit/test_config_flow.py index e161d746c3c6bf11ac4499c84ac1c7ca70c930a8..60dc293c4fdf67144ad22a6a929dcc48768b9503 100644 --- a/tests/components/homekit/test_config_flow.py +++ b/tests/components/homekit/test_config_flow.py @@ -62,6 +62,7 @@ async def test_user_form(hass): result["flow_id"], {}, ) + await hass.async_block_till_done() assert result3["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY assert result3["title"][:11] == "HASS Bridge" @@ -77,7 +78,6 @@ async def test_user_form(hass): "name": bridge_name, "port": 12345, } - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 @@ -111,6 +111,7 @@ async def test_import(hass): context={"source": config_entries.SOURCE_IMPORT}, data={CONF_NAME: "othername", CONF_PORT: 56789}, ) + await hass.async_block_till_done() assert result2["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY assert result2["title"] == "othername:56789" @@ -118,7 +119,6 @@ async def test_import(hass): "name": "othername", "port": 56789, } - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 2 diff --git a/tests/components/hunterdouglas_powerview/test_config_flow.py b/tests/components/hunterdouglas_powerview/test_config_flow.py index 37fb150ddf7e0939831234777c62683522603366..84457a14a5ed28450e0caff5b89880004a5e1906 100644 --- a/tests/components/hunterdouglas_powerview/test_config_flow.py +++ b/tests/components/hunterdouglas_powerview/test_config_flow.py @@ -46,13 +46,13 @@ async def test_user_form(hass): result["flow_id"], {"host": "1.2.3.4"}, ) + await hass.async_block_till_done() assert result2["type"] == "create_entry" assert result2["title"] == "AlexanderHD" assert result2["data"] == { "host": "1.2.3.4", } - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 @@ -89,13 +89,13 @@ async def test_form_import(hass): context={"source": config_entries.SOURCE_IMPORT}, data={"host": "1.2.3.4"}, ) + await hass.async_block_till_done() assert result["type"] == "create_entry" assert result["title"] == "AlexanderHD" assert result["data"] == { "host": "1.2.3.4", } - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 @@ -141,13 +141,13 @@ async def test_form_homekit(hass): return_value=True, ) as mock_setup_entry: result2 = await hass.config_entries.flow.async_configure(result["flow_id"], {}) + await hass.async_block_till_done() assert result2["type"] == "create_entry" assert result2["title"] == "PowerViewHub" assert result2["data"] == {"host": "1.2.3.4"} assert result2["result"].unique_id == "ABC123" - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 diff --git a/tests/components/insteon/test_config_flow.py b/tests/components/insteon/test_config_flow.py index f4a3806a891c33b26809c9c1ba6dd699b56e328e..4e060b0d840c79a42e6145a198f84df65a8432a7 100644 --- a/tests/components/insteon/test_config_flow.py +++ b/tests/components/insteon/test_config_flow.py @@ -88,6 +88,7 @@ async def _device_form(hass, flow_id, connection, user_input): return_value=True, ) as mock_setup_entry: result = await hass.config_entries.flow.async_configure(flow_id, user_input) + await hass.async_block_till_done() return result, mock_setup, mock_setup_entry @@ -130,7 +131,6 @@ async def test_form_select_plm(hass: HomeAssistantType): assert result2["type"] == "create_entry" assert result2["data"] == MOCK_USER_INPUT_PLM - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 @@ -149,7 +149,6 @@ async def test_form_select_hub_v1(hass: HomeAssistantType): CONF_HUB_VERSION: 1, } - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 @@ -168,7 +167,6 @@ async def test_form_select_hub_v2(hass: HomeAssistantType): CONF_HUB_VERSION: 2, } - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 diff --git a/tests/components/isy994/test_config_flow.py b/tests/components/isy994/test_config_flow.py index cbbc7427f9f1473ea4677dc2b969f9e215f763b3..2fe19a0a9fd55b4996c46dcdfe9c46cf5c7e8e33 100644 --- a/tests/components/isy994/test_config_flow.py +++ b/tests/components/isy994/test_config_flow.py @@ -93,11 +93,11 @@ async def test_form(hass: HomeAssistantType): result["flow_id"], MOCK_USER_INPUT, ) + await hass.async_block_till_done() assert result2["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY assert result2["title"] == f"{MOCK_DEVICE_NAME} ({MOCK_HOSTNAME})" assert result2["result"].unique_id == MOCK_UUID assert result2["data"] == MOCK_USER_INPUT - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 @@ -310,11 +310,11 @@ async def test_form_ssdp(hass: HomeAssistantType): result["flow_id"], MOCK_USER_INPUT, ) + await hass.async_block_till_done() assert result2["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY assert result2["title"] == f"{MOCK_DEVICE_NAME} ({MOCK_HOSTNAME})" assert result2["result"].unique_id == MOCK_UUID assert result2["data"] == MOCK_USER_INPUT - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 diff --git a/tests/components/juicenet/test_config_flow.py b/tests/components/juicenet/test_config_flow.py index 4f00e9a1a7603e6ee46020074f71711cf6cd0582..3a7d2f06c4307839bb02e54cfb586eacd732414b 100644 --- a/tests/components/juicenet/test_config_flow.py +++ b/tests/components/juicenet/test_config_flow.py @@ -35,11 +35,11 @@ async def test_form(hass): result2 = await hass.config_entries.flow.async_configure( result["flow_id"], {CONF_ACCESS_TOKEN: "access_token"} ) + await hass.async_block_till_done() assert result2["type"] == "create_entry" assert result2["title"] == "JuiceNet" assert result2["data"] == {CONF_ACCESS_TOKEN: "access_token"} - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 @@ -114,10 +114,10 @@ async def test_import(hass): context={"source": config_entries.SOURCE_IMPORT}, data={CONF_ACCESS_TOKEN: "access_token"}, ) + await hass.async_block_till_done() assert result["type"] == "create_entry" assert result["title"] == "JuiceNet" assert result["data"] == {CONF_ACCESS_TOKEN: "access_token"} - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 diff --git a/tests/components/kodi/test_config_flow.py b/tests/components/kodi/test_config_flow.py index 71c2bce13074a89af31100aa9939a9a06c7080f8..9b010f3ed4291305237fc02197e62304479ea523 100644 --- a/tests/components/kodi/test_config_flow.py +++ b/tests/components/kodi/test_config_flow.py @@ -51,6 +51,7 @@ async def test_user_flow(hass, user_flow): return_value=True, ) as mock_setup_entry: result = await hass.config_entries.flow.async_configure(user_flow, TEST_HOST) + await hass.async_block_till_done() assert result["type"] == "create_entry" assert result["title"] == TEST_HOST["host"] @@ -63,7 +64,6 @@ async def test_user_flow(hass, user_flow): "timeout": DEFAULT_TIMEOUT, } - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 @@ -98,6 +98,7 @@ async def test_form_valid_auth(hass, user_flow): result = await hass.config_entries.flow.async_configure( result["flow_id"], TEST_CREDENTIALS ) + await hass.async_block_till_done() assert result["type"] == "create_entry" assert result["title"] == TEST_HOST["host"] @@ -109,7 +110,6 @@ async def test_form_valid_auth(hass, user_flow): "timeout": DEFAULT_TIMEOUT, } - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 @@ -148,6 +148,7 @@ async def test_form_valid_ws_port(hass, user_flow): result = await hass.config_entries.flow.async_configure( result["flow_id"], TEST_WS_PORT ) + await hass.async_block_till_done() assert result["type"] == "create_entry" assert result["title"] == TEST_HOST["host"] @@ -160,7 +161,6 @@ async def test_form_valid_ws_port(hass, user_flow): "timeout": DEFAULT_TIMEOUT, } - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 @@ -193,6 +193,7 @@ async def test_form_empty_ws_port(hass, user_flow): result = await hass.config_entries.flow.async_configure( result["flow_id"], {"ws_port": 0} ) + await hass.async_block_till_done() assert result["type"] == "create_entry" assert result["title"] == TEST_HOST["host"] @@ -205,7 +206,6 @@ async def test_form_empty_ws_port(hass, user_flow): "timeout": DEFAULT_TIMEOUT, } - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 @@ -436,6 +436,7 @@ async def test_discovery(hass): result = await hass.config_entries.flow.async_configure( flow_id=result["flow_id"], user_input={} ) + await hass.async_block_till_done() assert result["type"] == "create_entry" assert result["title"] == "hostname" @@ -448,7 +449,6 @@ async def test_discovery(hass): "timeout": DEFAULT_TIMEOUT, } - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 @@ -592,12 +592,12 @@ async def test_form_import(hass): context={"source": config_entries.SOURCE_IMPORT}, data=TEST_IMPORT, ) + await hass.async_block_till_done() assert result["type"] == "create_entry" assert result["title"] == TEST_IMPORT["name"] assert result["data"] == TEST_IMPORT - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 diff --git a/tests/components/melcloud/test_config_flow.py b/tests/components/melcloud/test_config_flow.py index ab3d16a0d6af2d3621d2cfdf8cbbf37739dbb61e..1fca3ac877e11859274549af86cc1a5280429dac 100644 --- a/tests/components/melcloud/test_config_flow.py +++ b/tests/components/melcloud/test_config_flow.py @@ -61,6 +61,7 @@ async def test_form(hass, mock_login, mock_get_devices): result["flow_id"], {"username": "test-email@test-domain.com", "password": "test-password"}, ) + await hass.async_block_till_done() assert result2["type"] == "create_entry" assert result2["title"] == "test-email@test-domain.com" @@ -68,7 +69,6 @@ async def test_form(hass, mock_login, mock_get_devices): "username": "test-email@test-domain.com", "token": "test-token", } - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 @@ -128,6 +128,7 @@ async def test_import_with_token(hass, mock_login, mock_get_devices): context={"source": config_entries.SOURCE_IMPORT}, data={"username": "test-email@test-domain.com", "token": "test-token"}, ) + await hass.async_block_till_done() assert result["type"] == "create_entry" assert result["title"] == "test-email@test-domain.com" @@ -135,7 +136,6 @@ async def test_import_with_token(hass, mock_login, mock_get_devices): "username": "test-email@test-domain.com", "token": "test-token", } - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 diff --git a/tests/components/metoffice/test_config_flow.py b/tests/components/metoffice/test_config_flow.py index 5987d44ac271428ba8f01efc1fa634c69553fd06..3f248704fa19cd042ea81ae05133fb6ef43d1945 100644 --- a/tests/components/metoffice/test_config_flow.py +++ b/tests/components/metoffice/test_config_flow.py @@ -42,6 +42,7 @@ async def test_form(hass, requests_mock): result2 = await hass.config_entries.flow.async_configure( result["flow_id"], {"api_key": TEST_API_KEY} ) + await hass.async_block_till_done() assert result2["type"] == "create_entry" assert result2["title"] == TEST_SITE_NAME_WAVERTREE @@ -51,7 +52,6 @@ async def test_form(hass, requests_mock): "longitude": TEST_LONGITUDE_WAVERTREE, "name": TEST_SITE_NAME_WAVERTREE, } - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 diff --git a/tests/components/monoprice/test_config_flow.py b/tests/components/monoprice/test_config_flow.py index e2aae6eddaa7530fd544c9c584a33df55b7bb582..f3530bb2c755e79305d73a2b7a6c17d57c1cbfcb 100644 --- a/tests/components/monoprice/test_config_flow.py +++ b/tests/components/monoprice/test_config_flow.py @@ -43,6 +43,7 @@ async def test_form(hass): result2 = await hass.config_entries.flow.async_configure( result["flow_id"], CONFIG ) + await hass.async_block_till_done() assert result2["type"] == "create_entry" assert result2["title"] == CONFIG[CONF_PORT] @@ -50,7 +51,6 @@ async def test_form(hass): CONF_PORT: CONFIG[CONF_PORT], CONF_SOURCES: {"1": CONFIG[CONF_SOURCE_1], "4": CONFIG[CONF_SOURCE_4]}, } - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 diff --git a/tests/components/myq/test_config_flow.py b/tests/components/myq/test_config_flow.py index 4d1bf7db68334640549cda87a62aff5b10a8ec33..e2c43e8ce5c02e7c612abda54531e1b78bdbc14d 100644 --- a/tests/components/myq/test_config_flow.py +++ b/tests/components/myq/test_config_flow.py @@ -31,6 +31,7 @@ async def test_form_user(hass): result["flow_id"], {"username": "test-username", "password": "test-password"}, ) + await hass.async_block_till_done() assert result2["type"] == "create_entry" assert result2["title"] == "test-username" @@ -38,7 +39,6 @@ async def test_form_user(hass): "username": "test-username", "password": "test-password", } - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 @@ -61,6 +61,7 @@ async def test_import(hass): context={"source": config_entries.SOURCE_IMPORT}, data={"username": "test-username", "password": "test-password"}, ) + await hass.async_block_till_done() assert result["type"] == "create_entry" assert result["title"] == "test-username" @@ -68,7 +69,6 @@ async def test_import(hass): "username": "test-username", "password": "test-password", } - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 diff --git a/tests/components/nexia/test_config_flow.py b/tests/components/nexia/test_config_flow.py index 944eb612038d0a05781530782ef9708ad5a310e6..81536f5beeaab6cb639f84f15b10b3535965ba73 100644 --- a/tests/components/nexia/test_config_flow.py +++ b/tests/components/nexia/test_config_flow.py @@ -33,6 +33,7 @@ async def test_form(hass): result["flow_id"], {CONF_USERNAME: "username", CONF_PASSWORD: "password"}, ) + await hass.async_block_till_done() assert result2["type"] == "create_entry" assert result2["title"] == "myhouse" @@ -40,7 +41,6 @@ async def test_form(hass): CONF_USERNAME: "username", CONF_PASSWORD: "password", } - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 @@ -162,6 +162,7 @@ async def test_form_import(hass): context={"source": config_entries.SOURCE_IMPORT}, data={CONF_USERNAME: "username", CONF_PASSWORD: "password"}, ) + await hass.async_block_till_done() assert result["type"] == "create_entry" assert result["title"] == "myhouse" @@ -169,7 +170,6 @@ async def test_form_import(hass): CONF_USERNAME: "username", CONF_PASSWORD: "password", } - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 diff --git a/tests/components/nuheat/test_config_flow.py b/tests/components/nuheat/test_config_flow.py index 4c392841142a5dd5b5039126f96d80a754af90c8..5b2259faea8c668af7ca6f50eaa907a6ba2ec829 100644 --- a/tests/components/nuheat/test_config_flow.py +++ b/tests/components/nuheat/test_config_flow.py @@ -40,6 +40,7 @@ async def test_form_user(hass): CONF_PASSWORD: "test-password", }, ) + await hass.async_block_till_done() assert result2["type"] == "create_entry" assert result2["title"] == "Master bathroom" @@ -48,7 +49,6 @@ async def test_form_user(hass): CONF_USERNAME: "test-username", CONF_PASSWORD: "test-password", } - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 @@ -79,6 +79,7 @@ async def test_form_import(hass): CONF_PASSWORD: "test-password", }, ) + await hass.async_block_till_done() assert result["type"] == "create_entry" assert result["title"] == "Master bathroom" @@ -87,7 +88,6 @@ async def test_form_import(hass): CONF_USERNAME: "test-username", CONF_PASSWORD: "test-password", } - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 diff --git a/tests/components/nut/test_config_flow.py b/tests/components/nut/test_config_flow.py index 8d50d77c31d4bca5b85b40fced9c6d25cae876c7..e003ecd796b0e76258b87aa558670d590a009ac3 100644 --- a/tests/components/nut/test_config_flow.py +++ b/tests/components/nut/test_config_flow.py @@ -57,6 +57,7 @@ async def test_form_zeroconf(hass): result2["flow_id"], {"resources": ["battery.voltage", "ups.status", "ups.status.display"]}, ) + await hass.async_block_till_done() assert result3["type"] == "create_entry" assert result3["title"] == "192.168.1.5:1234" @@ -68,7 +69,6 @@ async def test_form_zeroconf(hass): "username": "test-username", } assert result3["result"].unique_id is None - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 @@ -116,6 +116,7 @@ async def test_form_user_one_ups(hass): result2["flow_id"], {"resources": ["battery.voltage", "ups.status", "ups.status.display"]}, ) + await hass.async_block_till_done() assert result3["type"] == "create_entry" assert result3["title"] == "1.1.1.1:2222" @@ -126,7 +127,6 @@ async def test_form_user_one_ups(hass): "resources": ["battery.voltage", "ups.status", "ups.status.display"], "username": "test-username", } - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 @@ -195,6 +195,7 @@ async def test_form_user_multiple_ups(hass): result3["flow_id"], {"resources": ["battery.voltage"]}, ) + await hass.async_block_till_done() assert result4["type"] == "create_entry" assert result4["title"] == "ups2@1.1.1.1:2222" @@ -206,7 +207,6 @@ async def test_form_user_multiple_ups(hass): "resources": ["battery.voltage"], "username": "test-username", } - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 2 @@ -239,6 +239,7 @@ async def test_form_import(hass): "resources": ["battery.charge"], }, ) + await hass.async_block_till_done() assert result["type"] == "create_entry" assert result["title"] == "localhost:123" @@ -248,7 +249,6 @@ async def test_form_import(hass): "name": "name", "resources": ["battery.charge"], } - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 diff --git a/tests/components/nws/test_config_flow.py b/tests/components/nws/test_config_flow.py index 72e02f32b9da4233225f931613bdcfec7b87622f..2ea5f36a379a391d98c356fee0593535fefdb09b 100644 --- a/tests/components/nws/test_config_flow.py +++ b/tests/components/nws/test_config_flow.py @@ -28,6 +28,7 @@ async def test_form(hass, mock_simple_nws_config): result2 = await hass.config_entries.flow.async_configure( result["flow_id"], {"api_key": "test"} ) + await hass.async_block_till_done() assert result2["type"] == "create_entry" assert result2["title"] == "ABC" @@ -37,7 +38,6 @@ async def test_form(hass, mock_simple_nws_config): "longitude": -90, "station": "ABC", } - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 @@ -94,9 +94,9 @@ async def test_form_already_configured(hass, mock_simple_nws_config): result["flow_id"], {"api_key": "test"}, ) + await hass.async_block_till_done() assert result2["type"] == "create_entry" - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 diff --git a/tests/components/omnilogic/test_config_flow.py b/tests/components/omnilogic/test_config_flow.py index ef29ff9f67439c031744533df738502f37baf15b..6243fe10efbfe914573c6b677d3905ef02cc3c63 100644 --- a/tests/components/omnilogic/test_config_flow.py +++ b/tests/components/omnilogic/test_config_flow.py @@ -32,11 +32,11 @@ async def test_form(hass): result["flow_id"], DATA, ) + await hass.async_block_till_done() assert result2["type"] == "create_entry" assert result2["title"] == "Omnilogic" assert result2["data"] == DATA - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 diff --git a/tests/components/opentherm_gw/test_config_flow.py b/tests/components/opentherm_gw/test_config_flow.py index a696bc47590e107bbbda30db01e944b53c8dd0e8..d2d31d9762889489e4c627830e5397a62716a92b 100644 --- a/tests/components/opentherm_gw/test_config_flow.py +++ b/tests/components/opentherm_gw/test_config_flow.py @@ -40,6 +40,7 @@ async def test_form_user(hass): result2 = await hass.config_entries.flow.async_configure( result["flow_id"], {CONF_NAME: "Test Entry 1", CONF_DEVICE: "/dev/ttyUSB0"} ) + await hass.async_block_till_done() assert result2["type"] == "create_entry" assert result2["title"] == "Test Entry 1" @@ -48,7 +49,6 @@ async def test_form_user(hass): CONF_DEVICE: "/dev/ttyUSB0", CONF_ID: "test_entry_1", } - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 assert len(mock_pyotgw_connect.mock_calls) == 1 diff --git a/tests/components/ozw/test_config_flow.py b/tests/components/ozw/test_config_flow.py index 1af6787a9528c31b67bfc412090d8e804af60498..f6b9f388146cfccf88c0eafd9c73c9c4b07c20d6 100644 --- a/tests/components/ozw/test_config_flow.py +++ b/tests/components/ozw/test_config_flow.py @@ -24,11 +24,11 @@ async def test_user_create_entry(hass): return_value=True, ) as mock_setup_entry: result2 = await hass.config_entries.flow.async_configure(result["flow_id"], {}) + await hass.async_block_till_done() assert result2["type"] == "create_entry" assert result2["title"] == TITLE assert result2["data"] == {} - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 diff --git a/tests/components/plum_lightpad/test_config_flow.py b/tests/components/plum_lightpad/test_config_flow.py index 7f6196ef9b71fd9c5016b4f818d51f537f00e879..f2ac756c4a361bc28bec519a40e9cf1070c38cab 100644 --- a/tests/components/plum_lightpad/test_config_flow.py +++ b/tests/components/plum_lightpad/test_config_flow.py @@ -30,6 +30,7 @@ async def test_form(hass): result["flow_id"], {"username": "test-plum-username", "password": "test-plum-password"}, ) + await hass.async_block_till_done() assert result2["type"] == "create_entry" assert result2["title"] == "test-plum-username" @@ -37,7 +38,6 @@ async def test_form(hass): "username": "test-plum-username", "password": "test-plum-password", } - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 diff --git a/tests/components/poolsense/test_config_flow.py b/tests/components/poolsense/test_config_flow.py index c969ed9c41600a795cae0d13c9503b29e8f7076f..8ea05339c842992bd3de0d60d85eb07481c5489e 100644 --- a/tests/components/poolsense/test_config_flow.py +++ b/tests/components/poolsense/test_config_flow.py @@ -47,10 +47,10 @@ async def test_valid_credentials(hass): context={"source": SOURCE_USER}, data={CONF_EMAIL: "test-email", CONF_PASSWORD: "test-password"}, ) + await hass.async_block_till_done() assert result["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY assert result["title"] == "test-email" - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 diff --git a/tests/components/powerwall/test_config_flow.py b/tests/components/powerwall/test_config_flow.py index 5f9445debe018a4a4d6bb362e75622484dfa564e..4f1a587b31b6481f64d54a766d983e575a2b736f 100644 --- a/tests/components/powerwall/test_config_flow.py +++ b/tests/components/powerwall/test_config_flow.py @@ -35,11 +35,11 @@ async def test_form_source_user(hass): result["flow_id"], {CONF_IP_ADDRESS: "1.2.3.4"}, ) + await hass.async_block_till_done() assert result2["type"] == "create_entry" assert result2["title"] == "My site" assert result2["data"] == {CONF_IP_ADDRESS: "1.2.3.4"} - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 @@ -63,11 +63,11 @@ async def test_form_source_import(hass): context={"source": config_entries.SOURCE_IMPORT}, data={CONF_IP_ADDRESS: "1.2.3.4"}, ) + await hass.async_block_till_done() assert result["type"] == "create_entry" assert result["title"] == "Imported site" assert result["data"] == {CONF_IP_ADDRESS: "1.2.3.4"} - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 diff --git a/tests/components/profiler/test_config_flow.py b/tests/components/profiler/test_config_flow.py index e6cb62421afd2622ba27175c164d45268282a624..dc2ddff14d9c2fb1266332f7e091c49fe0045b6e 100644 --- a/tests/components/profiler/test_config_flow.py +++ b/tests/components/profiler/test_config_flow.py @@ -25,11 +25,11 @@ async def test_form_user(hass): result["flow_id"], {}, ) + await hass.async_block_till_done() assert result2["type"] == "create_entry" assert result2["title"] == "Profiler" assert result2["data"] == {} - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 diff --git a/tests/components/rachio/test_config_flow.py b/tests/components/rachio/test_config_flow.py index eb6b5ef438620366d46b72c7de075a0702a15310..75d671262a15bc8a26129769fe02e99aeacec038 100644 --- a/tests/components/rachio/test_config_flow.py +++ b/tests/components/rachio/test_config_flow.py @@ -50,6 +50,7 @@ async def test_form(hass): CONF_MANUAL_RUN_MINS: 5, }, ) + await hass.async_block_till_done() assert result2["type"] == "create_entry" assert result2["title"] == "myusername" @@ -58,7 +59,6 @@ async def test_form(hass): CONF_CUSTOM_URL: "http://custom.url", CONF_MANUAL_RUN_MINS: 5, } - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 diff --git a/tests/components/ring/test_config_flow.py b/tests/components/ring/test_config_flow.py index 1be0a05fc5e17a590a718586111b50dc9b3db6cb..fc2b490f56039e61d77dfd070d5eeff173f0a224 100644 --- a/tests/components/ring/test_config_flow.py +++ b/tests/components/ring/test_config_flow.py @@ -30,6 +30,7 @@ async def test_form(hass): result["flow_id"], {"username": "hello@home-assistant.io", "password": "test-password"}, ) + await hass.async_block_till_done() assert result2["type"] == "create_entry" assert result2["title"] == "hello@home-assistant.io" @@ -37,7 +38,6 @@ async def test_form(hass): "username": "hello@home-assistant.io", "token": {"access_token": "mock-token"}, } - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 diff --git a/tests/components/risco/test_config_flow.py b/tests/components/risco/test_config_flow.py index 47fd0927cb107279a207f8b158a60f6639d695f2..ba14a52553eabb4e921652960115dfc22d8d028d 100644 --- a/tests/components/risco/test_config_flow.py +++ b/tests/components/risco/test_config_flow.py @@ -66,11 +66,11 @@ async def test_form(hass): result2 = await hass.config_entries.flow.async_configure( result["flow_id"], TEST_DATA ) + await hass.async_block_till_done() assert result2["type"] == "create_entry" assert result2["title"] == TEST_SITE_NAME assert result2["data"] == TEST_DATA - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 mock_close.assert_awaited_once() diff --git a/tests/components/roku/test_config_flow.py b/tests/components/roku/test_config_flow.py index 58acc7a6bdf6ec27ea4e308b4d0d2949b5066336..0fb77e46139529d70cbae0482aaa545651b9c442 100644 --- a/tests/components/roku/test_config_flow.py +++ b/tests/components/roku/test_config_flow.py @@ -76,6 +76,7 @@ async def test_form( result = await hass.config_entries.flow.async_configure( flow_id=result["flow_id"], user_input=user_input ) + await hass.async_block_till_done() assert result["type"] == RESULT_TYPE_CREATE_ENTRY assert result["title"] == UPNP_FRIENDLY_NAME @@ -83,7 +84,6 @@ async def test_form( assert result["data"] assert result["data"][CONF_HOST] == HOST - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 @@ -144,6 +144,7 @@ async def test_import( result = await hass.config_entries.flow.async_init( DOMAIN, context={CONF_SOURCE: SOURCE_IMPORT}, data=user_input ) + await hass.async_block_till_done() assert result["type"] == RESULT_TYPE_CREATE_ENTRY assert result["title"] == UPNP_FRIENDLY_NAME @@ -151,7 +152,6 @@ async def test_import( assert result["data"] assert result["data"][CONF_HOST] == HOST - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 @@ -216,6 +216,7 @@ async def test_ssdp_discovery( result = await hass.config_entries.flow.async_configure( flow_id=result["flow_id"], user_input={} ) + await hass.async_block_till_done() assert result["type"] == RESULT_TYPE_CREATE_ENTRY assert result["title"] == UPNP_FRIENDLY_NAME @@ -224,6 +225,5 @@ async def test_ssdp_discovery( assert result["data"][CONF_HOST] == HOST assert result["data"][CONF_NAME] == UPNP_FRIENDLY_NAME - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 diff --git a/tests/components/roomba/test_config_flow.py b/tests/components/roomba/test_config_flow.py index b2ad3a742350ffa917d0fe0c8022ee8867af6aac..d2af07070bb278ddfc49c5b11f934c74fa5b4502 100644 --- a/tests/components/roomba/test_config_flow.py +++ b/tests/components/roomba/test_config_flow.py @@ -62,6 +62,7 @@ async def test_form(hass): result["flow_id"], VALID_CONFIG, ) + await hass.async_block_till_done() assert result2["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY assert result2["title"] == "myroomba" @@ -74,7 +75,6 @@ async def test_form(hass): CONF_HOST: "1.2.3.4", CONF_PASSWORD: "password", } - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 @@ -126,6 +126,7 @@ async def test_form_import(hass): context={"source": config_entries.SOURCE_IMPORT}, data=VALID_YAML_CONFIG.copy(), ) + await hass.async_block_till_done() assert result["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY assert result["result"].unique_id == "blid" @@ -138,7 +139,6 @@ async def test_form_import(hass): CONF_PASSWORD: "password", } - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 diff --git a/tests/components/roon/test_config_flow.py b/tests/components/roon/test_config_flow.py index aae655fb9c544df406c3cc6ed0ee97a48977cc2e..7ffac08d9f63c2195530a273bf0f73654e808271 100644 --- a/tests/components/roon/test_config_flow.py +++ b/tests/components/roon/test_config_flow.py @@ -51,11 +51,11 @@ async def test_form_and_auth(hass): result2 = await hass.config_entries.flow.async_configure( result["flow_id"], user_input={} ) + await hass.async_block_till_done() assert result2["type"] == "create_entry" assert result2["title"] == "Roon Labs Music Player" assert result2["data"] == {"host": "1.1.1.1", "api_key": "good_token"} - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 @@ -136,11 +136,11 @@ async def test_form_host_already_exists(hass): result2 = await hass.config_entries.flow.async_configure( result["flow_id"], user_input={} ) + await hass.async_block_till_done() assert result2["type"] == "create_entry" assert result2["title"] == "Roon Labs Music Player" assert result2["data"] == {"host": "1.1.1.1", "api_key": "good_token"} - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 2 diff --git a/tests/components/ruckus_unleashed/test_config_flow.py b/tests/components/ruckus_unleashed/test_config_flow.py index 8348ec4f2a880121ee4b2800b99f482bba0ac6a1..39112dd44aa47bd75d23c7125d78800f69fbb9ad 100644 --- a/tests/components/ruckus_unleashed/test_config_flow.py +++ b/tests/components/ruckus_unleashed/test_config_flow.py @@ -39,11 +39,11 @@ async def test_form(hass): result["flow_id"], CONFIG, ) + await hass.async_block_till_done() assert result2["type"] == "create_entry" assert result2["title"] == DEFAULT_TITLE assert result2["data"] == CONFIG - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 diff --git a/tests/components/sense/test_config_flow.py b/tests/components/sense/test_config_flow.py index 4cda15f73036b6f1ecb797974858bf2631640278..44bd9c7265c602d462fd26d5f6f9fbf84f3ca41e 100644 --- a/tests/components/sense/test_config_flow.py +++ b/tests/components/sense/test_config_flow.py @@ -26,6 +26,7 @@ async def test_form(hass): result["flow_id"], {"timeout": "6", "email": "test-email", "password": "test-password"}, ) + await hass.async_block_till_done() assert result2["type"] == "create_entry" assert result2["title"] == "test-email" @@ -34,7 +35,6 @@ async def test_form(hass): "email": "test-email", "password": "test-password", } - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 diff --git a/tests/components/shelly/test_config_flow.py b/tests/components/shelly/test_config_flow.py index 280688a06188ceaa70673ddd2ad65eea24aa1eee..ce0c380dd95879487aa863b2f62539bd6c06d77b 100644 --- a/tests/components/shelly/test_config_flow.py +++ b/tests/components/shelly/test_config_flow.py @@ -57,13 +57,13 @@ async def test_form(hass): result["flow_id"], {"host": "1.1.1.1"}, ) + await hass.async_block_till_done() assert result2["type"] == "create_entry" assert result2["title"] == "Test name" assert result2["data"] == { "host": "1.1.1.1", } - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 @@ -102,13 +102,13 @@ async def test_title_without_name_and_prefix(hass): result["flow_id"], {"host": "1.1.1.1"}, ) + await hass.async_block_till_done() assert result2["type"] == "create_entry" assert result2["title"] == "shelly1pm-12345" assert result2["data"] == { "host": "1.1.1.1", } - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 @@ -151,6 +151,7 @@ async def test_form_auth(hass): result2["flow_id"], {"username": "test username", "password": "test password"}, ) + await hass.async_block_till_done() assert result3["type"] == "create_entry" assert result3["title"] == "Test name" @@ -159,7 +160,6 @@ async def test_form_auth(hass): "username": "test username", "password": "test password", } - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 @@ -323,13 +323,13 @@ async def test_zeroconf(hass): result["flow_id"], {}, ) + await hass.async_block_till_done() assert result2["type"] == "create_entry" assert result2["title"] == "Test name" assert result2["data"] == { "host": "1.1.1.1", } - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 @@ -480,6 +480,7 @@ async def test_zeroconf_require_auth(hass): result2["flow_id"], {"username": "test username", "password": "test password"}, ) + await hass.async_block_till_done() assert result3["type"] == "create_entry" assert result3["title"] == "Test name" @@ -488,7 +489,6 @@ async def test_zeroconf_require_auth(hass): "username": "test username", "password": "test password", } - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 diff --git a/tests/components/smart_meter_texas/test_config_flow.py b/tests/components/smart_meter_texas/test_config_flow.py index 729cb0a90b2bc88099184a2208e6d45a124fe46b..4908a50e57d31753f21aad9a08896220b430e41f 100644 --- a/tests/components/smart_meter_texas/test_config_flow.py +++ b/tests/components/smart_meter_texas/test_config_flow.py @@ -36,11 +36,11 @@ async def test_form(hass): result2 = await hass.config_entries.flow.async_configure( result["flow_id"], TEST_LOGIN ) + await hass.async_block_till_done() assert result2["type"] == "create_entry" assert result2["title"] == TEST_LOGIN[CONF_USERNAME] assert result2["data"] == TEST_LOGIN - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 diff --git a/tests/components/smarthab/test_config_flow.py b/tests/components/smarthab/test_config_flow.py index d15fe58999e7abf8b5f1c109e217df6e3afec840..6b8c58b1f705a4165b0c2eb0e53d0bba8b806e6f 100644 --- a/tests/components/smarthab/test_config_flow.py +++ b/tests/components/smarthab/test_config_flow.py @@ -28,6 +28,7 @@ async def test_form(hass): result["flow_id"], {CONF_EMAIL: "mock@example.com", CONF_PASSWORD: "test-password"}, ) + await hass.async_block_till_done() assert result2["type"] == "create_entry" assert result2["title"] == "mock@example.com" @@ -35,7 +36,6 @@ async def test_form(hass): CONF_EMAIL: "mock@example.com", CONF_PASSWORD: "test-password", } - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 @@ -115,6 +115,7 @@ async def test_import(hass): result = await hass.config_entries.flow.async_init( DOMAIN, context={"source": config_entries.SOURCE_IMPORT}, data=imported_conf ) + await hass.async_block_till_done() assert result["type"] == "create_entry" assert result["title"] == "mock@example.com" @@ -122,6 +123,5 @@ async def test_import(hass): CONF_EMAIL: "mock@example.com", CONF_PASSWORD: "test-password", } - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 diff --git a/tests/components/solarlog/test_config_flow.py b/tests/components/solarlog/test_config_flow.py index 9cf0e2932ec754883acf12189a53ab76eaabcf17..8266adfd4178fd562660f7edd53048164fb1df07 100644 --- a/tests/components/solarlog/test_config_flow.py +++ b/tests/components/solarlog/test_config_flow.py @@ -34,11 +34,11 @@ async def test_form(hass): result2 = await hass.config_entries.flow.async_configure( result["flow_id"], {"host": HOST, "name": NAME} ) + await hass.async_block_till_done() assert result2["type"] == "create_entry" assert result2["title"] == "solarlog_test_1_2_3" assert result2["data"] == {"host": "http://1.1.1.1"} - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 diff --git a/tests/components/spider/test_config_flow.py b/tests/components/spider/test_config_flow.py index 3bf7dd790b269f89e830985e9422a412aa71742d..ca1b37434d1b9ccde93977ad4ce0770b9e1a8290 100644 --- a/tests/components/spider/test_config_flow.py +++ b/tests/components/spider/test_config_flow.py @@ -42,6 +42,7 @@ async def test_user(hass, spider): result = await hass.config_entries.flow.async_configure( result["flow_id"], user_input=SPIDER_USER_DATA ) + await hass.async_block_till_done() assert result["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY assert result["title"] == DOMAIN @@ -49,7 +50,6 @@ async def test_user(hass, spider): assert result["data"][CONF_PASSWORD] == PASSWORD assert not result["result"].unique_id - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 @@ -69,6 +69,7 @@ async def test_import(hass, spider): context={"source": config_entries.SOURCE_IMPORT}, data=SPIDER_USER_DATA, ) + await hass.async_block_till_done() assert result["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY assert result["title"] == DOMAIN @@ -76,7 +77,6 @@ async def test_import(hass, spider): assert result["data"][CONF_PASSWORD] == PASSWORD assert not result["result"].unique_id - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 diff --git a/tests/components/tado/test_config_flow.py b/tests/components/tado/test_config_flow.py index 9bd3db5e46bd7731f183559d063672055ee05607..ce4af05b79ca2974e07c9e1c24dce5f78a2293c9 100644 --- a/tests/components/tado/test_config_flow.py +++ b/tests/components/tado/test_config_flow.py @@ -42,6 +42,7 @@ async def test_form(hass): result["flow_id"], {"username": "test-username", "password": "test-password"}, ) + await hass.async_block_till_done() assert result2["type"] == "create_entry" assert result2["title"] == "myhome" @@ -49,7 +50,6 @@ async def test_form(hass): "username": "test-username", "password": "test-password", } - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 @@ -74,6 +74,7 @@ async def test_import(hass): context={"source": config_entries.SOURCE_IMPORT}, data={"username": "test-username", "password": "test-password"}, ) + await hass.async_block_till_done() assert result["type"] == "create_entry" assert result["title"] == "myhome" @@ -81,7 +82,6 @@ async def test_import(hass): "username": "test-username", "password": "test-password", } - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 diff --git a/tests/components/tesla/test_config_flow.py b/tests/components/tesla/test_config_flow.py index 8b75fd904b99c7dccd52e7af255fc1cd1892062a..59cdf910bf4f9a1263d792eac3b4a349fb1d890c 100644 --- a/tests/components/tesla/test_config_flow.py +++ b/tests/components/tesla/test_config_flow.py @@ -42,6 +42,7 @@ async def test_form(hass): result2 = await hass.config_entries.flow.async_configure( result["flow_id"], {CONF_PASSWORD: "test", CONF_USERNAME: "test@email.com"} ) + await hass.async_block_till_done() assert result2["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY assert result2["title"] == "test@email.com" @@ -49,7 +50,6 @@ async def test_form(hass): CONF_TOKEN: "test-refresh-token", CONF_ACCESS_TOKEN: "test-access-token", } - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 diff --git a/tests/components/tuya/test_config_flow.py b/tests/components/tuya/test_config_flow.py index 81154a368ff5e9b340c3dc1391f46d46249a2a7e..e1b9bd3466c1b4805c4915ea37f3657c56af0908 100644 --- a/tests/components/tuya/test_config_flow.py +++ b/tests/components/tuya/test_config_flow.py @@ -47,6 +47,7 @@ async def test_user(hass, tuya): result = await hass.config_entries.flow.async_configure( result["flow_id"], user_input=TUYA_USER_DATA ) + await hass.async_block_till_done() assert result["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY assert result["title"] == USERNAME @@ -56,7 +57,6 @@ async def test_user(hass, tuya): assert result["data"][CONF_PLATFORM] == TUYA_PLATFORM assert not result["result"].unique_id - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 @@ -76,6 +76,7 @@ async def test_import(hass, tuya): context={"source": config_entries.SOURCE_IMPORT}, data=TUYA_USER_DATA, ) + await hass.async_block_till_done() assert result["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY assert result["title"] == USERNAME @@ -85,7 +86,6 @@ async def test_import(hass, tuya): assert result["data"][CONF_PLATFORM] == TUYA_PLATFORM assert not result["result"].unique_id - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 diff --git a/tests/components/upb/test_config_flow.py b/tests/components/upb/test_config_flow.py index f0b44a4bad82a2757ab741746f52123574416d3b..0c874399f88388554ddfa52bbcb08e4f9dd53a74 100644 --- a/tests/components/upb/test_config_flow.py +++ b/tests/components/upb/test_config_flow.py @@ -59,6 +59,7 @@ async def test_full_upb_flow_with_serial_port(hass): "file_path": "upb.upe", }, ) + await hass.async_block_till_done() assert flow["type"] == "form" assert flow["errors"] == {} @@ -68,7 +69,6 @@ async def test_full_upb_flow_with_serial_port(hass): "host": "serial:///dev/ttyS0:115200", "file_path": "upb.upe", } - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 @@ -125,12 +125,12 @@ async def test_form_import(hass): context={"source": config_entries.SOURCE_IMPORT}, data={"host": "tcp://42.4.2.42", "file_path": "upb.upe"}, ) + await hass.async_block_till_done() assert result["type"] == "create_entry" assert result["title"] == "UPB" assert result["data"] == {"host": "tcp://42.4.2.42", "file_path": "upb.upe"} - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 diff --git a/tests/components/vilfo/test_config_flow.py b/tests/components/vilfo/test_config_flow.py index f14ec123ba5be975b06b3598b8c65b665883a91f..ca77b199cfa2b4d69e9650f0a708720ba04518f5 100644 --- a/tests/components/vilfo/test_config_flow.py +++ b/tests/components/vilfo/test_config_flow.py @@ -38,7 +38,6 @@ async def test_form(hass): "access_token": "test-token", } - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 diff --git a/tests/components/volumio/test_config_flow.py b/tests/components/volumio/test_config_flow.py index a80d527b3f8d1229b00efd09b6b252d5c529f527..477ef25cb87f7c0134abede976f769d8d03ddc64 100644 --- a/tests/components/volumio/test_config_flow.py +++ b/tests/components/volumio/test_config_flow.py @@ -50,12 +50,12 @@ async def test_form(hass): result["flow_id"], TEST_CONNECTION, ) + await hass.async_block_till_done() assert result2["type"] == "create_entry" assert result2["title"] == "TestVolumio" assert result2["data"] == {**TEST_SYSTEM_INFO, **TEST_CONNECTION} - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 @@ -118,6 +118,7 @@ async def test_empty_system_info(hass): result["flow_id"], TEST_CONNECTION, ) + await hass.async_block_till_done() assert result2["type"] == "create_entry" assert result2["title"] == TEST_CONNECTION["host"] @@ -128,7 +129,6 @@ async def test_empty_system_info(hass): "id": None, } - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 @@ -191,6 +191,7 @@ async def test_discovery(hass): result["flow_id"], user_input={}, ) + await hass.async_block_till_done() assert result2["type"] == "create_entry" assert result2["title"] == TEST_DISCOVERY_RESULT["name"] @@ -199,7 +200,6 @@ async def test_discovery(hass): assert result2["result"] assert result2["result"].unique_id == TEST_DISCOVERY_RESULT["id"] - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1 diff --git a/tests/components/zerproc/test_config_flow.py b/tests/components/zerproc/test_config_flow.py index 9ffafca76dbe711ad543817d0674509b0740ee0f..1a607bb8c9ced60474928697014298158e8e59f4 100644 --- a/tests/components/zerproc/test_config_flow.py +++ b/tests/components/zerproc/test_config_flow.py @@ -29,12 +29,12 @@ async def test_flow_success(hass): result["flow_id"], {}, ) + await hass.async_block_till_done() assert result2["type"] == "create_entry" assert result2["title"] == "Zerproc" assert result2["data"] == {} - await hass.async_block_till_done() assert len(mock_setup.mock_calls) == 1 assert len(mock_setup_entry.mock_calls) == 1