Fix LingeringTask after test completion in enphase_envoy (#111940)

This commit is contained in:
Arie Catsman 2024-03-01 18:12:08 +01:00 committed by GitHub
parent 52fe0a5e96
commit 99f08fb417
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -28,6 +28,7 @@ async def test_form(hass: HomeAssistant, config, setup_enphase_envoy) -> None:
"password": "test-password",
},
)
await hass.async_block_till_done()
assert result2["type"] == "create_entry"
assert result2["title"] == "Envoy 1234"
assert result2["data"] == {
@ -57,6 +58,7 @@ async def test_user_no_serial_number(
"password": "test-password",
},
)
await hass.async_block_till_done()
assert result2["type"] == "create_entry"
assert result2["title"] == "Envoy"
assert result2["data"] == {
@ -86,6 +88,7 @@ async def test_user_fetching_serial_fails(
"password": "test-password",
},
)
await hass.async_block_till_done()
assert result2["type"] == "create_entry"
assert result2["title"] == "Envoy"
assert result2["data"] == {
@ -115,6 +118,7 @@ async def test_form_invalid_auth(hass: HomeAssistant, setup_enphase_envoy) -> No
"password": "test-password",
},
)
await hass.async_block_till_done()
assert result2["type"] == "form"
assert result2["errors"] == {"base": "invalid_auth"}
@ -136,6 +140,7 @@ async def test_form_cannot_connect(hass: HomeAssistant, setup_enphase_envoy) ->
"password": "test-password",
},
)
await hass.async_block_till_done()
assert result2["type"] == "form"
assert result2["errors"] == {"base": "cannot_connect"}
@ -157,6 +162,7 @@ async def test_form_unknown_error(hass: HomeAssistant, setup_enphase_envoy) -> N
"password": "test-password",
},
)
await hass.async_block_till_done()
assert result2["type"] == "form"
assert result2["errors"] == {"base": "unknown"}
@ -199,6 +205,7 @@ async def test_zeroconf_pre_token_firmware(
"password": "test-password",
},
)
await hass.async_block_till_done()
assert result2["type"] == "create_entry"
assert result2["title"] == "Envoy 1234"
assert result2["result"].unique_id == "1234"
@ -239,6 +246,7 @@ async def test_zeroconf_token_firmware(
"password": "test-password",
},
)
await hass.async_block_till_done()
assert result2["type"] == "create_entry"
assert result2["title"] == "Envoy 1234"
assert result2["result"].unique_id == "1234"
@ -330,6 +338,7 @@ async def test_zeroconf_serial_already_exists(
type="mock_type",
),
)
await hass.async_block_till_done()
assert result["type"] == "abort"
assert result["reason"] == "already_configured"
@ -353,6 +362,7 @@ async def test_zeroconf_serial_already_exists_ignores_ipv6(
type="mock_type",
),
)
await hass.async_block_till_done()
assert result["type"] == "abort"
assert result["reason"] == "not_ipv4_address"
@ -377,6 +387,7 @@ async def test_zeroconf_host_already_exists(
type="mock_type",
),
)
await hass.async_block_till_done()
assert result["type"] == "abort"
assert result["reason"] == "already_configured"
@ -401,6 +412,7 @@ async def test_reauth(hass: HomeAssistant, config_entry, setup_enphase_envoy) ->
"password": "test-password",
},
)
await hass.async_block_till_done()
assert result2["type"] == "abort"
assert result2["reason"] == "reauth_successful"