add a bit more coverage just to be sure

This commit is contained in:
J. Nick Koston
2023-03-02 10:58:35 -10:00
parent 0971453d71
commit 9004deefae

View File

@@ -349,6 +349,16 @@ async def test_api_template(hass: HomeAssistant, mock_api_client: TestClient) ->
assert body == "10"
hass.states.async_set("sensor.temperature", 20)
resp = await mock_api_client.post(
const.URL_API_TEMPLATE,
json={"template": "{{ states.sensor.temperature.state }}"},
)
body = await resp.text()
assert body == "20"
async def test_api_template_error(
hass: HomeAssistant, mock_api_client: TestClient