Change error handling in async_process_play_media_url (#90052)

This commit is contained in:
Erik Montnemery 2023-03-22 13:32:02 +01:00 committed by GitHub
parent 9b9ed21dc4
commit 19d56a7102
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -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(

View File

@ -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(