mirror of
https://github.com/home-assistant/core.git
synced 2026-09-25 08:51:46 -04:00
Handle Timeout exceptions in system_health (#50017)
This commit is contained in:
@@ -113,6 +113,7 @@ async def test_platform_loading(hass, hass_ws_client, aioclient_mock):
|
||||
"""Test registering via platform."""
|
||||
aioclient_mock.get("http://example.com/status", text="")
|
||||
aioclient_mock.get("http://example.com/status_fail", exc=ClientError)
|
||||
aioclient_mock.get("http://example.com/timeout", exc=asyncio.TimeoutError)
|
||||
hass.config.components.add("fake_integration")
|
||||
mock_platform(
|
||||
hass,
|
||||
@@ -130,6 +131,11 @@ async def test_platform_loading(hass, hass_ws_client, aioclient_mock):
|
||||
"http://example.com/status_fail",
|
||||
more_info="http://more-info-url.com",
|
||||
),
|
||||
"server_timeout": system_health.async_check_can_reach_url(
|
||||
hass,
|
||||
"http://example.com/timeout",
|
||||
more_info="http://more-info-url.com",
|
||||
),
|
||||
"async_crash": AsyncMock(side_effect=ValueError)(),
|
||||
}
|
||||
),
|
||||
@@ -150,6 +156,11 @@ async def test_platform_loading(hass, hass_ws_client, aioclient_mock):
|
||||
"error": "unreachable",
|
||||
"more_info": "http://more-info-url.com",
|
||||
},
|
||||
"server_timeout": {
|
||||
"type": "failed",
|
||||
"error": "timeout",
|
||||
"more_info": "http://more-info-url.com",
|
||||
},
|
||||
"async_crash": {
|
||||
"type": "failed",
|
||||
"error": "unknown",
|
||||
|
||||
Reference in New Issue
Block a user