Skip to content

The agent that grows with you

test(homeassistant): errno 65 under launchd names the Local Network remedy (#71206)

xxxigm61938453c08e
diff --git a/tests/gateway/test_homeassistant.py b/tests/gateway/test_homeassistant.py
index 317e312ad59..a52bdae2876 100644
--- a/tests/gateway/test_homeassistant.py
+++ b/tests/gateway/test_homeassistant.py
@@ -318,3 +318,17 @@ class TestWsUrlConstruction:
ws_url = adapter._hass_url.replace("http://", "ws://").replace("https://", "wss://")
assert ws_url == "ws://ha:8123"
+
+class TestLocalNetworkConnectHint:
+ def test_ehostunreach_names_the_launchd_remedy(self):
+ from plugins.platforms.homeassistant.adapter import _connect_error_detail
+
+ err = OSError(65, "No route to host")
+ detail = _connect_error_detail(err)
+ assert "No route to host" in detail
+ assert "Local Network" in detail
+ assert "hermes gateway install" in detail
+ assert "71206" in detail
+ # Unrelated failures stay untouched.
+ assert _connect_error_detail(RuntimeError("auth failed")) == "auth failed"
+