Fix cloud tests doing socket I/O (#105874)

https://github.com/home-assistant/core/actions/runs/7233101649/job/19708631179?pr=105868
https://github.com/home-assistant/core/actions/runs/7232949349?pr=105834

I was hoping to only patch the library, but when I did that it still failed
because it had no access token
This commit is contained in:
J. Nick Koston 2023-12-16 14:23:56 -10:00 committed by GitHub
parent 299a2ef04e
commit 537dbd8375
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1204,10 +1204,19 @@ async def test_list_alexa_entities(
"interfaces": ["Alexa.PowerController", "Alexa.EndpointHealth", "Alexa"],
}
# Add the entity to the entity registry
entity_registry.async_get_or_create(
"light", "test", "unique", suggested_object_id="kitchen"
)
with patch(
(
"homeassistant.components.cloud.alexa_config.CloudAlexaConfig"
".async_get_access_token"
),
), patch(
"homeassistant.components.cloud.alexa_config.alexa_state_report.async_send_add_or_update_message"
):
# Add the entity to the entity registry
entity_registry.async_get_or_create(
"light", "test", "unique", suggested_object_id="kitchen"
)
await hass.async_block_till_done()
with patch(
"homeassistant.components.alexa.entities.async_get_entities",