Add bare hostname as valid known hostname in get_url helper (#40510)
This commit is contained in:
parent
35cfc80dd7
commit
c64eec3238
2 changed files with 13 additions and 3 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue