mirror of
https://github.com/home-assistant/core.git
synced 2025-04-23 16:57:53 +00:00
Change error handling in async_process_play_media_url (#90052)
This commit is contained in:
parent
9b9ed21dc4
commit
19d56a7102
@ -44,7 +44,7 @@ def async_process_play_media_url(
|
||||
return media_content_id
|
||||
else:
|
||||
if media_content_id[0] != "/":
|
||||
raise ValueError("URL is relative, but does not start with a /")
|
||||
return media_content_id
|
||||
|
||||
if parsed.query:
|
||||
logging.getLogger(__name__).debug(
|
||||
|
@ -86,8 +86,8 @@ async def test_process_play_media_url(hass: HomeAssistant, mock_sign_path) -> No
|
||||
== "http://example.local:8123/api/tts_proxy/bla"
|
||||
)
|
||||
|
||||
with pytest.raises(ValueError):
|
||||
async_process_play_media_url(hass, "hello")
|
||||
# Not changing a URL which is not absolute and does not start with /
|
||||
async_process_play_media_url(hass, "hello") == "hello"
|
||||
|
||||
|
||||
async def test_process_play_media_url_for_addon(
|
||||
|
Loading…
x
Reference in New Issue
Block a user