Add bare hostname as valid known hostname in get_url helper (#40510)
This commit is contained in:
1 parent
35cfc80dd7
commit
c64eec3238
2 files changed
+13
-3
No files matched your search
@@ -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):
|
||||
|
||||
Reference in new issue
Block a user