From 537dbd837513c0446d5ad46b10733cd5116d7bc7 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sat, 16 Dec 2023 14:23:56 -1000 Subject: [PATCH] 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 --- tests/components/cloud/test_http_api.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/tests/components/cloud/test_http_api.py b/tests/components/cloud/test_http_api.py index a04729faf67..3d7e6a69e3c 100644 --- a/tests/components/cloud/test_http_api.py +++ b/tests/components/cloud/test_http_api.py @@ -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",