mirror of
https://github.com/home-assistant/core.git
synced 2025-11-08 18:39:30 +00:00
Render template during stream_url test for generic camera (#69716)
This commit is contained in:
@@ -534,6 +534,16 @@ async def test_options_template_error(hass, fakeimgbytes_png, mock_av_open):
|
||||
assert result4.get("type") == data_entry_flow.RESULT_TYPE_FORM
|
||||
assert result4["errors"] == {"still_image_url": "template_error"}
|
||||
|
||||
# verify that an invalid template reports the correct UI error.
|
||||
data[CONF_STILL_IMAGE_URL] = "http://127.0.0.1/testurl/1"
|
||||
data[CONF_STREAM_SOURCE] = "http://127.0.0.2/testurl/{{1/0}}"
|
||||
result5 = await hass.config_entries.options.async_configure(
|
||||
result4["flow_id"],
|
||||
user_input=data,
|
||||
)
|
||||
assert result5.get("type") == data_entry_flow.RESULT_TYPE_FORM
|
||||
assert result5["errors"] == {"stream_source": "template_error"}
|
||||
|
||||
|
||||
@respx.mock
|
||||
async def test_options_only_stream(hass, fakeimgbytes_png, mock_av_open):
|
||||
|
||||
Reference in New Issue
Block a user