Add bare hostname as valid known hostname in get_url helper (#40510)

This commit is contained in:
Franck Nijhof authored and GitHub committed 2020-09-26 09:36:03 +02:00
1 parent 35cfc80dd7
commit c64eec3238
2 files changed
+13 -3

No files matched your search

+8
View File
@@ -848,6 +848,14 @@ async def test_get_current_request_url_with_known_host(
== "http://homeassistant.local:8123"
)
with patch(
"homeassistant.helpers.network._get_request_host",
return_value="homeassistant",
):
assert (
get_url(hass, require_current_request=True) == "http://homeassistant:8123"
)
with patch(
"homeassistant.helpers.network._get_request_host", return_value="unknown.local"
), pytest.raises(NoURLAvailableError):