Render template during stream_url test for generic camera (#69716)

This commit is contained in:
Dave T
2022-05-25 08:02:48 +01:00
committed by GitHub
parent 4f14d40072
commit ce477e65ce
4 changed files with 21 additions and 0 deletions

View File

@@ -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):